View Single Post
Old 08-07-2005, 05:51 AM
Winston Winston is offline
Join Date: Jul 2005
Posts: 46
Default 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:
if (strlen(trim(stripslashes($query))) <= $chars_to_ign) { $query = ""; }

And replace with:
// 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 = ""; }
Reply With Quote