Gossamer Forum
Home : Products : Links 2.0 : Customization :

Add fields to search query?

Quote Reply
Add fields to search query?
Is there anyway to add a field to the search query? For example, have a check box if you want to have one field have to equal "yes". Any ideas?

------------------
Quote Reply
Re: Add fields to search query? In reply to
I think this is what you are looking for

Quote:
In search.cgi after:

@values = &split_decode($line);

Try adding something like:

if ($in{'Language'} and ($in{'Language'} eq $values[$db_language])) {
push (@{$link_results{$values[$db_category]}}, @values);
$numhits++;
next LINE;
}

which basically says if $in{'Language'} is not null, and it matches $values[$db_language] (make sure you've defined $db_language, then add it as a match and move on to the next.

If you want AND matching (i.e. has to match language and search term) then try something like:

if ($in{'Language'}) {
($in{'Language'} eq $values[$db_language]) or next LINE;
}

Hope that helps,

Alex

[This message has been edited by Rock (edited January 09, 1999).]