WordPress.org

Ready to get started?Download WordPress

Forums

WP Photo Album Plus
[resolved] Strange apostophe Search problem (17 posts)

  1. davidallen23
    Member
    Posted 2 years ago #

    I'm using the WPPA+ Search Photos widget which is behaving oddly.
    If I search for something that has an apostrophe (') in the word such as: WRIGHT'S the search term is changed in the search box to: WRIGHT\'S and nothing is found.
    My site is here

    http://wordpress.org/extend/plugins/wp-photo-album-plus/

  2. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    Thank you for this report. This will be fixed in the next version.

  3. davidallen23
    Member
    Posted 2 years ago #

    Thanks. The latest has update has fixed the \ problem.
    However, if I search for WRIGHT'S or some other search term that includes an apostrophe (') nothing is found even though the term is in a photo description.

  4. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    By me it works, go to http://wppa.opajaap.nl and search for saldo-'corrector' and you will fine one picture.

  5. davidallen23
    Member
    Posted 2 years ago #

    So if it works for you what could be my problem.
    I just added saldo-'corrector to a photo description and then searched - nothing found.
    I tried adding "123" and nothing found.
    It it something to do with ASCII coding?

  6. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    WP is set to utf-8? and wppa+ also? (Table VIII-2).

  7. davidallen23
    Member
    Posted 2 years ago #

    Table VIII-2 allows me to: Set to utf-8 Set Character set to UTF_8.
    So is wppa+ set to utf-8 or not?
    However, it seems very unlikely to me that this is the problem area when using a standard UK PC/OS set up.
    However, I can't imagine what could cause the problem.
    Can you point in any direction in order to solve it?

  8. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    Table VIII-2 is not a setting, but an action to be performed. It sets the necessary databasefields to utf-8. It does no harm to do this a second time.

    A suggestion:

    Use the autosave version of the album admin page (if not set already, check Table IX-18 first). Then go to the photo and change the description (add a space or so) and click outside the edit window. This should update the field. Then try again.

  9. davidallen23
    Member
    Posted 2 years ago #

    Thanks opajaap.
    As usual you've worked your magic.
    I tried your suggestion and it now works fine.

  10. davidallen23
    Member
    Posted 2 years ago #

    Well, it only works if I go through all albums and do the same thing to every photo that contains an apostrophe in the description. Did the 'Save all changes' button stop working?

  11. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    The autosave works with ajax, this means the data goes through javascript. This is slightly different from regular $_POST.
    This means that escape characters act a little different.

    I will have a quick look into the code if i can find a possible solution to this...

  12. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    Try this:

    wppa-functions.php at line 1908:

    function wppa_deep_stristr($string, $tokens) {
    global $wppa_stree;
    	// Explode tokens into search tree

    change to:

    function wppa_deep_stristr($string, $tokens) {
    global $wppa_stree;
    	$string = stripslashes($string);
    	$tokens = stripslashes($tokens);
    	// Explode tokens into search tree

    If it works, it is usefull to try either one line apart, it may be that only one of them is required, but i cannot guess which.

  13. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    Forget about editing, update to 4.4.1 Its not documented (as i do not know if it works) but the mod is in, and it still works on my site.

  14. Randy Bass
    Member
    Posted 2 years ago #

    I am missing something. I see the widget title "Search Photos" However there is no text box to enter search keys.

    http://georgerandybass.com/c-o-canal/canal-photos?wppa-album=2&wppa-photo=21&wppa-occur=1

    Got to be something simple!

  15. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    Did you activate a Search Photos widget (subtitle: WPPA+ Search Photos)?

  16. Randy Bass
    Member
    Posted 2 years ago #

    Yes. The title "Search Photos" is at the top of the widget area. Is there more to activation?

    Thanks for the prompt response! Really like the plugin! Made donation this morning!

  17. Randy Bass
    Member
    Posted 2 years ago #

    My mistake. I activated WPPA Text.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic