Now i have 1 problem with keyword banner search program,
at Links 2.0 , I can run keyword banner search ,
but at linksql i can not run it .
At links 2.0 , I can run it i change the script as below :--
File: site_html.pl
************************************************************************************
sub site_html_search_results {
# --------------------------------------------------------
# This routine displays the search results.
#
my $term = &urlencode ($in{'query'});
&html_print_headers;
print &load_template ('search_results.html', {
term => $term,
link_results => $link_results,
category_results => $category_results,
next => $next,
cat_hits => $cat_hits,
link_hits => $link_hits,
%in,
%globals
});
}
************************************************************************************
************************************************************************************
change To
************************************************************************************
************************************************************************************
sub site_html_search_results {
# --------------------------------------------------------
# This routine displays the search results.
#
my $term = &urlencode ($in{'query'});
&html_print_headers;
@keyword1 = ('email','www','web');
@keyword2 = ('pc','game','sofeware');
$sr = "search_results.html";
foreach $keywords1 (@keyword1) {
if ( $term =~ /$keywords1/i) {
$sr = "search_results1.html";
}
}
foreach $keywords2 (@keyword2) {
if ( $term =~ /$keywords2/i) {
$sr = "search_results2.html";
}
}
print &load_template ($sr, {
term => $term,
link_results => $link_results,
category_results => $category_results,
next => $next,
cat_hits => $cat_hits,
link_hits => $link_hits,
%in,
%globals
});
}
************************************************************************************
So at links 2.0
search keyword is "email" , then run search_results1.html templates,
search keyword is "pc" , then run search_results2.html templates,
####################################################################################
####################################################################################
But Now at search linksSQL , I cannot run it,
At linksql i changer from
File: HTML_Templates.pl
************************************************************************************
sub site_html_search_results {
# --------------------------------------------------------
# This routine displays the search results.
#
my ($tags, $dynamic) = @_;
my $template = defined $dynamic ? $dynamic->param('t') : undef;
(ref $tags eq 'HASH') or croak "HTML_TEMPLATES: Argument '$tags' must be hash reference";
defined $dynamic and &load_user ($dynamic, $tags);
my $output = &load_template ('search_results.html', {
%$tags,
%GLOBALS
}, undef, $template);
defined $dynamic and &clean_output($dynamic, \$output);
print $output;
}
*****************************************************************************************
************************************************************************************
change to
************************************************************************************
****************************************************************************************
sub site_html_search_results {
# --------------------------------------------------------
# This routine displays the search results.
#
my ($tags, $dynamic) = @_;
my $template = defined $dynamic ? $dynamic->param('t') : undef;
(ref $tags eq 'HASH') or croak "HTML_TEMPLATES: Argument '$tags' must be hash reference";
defined $dynamic and &load_user ($dynamic, $tags);
@keyword1 = ('email','www','web');
@keyword2 = ('pc','game','sofeware');
$sr = "search_results.html";
foreach $keywords1 (@keyword1) {
if ( $tags =~ /$keywords1/i) {
$sr = "search_results_bc.html";
}
}
foreach $keywords2 (@keyword2) {
if ( $tags =~ /$keywords2/i) {
$sr = "search_results_bc.html";
}
}
my $output = &load_template ($sr, {
%$tags,
%GLOBALS
}, undef, $template);
defined $dynamic and &clean_output($dynamic, \$output);
print $output;
}
****************************************************************************************
But i can not run it ,
I think the error is at
****************************************************
if ( $tags =~ /$keywords1/i) {
****************************************************
the $tags must change to ????
Do u have any idea , Please help me .
Thanks.