I'm using ZP 1.2.1 on a site for a printer. I'm creating dynamic albums to show the available fonts for printing. This works great except for font albums titled "serif" and "sans serif". If a user types in "serif" they get both serif and sans serif fonts.
In looking for ways to make ZP to search for exact matches of tags, I found on the Changelog page for this version a listing for "The return of 'partial match search of tags' ", but no information about what this means.
How do I get an exact match? Is it possible?
Comments
There is a sql statement generated in class-search.php in the tagserach function right at the front of the function. Currently it uses `LIKE %%` change it to `=`
@albeezie. Since tags are naturally one word keywords I think quotes may be quite unusual...
Is this the line I need to edit? I've tried several ways of changing LIKE to = and none work.
A little more help please and thank you.
I was not trying to be "right" but I do have multiple word tags in my photos, which is why I was one of those people who wanted the partial search match. I didn't see the point in exact match tag, but kenholmes has shed light on that for me.
What sbillard offered earlier: "There is a sql statement generated in class-search.php in the tagserach function right at the front of the function. Currently it uses `LIKE %% change it to ="` doesn't seem to apply to the code I am looking at. That
I do find: `$sql .= 'name' LIKE "%'.$singlesearchstring.'%" OR ';`
But making similar changes to this line breaks the search.
As I stated before, I am fairly new to PHP (but I ain't stupid), so please lend a hand... Please? I need to create dynamic albums for fonts. Tags include "Serif" and "Sans Serif". Because exact search don't work, sans serif items come up when searching for "serif".
SBillard gave a solution to the problem - see thread above - but the code given doesn't exist anywhere in the install. So... anyone? Or do I switch to Gallery? Or should I just live with the problem and resolve myself that you get what you pay for with free open source software?
`$sql .= 'name' LIKE "%'.$singlesearchstring.'%" OR ';`
(in the svn: `$sql .= '`name`LIKE "%'.mysql_real_escape_string($singlesearchstring).'%" OR ';`)
should work if changed to
`$sql .= 'name' = "'.$singlesearchstring.'" OR ';`
Thanks!