I followed Glenn's instructions exactly, however, when I visit my search page it comes back with an 500 server error. All permissions have been applied correctly and uploaded in ASCI mode, has anyone had success with installing this mod?
============================================
http://cgi-resource.co.uk/pages/ssearch.shtml Open search.cgi
At the bottom of the first sub just above:
# Print out the HTML results.
&site_html_search_results;
Add:
$ccount=0;
open (DB, "<similarsearch.db") or &cgierr("error in search. unable to open database: $db_file_name. Reason: $!");
flock (DB, 1) if ($db_use_flock);
LINE: while (<DB>) {
/^#/ and next LINE; # Skip comment Lines.
/^\s*$/ and next LINE; # Skip blank lines.
chomp; # Remove trailing new line.
@values = &split_decode($_);
foreach $term (@search_terms) {
$_ = $values[2];
if ((m/$term/i) and ($ccount < 5)){
$ssearch_results .= qq|Now search for: <a href = "search.cgi?query=$values[1]">$values[1]</a><br>\n|;
$ccount++;
}
}
}
close DB;
Where similarsearch.db is the path to your db file
$ccount < 5 is the max number of similar terms you want displayed
Then go into site_html_templates.pl and add the following in the search results sub:
ssearch_results => $ssearch_results,
Then in search_results.html add:
<%ssearch_results%>
Then make the similarsearch.db:
Here's an example of what to use:
The first fields if the id number, the second the similar search term and the third is an array of words you want to pick up the search term.
1|pop| music rock indie
So for instance above if you search using a word such as music, rock or indie in your search 'now search for pop music' will be displayed.
http://cgi-resource.co.uk/pages/ssearch.shtml
Pickle Network Network of websites both salty and dill.