Gossamer Forum
Home : Products : Gossamer Links : Discussions :

How to show the lastlink in each main category?

Quote Reply
How to show the lastlink in each main category?
Hello, another doubt: How to show the last links added in each main category like hotscripts?
For example: in http://www.hotscripts.com/Perl/ display the last additions in this category. How to make this?

Thank you very much.





Quote Reply
Re: How to show the lastlink in each main category? In reply to
try it

sub {
my ($rec) = @_;
my $id = $rec->{ID};
my $db = $DB->table ('Links','CatLinks');
$db->select_options ('ORDER BY ID DESC', 'LIMIT 5');
my $sth = $db->select ( { 'CatLinks.CategoryID' => $id}, ['Links.ID', 'Links.Title', , 'Links.URL'], { isValidated => 'Yes'} );

my $toplink;
while (my ($id,$name,$url) = $sth->fetchrow_array) {

$toplink .= "<li><a href='$url'>$name</a>

";
}
return $toplink;
}



Thanks in Advance
Bye From Italy
Fabio
Quote Reply
Re: How to show the lastlink in each main category? In reply to
Thank you very much fabio for you reply.
This global works fine but display the new links in all categories and subcategories. Is possible to limit this mod for only the main categories? (ROOT/Category)
I suposse using headers & footers with this <%toplink%> tag only in the main categories. Is correct?

Thank you very much fabio.