Gossamer Forum
Home : Products : Links 2.0 : Customization :

AltaVista.cgi question for V2.0 !!

Quote Reply
AltaVista.cgi question for V2.0 !!
Ok, I ran altavista.cgi successfully with Links 1.11, however, I can not seem to get it to work with V2.0.

Here is what I had in version 1.11:

sub site_html_search_failure {
# --------------------------------------------------------
# This routine displays a failed search page with error in $error.
#
my ($error) = $_[0];
print "Location: http://www.my-domain.com/cgi-local/altavista.cgi?query=$term\n\n";
}

Now.. what is needed for V2.0?

Any help is GREATLY appreciated! Thanks...

-Joe
Quote Reply
Re: AltaVista.cgi question for V2.0 !! In reply to
Check to see if in search.cgi in v2.0 reads this:

Code:
# Set search type -- either phrase or keyword. Also build keyword list to search on.
my @search_terms = ();
($in{'type'} eq 'phrase') ?
(@search_terms = ($in{'query'})) :
(@search_terms = split (/\s/, $in{'query'}));

# Set boolean connector and next hits page.
my $bool = $in{'bool'} | | 'and';
my $nh = $in{'nh'} | | 1;

# Stores the query in $term seperated by a +
$term = $in{'query'};
$term =~ tr/ /+/;

# Store the search results here.
local (%link_results, @category_results);

# Do the actual search.
my $status = &search (\@search_terms, $bool);

Just this part is the one that I think is the only main difference:

Code:
# Stores the query in $term seperated by a +
$term = $in{'query'};
$term =~ tr/ /+/;

Hope that works,
elms

------------------

http://www.webmerch.com