How would one go about setting up a search so that if Zero results are found using "AND", to search again using an "OR" search. I am using Glinks 3.2.0. Any help is appreciated.
Jul 12, 2008, 11:27 AM
Veteran / Moderator (18436 posts)
Jul 12, 2008, 11:27 AM
Post #2 of 4
Views: 2416
Hi,
Mmm.. thats pretty hard. It would require a plugin, to hook into the search hook, and then see if no results were found (and a "query" was defined) ... and then if not pass in an OR condition.
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!
Mmm.. thats pretty hard. It would require a plugin, to hook into the search hook, and then see if no results were found (and a "query" was defined) ... and then if not pass in an OR condition.
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!
Jul 12, 2008, 7:06 PM
Enthusiast (809 posts)
Jul 12, 2008, 7:06 PM
Post #3 of 4
Views: 2429
Hi,
I am not sure if this is ok for you but it works for this case. Please just add the below code into your search.html template
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="refresh" content="0; url=<%db_cgi_url%>/search.cgi?query=<%term%>;bool=or;substring=<%if substing%><%substing%><%endif%><%if mh%>;mh=<%mh%><%endif%>">
</head>
<body>
<p>Trying to search again!</p>
</body>
</html>
<%else%>
.... current search .template
<%endif%>
Cheers,
Dat
Programming and creating plugins and templates
Blog
I am not sure if this is ok for you but it works for this case. Please just add the below code into your search.html template
Code:
<%if term and bool eq 'and'%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="refresh" content="0; url=<%db_cgi_url%>/search.cgi?query=<%term%>;bool=or;substring=<%if substing%><%substing%><%endif%><%if mh%>;mh=<%mh%><%endif%>">
</head>
<body>
<p>Trying to search again!</p>
</body>
</html>
<%else%>
.... current search .template
<%endif%>
Cheers,
Dat
Programming and creating plugins and templates
Blog
Jul 13, 2008, 12:06 AM
Veteran / Moderator (18436 posts)
Jul 13, 2008, 12:06 AM
Post #4 of 4
Views: 2396
Good idea - why didn't I think of that
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!

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!