Home : Products : Gossamer Links : Development, Plugins and Globals :

Products: Gossamer Links: Development, Plugins and Globals: Re: [katabd] top 5 search terms global: Edit Log

Here is the list of edits for this post
Re: [katabd] top 5 search terms global
Here is an example that should work:

Code:
sub {
# -----------------------------------------------
# Returns a list of the Top5 Searched terms.

my (@output,$db,$sth);

$db = $DB->table('SearchLog');
$db->select_options ('ORDER BY HitCount DESC', 'LIMIT 5');
$sth = $db->select;

while (my $row = $sth->fetchrow_hashref) {
push @output, qq~<a href="$CFG->{db_cgi_url}/search.cgi?query=$row->{Term}">$row->{Term}</a>~;
}

return $#output > -1 ? join('-', @output) || 'No terms yet!';

}

Btw it looks like you are using Links SQL 1.13?




Last edited by:

RedRum: Dec 30, 2001, 7:57 AM

Edit Log: