Andy wrote:
Code:
Top search words: sub {
my ($output,$db,$sth);
my $db = $DB->table('SearchLogs');
$db->select_options ('ORDER BY slog_count DESC', 'LIMIT 5');
$sth = $db->select;
while (my $row = $sth->fetchrow_hashref) {
$output .= qq~* <a href="$CFG->{db_cgi_url}/search.cgi?query=$row->{slog_query}">$row->{slog_query}</a>
~;
}
$output ? return $output : return 'No terms yet!';
}
I' ve changed this code to:
Code:
sub { my ($output,$db,$sth);
my $db = $DB->table('SearchLog');
$db->select_options ('ORDER BY HitCount DESC', 'LIMIT 10');
$sth = $db->select;
while (my $row = $sth->fetchrow_hashref) {
$output .= qq~* <a href="$CFG->{db_cgi_url}/search.cgi?query=$row->{Term}">$row->{Term}</a><br>~;
}
$output ? return $output : return 'No terms yet!';
}