From the forum:
sub {
# Displays the 10 most popular links per category.
my ($output,$sth,$link);
my $id = shift;
my $db = $DB->table ('Links','CatLinks');
$db->select_options ('ORDER BY Hits DESC', 'LIMIT 10');
my $sth = $db->select ( { 'CatLinks.CategoryID' => $id}, { isValidated => 'Yes'} );
my $premium;
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link2', $link);
}
return $output;
}
Called via:
<%popular_cat ($ID)%>
Regards
minesite
sub {
# Displays the 10 most popular links per category.
my ($output,$sth,$link);
my $id = shift;
my $db = $DB->table ('Links','CatLinks');
$db->select_options ('ORDER BY Hits DESC', 'LIMIT 10');
my $sth = $db->select ( { 'CatLinks.CategoryID' => $id}, { isValidated => 'Yes'} );
my $premium;
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link2', $link);
}
return $output;
}
Called via:
<%popular_cat ($ID)%>
Regards
minesite