Sorry for getting angry - it's the stress. At the moment,
following your instructions I get this error when trying to search:
Software error:
Execution of /home/xxx/xxx/cgi-bin/search.pl aborted due to compilation errors. I removed my URL for privacy reasons. Anyway here is my sub search with your modifications:
Code:
sub search {
# ---------------------------------------------------
# Performs the actual search.
#
my ($in, $dynamic) = @_;
my ($mh, $bool, $nh, $ww, $order, $query, $ignored, %seen, $next,
$catdb, $cat_hits, $category_results, $cat_count, $cat_errors, $linkdb, $link_hits, $link_results, $link_count, $link_errors);
my %in = %{&cgi_to_hash($in)};
my $links_count = '0';
my $adultfilter = $query;
foreach $adultfilter (@{$LINKS{exclude_keywords}}) {
if ($query =~ /$adultfilter/i) {
&site_html_search_failure ( { error => "We do not have an adult web sites in our directory.", %in, title_linked => $title_linked}, $dynamic) and exit;
}
}
# Get/Set the search options.
($in->param('mh') =~ /^(10|25|50|100)$/) ? ($mh = $1) : ($mh = 10);
($in->param('bool') =~ /^(and|or)$/i) ? ($bool = uc $1) : ($bool = 'AND');
($in->param('nh') =~ /^(\d+)$/) ? ($nh = $1) : ($nh = 1);
($in->param('substring')) ? ($ww = 0) : ($ww = 1);
($in->param('order') =~ /^(score|category)$/i) ? ($order = uc $1) : ($order = 'CATEGORY');
$links_count = $mh * ($nh - 1);
# Split up the search term.
$query = $in->param('query');
$query or &site_html_search_failure ( { error => "No search term entered.", %in }, $dynamic) and return;
$in{'term'} = $in->escape ($query);
# Search the category listings.
$catdb = new Links::DBSQL "$LINKS{admin_root_path}/defs/Category.def";
$cat_hits = $catdb->query ( { query => $query, mh => $mh, nh => $nh } );
$cat_count = $catdb->hits || 0;
$cat_errors = $catdb->query_errors;
What's going wrong! Jeffb