Gossamer Forum
Home : Products : Gossamer Links : Discussions :

New and/or Updatd links on home.html ??

Quote Reply
New and/or Updatd links on home.html ??
I'm sure I had this on my home.html page before and removed it. Now I don't remember how I did it. I had new and updated links show on the front page home.html . Anybody know how to do this? This is in version: 2.2.1

Thanks,

Rich

Last edited by:

richonmaui: Sep 29, 2005, 11:06 PM
Quote Reply
Re: [richonmaui] New and/or Updatd links on home.html ?? In reply to
Try this; (new links only);

Code:
sub {
my $return;
my $sth = $DB->table('Links')->select( ['ID'],{ isNew => 'Yes' } ) || return $GT::SQL::error;
while (my $id = $sth->fetchrow) {
my $link = $DB->table('Links')->get( { ID => $id } );
$return .= Links::SiteHTML::display('link',$link);
}
return $return;
}

Just call with <%global_name%>

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] New and/or Updatd links on home.html ?? In reply to
Thanks Andy. I changed the isNew to isChanged and it works fine. Is it possible to have this only show a limited number, like 5 or 10, of the most recent changed links?

Thanks,

Rich
Quote Reply
Re: [richonmaui] New and/or Updatd links on home.html ?? In reply to
Hi,

No problem =)

Just change;

Code:
my $sth = $DB->table('Links')->select( ['ID'],{ isNew => 'Yes' } ) || return $GT::SQL::error;

..to;

Code:
my $tbl = $DB->table('Links');
$tbl->select_options('LIMIT 5');
my $sth = $tbl->select( ['ID'],{ isNew => 'Yes' } ) || return $GT::SQL::error;

(you will probably want to change isNew to isChanged too .. but I'll leave that to you <G>)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] New and/or Updatd links on home.html ?? In reply to
Fabulous! I already have a global and a call for each, New and Changed. Now I'll make it, oh... let's say... 5 of each.

Thanks!!!

Rich
Quote Reply
Re: [Andy] New and/or Updatd links on home.html ?? In reply to
This is great! What if I only want the link title and description to be displayed on my home page?
Quote Reply
Re: [tester2] New and/or Updatd links on home.html ?? In reply to
Hi,

Quote:
This is great! What if I only want the link title and description to be displayed on my home page?

You could just change;

Code:
$return .= Links::SiteHTML::display('link',$link);

...to;

Code:
$return .= Links::SiteHTML::display('link_simple',$link);

..and then make a new template called "link_simple.html", with only the bits you want to show =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] New and/or Updatd links on home.html ?? In reply to
Thanks! Works great!

Smile
Quote Reply
Re: [Andy] New and/or Updatd links on home.html ?? In reply to
Hey Andy, I am not able to make this work with the latest build of Glinks.


Global Name: newguidehome

Global Code
Quote:
sub {
my $return;
my $sth = $DB->table('Links')->select( ['ID'],{ link_type => 'guide' } ) || return $GT::SQL::error;
while (my $id = $sth->fetchrow) { my $link = $DB->table('Links')->get( { ID => $id } );
$return .= Links::SiteHTML::display('link1',$link);
}
return $return;
}

Here is the HTML in the page link1.html
Quote:
<table>

<tr>
<td><%if detailed_url eq 'Yes'%><a href="<%detailed_url%>"><%Title%></a><%endif%></td>
</tr>

<tr>
<td><%Description%></td>
</tr>

</table>


Now it is showing Description the way it should, however it does not show Title at all.. Just displays Description. Now the odd thing is, when I change the global to use link.html page, it works perfectly and shows title and title link... however I can't use link.html layout on home page.

Seems like the tag <%if detailed_url eq 'Yes'%> <%endif%> is not working on link1.html, as if I remove that tag and just insert Title it works, however I want the title to link to its detailed page.

Any idea what I can do to make it work?


Thanks for the help.

Vishal

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] New and/or Updatd links on home.html ?? In reply to
Here is the updated global that I am using,


sub {
my ($output,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ('ORDER BY Add_Date DESC Limit 2');
$sth = $search_db->select ( { link_type => 'guide' });
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link1', $link);
}
return $output;
}

But still same results & no success :(

Vishal

Vishal
-------------------------------------------------------