Gossamer Forum
Home : Products : Links 2.0 : Customization :

widget search...

Quote Reply
widget search...
Well thanks Elliot i added the category to my search, but now (very simple) i would like to add other fileds that are in my links.def

I have a field called Type. I added this code right under the widget code in search.cgi

Code:
if ($in{'Type'} && $in{'Type'} ne "All") {
($values[$db_Type] =~ /^$in{'Type'}/) or next LINE;
}

I also added $db_Type = 3; in link.def under

Code:
# Field Number of some important fields. The number is from %db_def above
# where the first field equals 0.

I basically tried to do the exact same as for the category but i think im missing something. Anyone have any ideas?

Thanks in advanced!
Quote Reply
Re: widget search... In reply to
Uh...Copy ALL the codes, but replace $category with $Type.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.
Quote Reply
Re: widget search... In reply to
Here is the code i put into my search.cgi

Code:
if ($in{'category'} && $in{'category'}ne "All") {
($values[$db_category] =~ /^$in {'category'}/) or next LINE;
}

if ($in{'type'} && $in{'type'} ne "All") {
($values[$db_type] =~ /^$in{'type'}/) or next LINE;
}

Its like its taking the type and not the category anymore.. not working as i planed.

All type is when you add a field you pick what type it is, besides what category its in. So say you are looking in the Computer category and you are looking for a certain type. Any more ideas?



[This message has been edited by websolve (edited April 12, 2000).]
Quote Reply
Re: widget search... In reply to
The problem is that you can NOT use the argument of type since that is reserved for phrase and keyword.

What you need to do is change "type" in the codes you have added to something else like Type with capital T to differentiate from the type used for phrase and keyword.

That's a big problem you have now.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.
Quote Reply
Re: widget search... In reply to
Fixed! Working fine now.. just a quick question since you did it on your site...

I want to search imput (query) to be abel to be empty, in other words people do not have to type anything but instead can select what categroy and what time and it will list what was selected. I was checking out your site and it seems to do it very well.

Thanks yet again.
Quote Reply
Re: widget search... In reply to
Good...glad you got it working.

Quote:
I want to search imput (query) to be abel to be empty, in other words people do not have to type anything but instead can select what categroy and what time and it will list what was selected.

To be honest, I don't remember what I did for this option.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.
Quote Reply
Re: widget search... In reply to
Thsi might refresh your memory a bit because i think im leading to it but i dont really know..

Here is teh code in search.cgi

Code:
# Save the reg expressions to avoid rebuilding.
$or_match = $bool ne 'and';
if ($or_match) {
for (0 .. $#{$search_terms}) {
next if (length ${$search_terms}[$_] < 0); # Skip single letter words.
$tmp .= "m/\Q${$search_terms}[$_]\E/io &#0124; &#0124;";
}
}
else {
for (0 .. $#{$search_terms}) {
next if (length ${$search_terms}[$_] < 0); # Skip single letter words.
$tmp .= "m/\Q${$search_terms}[$_]\E/io &&";
}
}
chop ($tmp); chop ($tmp);

Where it sais:

Code:
< 0); # Skip single letter words.

It used to be:

Code:
< 2); # Skip single letter words.

Now all u have to put in is 1 letter i want them to have to put nothing, just go buy what they select, but they CAN use the search query