ThinkDing

ThinkDing (http://www.thinkding.com/forum/index.php)
-   Hacks & Modifications (http://www.thinkding.com/forum/forumdisplay.php?f=8)
-   -   Remove characters for total length count (http://www.thinkding.com/forum/showthread.php?t=8)

Winston 08-07-2005 05:51 AM

Remove characters for total length count
 
Say the number of characters to ignore is set to two in the config file. Then a search on "ab" (without quotes and no space) is ignored, but a search on "a b" (without quotes but with a space) is not ignored. That's where this little mod comes into play. It will remove characters you don't want to count before checking total length. If the total length is less than or equal to the number of characters to ignore, no search results are rendered. Otherwise, searches are performed as usual.

In tdSearch.php find:
Code:
if (strlen(trim(stripslashes($query))) <= $chars_to_ign) { $query = ""; }

And replace with:
Code:
// set chars to remove - for ' use \' and for \ use \\ etcetera $what_to_ign = array(' ','"','+','?','-',' and ',' or ',' not ','whatever'); if (strlen(trim(str_replace($what_to_ign,"",stripslashes($query)))) <= $chars_to_ign) { $query = ""; }

SoapinTrucker 08-28-2005 10:31 AM

I just installed this mod, I LOVE it, thanks, it's VERY handy!!!!! :)


All times are GMT. The time now is 11:07 AM.

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.