PDA

View Full Version : Remove characters for total length count


Winston
08-07-2005, 04:51 AM
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 = "";
}

SoapinTrucker
08-28-2005, 09:31 AM
I just installed this mod, I LOVE it, thanks, it's VERY handy!!!!! :)