Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

modifying search criteria

Quote Reply
modifying search criteria
To all Glinks gurus,

One of the fields in my DB is City. A user can search for a link by a city match but the issue is there are links in rural cities which arnt being found.
I have a field, nearestMajorCity so that a listing in Long Island can put New York City as its nearest city.

What i need to do is modify the Glinks code to do a search for both city and nearestMajorCity.

so instead of a query like this:
Code:
select * from glinks_Links where City = '$city'[/code]
It would acctually process a query like this:

Code:
select * from glinks_Links where (City = '$city' OR nearestMajorCity = '$city')[/code]
Any ideas on which files contain the code that i would need to change?
Is this something that could be done with a plugin? plugin hook? how?

Thanks.
Quote Reply
Re: [hagai] modifying search criteria In reply to
Hi,

To be honest, I'm not really sure.

I just had a look at an example:

search.cgi?bool=or;Title=test;URL=something

..but that gives:

Code:
SELECT * FROM glinks_Links WHERE (ExpiryDate >= 1243667736 AND Title LIKE '%test%' AND URL LIKE '%something%' AND isValidated = 'Yes')

..we need:

Code:
SELECT * FROM glinks_Links WHERE (ExpiryDate >= 1243667736 AND (Title LIKE '%test%' OR URL LIKE '%something%') AND isValidated = 'Yes')

..so in short, I don't think its possible. I even did a bit more digging, and it seems like the "search" is actually done via:

Code:
my $link_sth = $links->query_sth($args);

..which I'm assuming is a GT::SQL object, but I don't really have the time of patience to try and work out what goes on in there =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!