View Full Version : Wildcard (*) in every searches
warpeditor
01-05-2003, 07:26 AM
Hi, all
Since my forum is for Thai people we have to use wildcard (*) for better search result because we are using two byte fonts. However, most of the members always forget to include wildcard (*) and end up complaints for poor search result.
So, I was wondering whether it's possible to modify some files to including wildcard (*) for every searches. Any ideas?
Thanks in advance.
Logician
01-06-2003, 08:08 AM
edit search.php, find:
$query=trim($query);
after that add:
if (substr($query, 0, 1)!="*") {$query='*'.$query;}
if (substr($query, -1)!="*") {$query=$query.'*';}
warpeditor
01-06-2003, 12:31 PM
Thanks for reply.
I'll give it a try tonight.
Thanks again.
SamirDarji
04-08-2004, 08:14 PM
Do you think this piece of code would allow for wildcard searches unless quotes are used? I haven't tried it and have never done any php programming, just some C. Feedback welcome before I starting hacking away... :D
if ((substr($query, 0, 1)!="*" && substr($query, 0, 1)!="\""))
{
$query='*'.$query;
}
if ((substr($query, -1)!="*" && (substr($query, -1)!="\""))
{
$query=$query.'*';
}
SamirDarji
04-12-2004, 03:13 PM
I tried the original suggestion on vb3, beta7 but couldn't find the same query line. I found one similar that looked like it was checking if there were any html codes in the query. I put the lines after that one, but still no results. :confused:
We really badly need auto wildcarding on our board. Any suggestions would be greatly appreciated.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.