Gossamer Forum
Quote Reply
Global for Search Words

Hi,
I found the following two globals from katabd, but the don't work with the links 3.2.0 search log.
Anyone who did this for 3.2.0?

Code:
Top search words:

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

while (my $row = $sth->fetchrow_hashref) {
$output .= qq~*&nbsp;<a href="$CFG->{db_cgi_url}/search.cgi?query=$row->{Term}">$row->{Term}</a><br>~;
}
return $output > -1 ? join('-', $output): 'No terms yet!';

}



Code:
Last searched words:

sub {
my ($output,$db,$sth);
my $db = $DB->table('SearchLog');
$db->select_options ('ORDER BY TS DESC', 'LIMIT 5');
$sth = $db->select;

while (my $row = $sth->fetchrow_hashref) {
$output .= qq~*&nbsp;<a href="$CFG->{db_cgi_url}/search.cgi?query=$row->{Term}">$row->{Term}</a><br>~;
}
return $output > -1 ? join('-', $output): 'No terms yet!';

}
Thanks Matthias

Matthias
gpaed.de
Subject Author Views Date
Thread Global for Search Words Matthias70 5295 Aug 13, 2007, 12:35 PM
Thread Re: [Matthias70] Global for Search Words
rascal 5174 Aug 13, 2007, 9:25 PM
Thread Re: [rascal] Global for Search Words
Andy 5163 Aug 14, 2007, 1:33 AM
Thread Re: [Andy] Global for Search Words
Matthias70 5163 Aug 14, 2007, 4:38 AM
Thread Re: [Matthias70] Global for Search Words
Andy 5173 Aug 14, 2007, 5:06 AM
Thread Re: [Andy] Global for Search Words
Matthias70 5160 Aug 14, 2007, 7:57 AM
Thread Re: [Matthias70] Global for Search Words
Andy 5160 Aug 14, 2007, 8:20 AM
Post Re: [Andy] Global for Search Words
Matthias70 5145 Aug 14, 2007, 8:46 AM
Thread Re: [Andy] Global for Search Words
katakombe 5122 Aug 22, 2007, 8:50 AM
Thread Re: [katakombe] Global for Search Words
Andy 5122 Aug 22, 2007, 8:52 AM
Post Re: [Andy] Global for Search Words
katakombe 5113 Aug 22, 2007, 8:54 AM