Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Re: top 5 search terms

Quote Reply
Re: top 5 search terms In reply to
I am running in a problem:
My sub yop5 looks like

sub Top5 {
# -----------------------------------------------
# Returns a list of the Top5 Searched terms.
#
my $in = new CGI;
my $Search = new Links::DBSQL $LINKS{admin_root_path} . "/defs/Search_Log.def";
# Let's get a list of the Top 7 terms ordered by number of times someone
# has Searched on them.
my $results = $Search->query ( { Term => '*', sb => 'Count', so => 'DESC', mh => 7 } );
my $results = $search->prepare (" SELECT * FROM Search_Log_Daily Where Term NOT RLIKE 'sex' AND Term NOT LIKE '%http%' ORDER BY Count DESC LIMIT 11 ");
my $output = '';
my $term_q;
if ($Search->hits) {
foreach my $term (@{$results}) {
$term = $Search->array_to_hash($term);
$term_q = $in->escape($term->{Term});
$output .= qq~ <a href="$LINKS{db_cgi_url}/search.cgi?query=$term_q">${$term}{Term}</a> -
~;
}
}
else {
$output = "Sorry no one has Searched for anything yet.";
}
return $output;
}

I think that is correct but when I call and page that uses the tag <%top5%> I get an error message software error
error in HTML_Templates.pm.

please take a look at the "sub" and advise.
regards

Subject Author Views Date
Thread top 5 search terms pugdog 6331 Apr 14, 2000, 10:15 AM
Post Re: top 5 search terms
pugdog 6271 Apr 14, 2000, 11:33 PM
Post Re: top 5 search terms
Elijanio 6254 Apr 15, 2000, 3:34 PM
Post Re: top 5 search terms
pugdog 6239 Apr 15, 2000, 4:39 PM
Post Re: top 5 search terms
Elijanio 6262 Apr 15, 2000, 5:07 PM
Post Re: top 5 search terms
pugdog 6260 Apr 15, 2000, 5:42 PM
Post Re: top 5 search terms
Elijanio 6280 Apr 15, 2000, 5:51 PM
Post Re: top 5 search terms
pugdog 6252 Apr 15, 2000, 7:54 PM
Post Re: top 5 search terms
Elijanio 6288 Apr 16, 2000, 6:26 AM
Thread Re: top 5 search terms
pugdog 6266 Apr 16, 2000, 7:03 AM
Thread Re: top 5 search terms
Christa 6250 Nov 9, 2000, 12:46 PM
Thread Re: top 5 search terms
pugdog 6219 Nov 9, 2000, 1:30 PM
Thread Re: top 5 search terms
Christa 6214 Nov 9, 2000, 1:52 PM
Thread Re: top 5 search terms
pugdog 6247 Nov 9, 2000, 3:12 PM
Thread Re: top 5 search terms
Christa 6252 Nov 9, 2000, 3:24 PM
Thread Re: top 5 search terms
pugdog 6250 Nov 9, 2000, 6:06 PM
Thread Re: top 5 search terms
Christa 6229 Nov 9, 2000, 7:27 PM
Thread Re: top 5 search terms
pugdog 6200 Nov 9, 2000, 7:31 PM
Thread Re: top 5 search terms
OneDanShow 6232 Nov 9, 2000, 10:27 PM
Thread Re: top 5 search terms
pugdog 6211 Nov 9, 2000, 11:01 PM
Post Re: top 5 search terms
pirl 6179 Nov 10, 2000, 3:27 AM