Gossamer Forum
Home : Products : Links 2.0 : Customization :

Select Fields Search / Hotscripts-type Search - Reward $ For Answer.

Quote Reply
Select Fields Search / Hotscripts-type Search - Reward $ For Answer.
Okay. I've read the forums, searched like crazy but haven't found the thing I need - However, I'm willing to pay $10 to anyone that can get this working for me.

Step One - I require a search system like http://www.hotscripts.com - where you can choose All Categogries or choose from the drop down list to select a different category to search under.


Step Two - I have added 10 new fields. For example, I am doing a site selling homes.

I have new fields added to my links.def (values as Yes or No) such as:

TwinBath

Jacuzzi

Patio

DoubleGarage

etc


On the advanced search page I want the ability to have step one PLUS the ability for people to "tick" one of those new fields to add into the search too.

Eg: Search for all homes with Patio's in London. Or Search for all homes with DoubleGarage, Jacuzzi in All Categories..


If anyone can give me step-by-step help on how to do this, I will not only be very greatful but move $10 over to you via paypal ;)

Thank you!!!
Quote Reply
Re: [boom] Select Fields Search / Hotscripts-type Search - Reward $ For Answer. In reply to
actually, this would do what you want...

http://www.gossamer-threads.com/...?post=232859;#232859

but I think there is one error in it. I'll have to work on it and get it fixed.

Of you and find the problem and post the solution.

I'm just real busy right now.

It works for me except for one problem.


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] Select Fields Search / Hotscripts-type Search - Reward $ For Answer. In reply to
But there is no option on there for the Hotscripts type of search on every page (as explained in 1st post) or when you come to search using the advanced form there isn't a way to pick ALL the categories from the dropdown box... It's nice though...thanks for the suggestion.

$10 waiting for a solution! Wink
Quote Reply
Re: [boom] Select Fields Search / Hotscripts-type Search - Reward $ For Answer. In reply to
well, hotscripts.com uses sql and thus, the search process is different.

You don't select ALL the categories to search when using a dropdown list. Rather, you don't select ANY category from the select list; when you don't select any category, it will automatically search all the categories. hotscripts.com just spells out the ALL option in their dropdown list. But if you look behind the scenes, they probably just omit the WHERE clause from the query so that all the categories are searched.

as for every page, just put the search box on each page that you want it to appear.

Here is a hack from someone else that allows you to search a specific category.

Code:
in search.cgi find the following:
--------------------------------------------------------------------
# If we have a hit, add it in!
if (($or_match && $match) or $andmatch) {
push (@{$link_results{$values[$db_category]}}, @values);
$numhits++; # We have a match!
}

--------------------------------------------------------------------
and replace it with this:

##########################################################################################

# <-------- Start subcategories search - Jose Reffoios - jreffoios@hotmail.com --------> #

##########################################################################################

# Split Categories and sub Categories into two different variables
($subcat1,$subcat2) = split(/\//, $values[$db_category]);
# do the same for the form's hidden value (category or subcateg name)
($subcat3,$subcat4) = split(/\//, $in{'thiscat'});
# check what type of category is and define what the search criteria will be
if ($subcat4) {$subcat1 = $values[$db_category];} if ($in{'thiscat'})
{
if ($subcat1 eq $in{'thiscat'})
{
# If we have a hit, add it in!
if (($or_match && $match) or $andmatch) {
push (@{$link_results{$values[$db_category]}}, @values);
$numhits++; # We have a match!
}
}
} else
{
# If we have a hit, add it in!
if (($or_match && $match) or $andmatch) {
push (@{$link_results{$values[$db_category]}}, @values);
$numhits++; # We have a match!
}
}

##########################################################################################

# <--------- End subcategories search - Jose Reffoios - jreffoios@hotmail.com ---------> #

##########################################################################################




Now you just need to add, where ever you use the search
form the following (should be the "category.html" template):
--------------------------------------------------------------------

<input type="checkbox" name="thiscat" value="<%category_name%>">
<font face="verdana" size="2">Search this Category</font>
--------------------------------------------------------------------
Ok, done Happy and quick! :-)I consider this Add-On a must have, hoppe it works for you to.
For any further question email me at jreffoios@hotmail.com.


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [boom] Select Fields Search / Hotscripts-type Search - Reward $ For Answer. In reply to
as for your advanced search, I adapted the admin search page to do what you suggest.


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."