coppermine-gallery.com/forum

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: essaytee on January 14, 2011, 06:13:17 AM

Title: Searching problem - characters being returned.
Post by: essaytee on January 14, 2011, 06:13:17 AM
I've installed Coppermine 1.5.   Testing the search feature, I enter a single character, "1", searching against the default set (title, keywords etc.).   The problem is that where "1" is in the keyword ie "2010" it's being returned as a result, which shouldn't be the case.

I tag many photos with the bib number of runners & cyclists.   Sometimes bib numbers are single digits as opposed to three or more digits.

Any clues or suggestions please.

Title: Re: Searching problem - characters being returned.
Post by: Αndré on January 18, 2011, 02:30:48 PM
Untested: open include/search.inc.php, find
if (in_array($param, $allowed)) $fields[] = "$param LIKE '%$word%'";
and replace with
if (in_array($param, $allowed)) $fields[] = "$param = '$word'";

Maybe you have to replace
if (in_array($param, $allowed)) $fields[] = "$param LIKE '%$string%'";
with
if (in_array($param, $allowed)) $fields[] = "$param = '$string'";
additionally.
Title: Re: Searching problem - characters being returned.
Post by: essaytee on January 23, 2011, 12:51:53 PM
Thanks, I'll give that a try.