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
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