Hi
I have installed succesfully the global that displays the 5 most popular links for each main category
sub {
my $id = shift;
my $db = $DB->table ('Links','CatLinks');
$db->select_options ('ORDER BY hits DESC', 'LIMIT 5');
my $sth = $db->select ( { 'CatLinks.CategoryID' => $id}, ['Links.ID', 'Links.Title', , 'Links.URL'], { isValidated => 'Yes'} ); my $popularcategory; while (my ($id,$name,$url) = $sth->fetchrow_array) { $popularcategory .= "<a href='$url'>$name</a><br>";
}
return $popularcategory;
}
and putting <%popular (ID)%> in my category template
but how to display those popular in a detailed page???
Thanks
FMP
I have installed succesfully the global that displays the 5 most popular links for each main category
sub {
my $id = shift;
my $db = $DB->table ('Links','CatLinks');
$db->select_options ('ORDER BY hits DESC', 'LIMIT 5');
my $sth = $db->select ( { 'CatLinks.CategoryID' => $id}, ['Links.ID', 'Links.Title', , 'Links.URL'], { isValidated => 'Yes'} ); my $popularcategory; while (my ($id,$name,$url) = $sth->fetchrow_array) { $popularcategory .= "<a href='$url'>$name</a><br>";
}
return $popularcategory;
}
and putting <%popular (ID)%> in my category template
but how to display those popular in a detailed page???
Thanks
FMP