WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
Suggested change to avoid empty tooltip (3 posts)

  1. lolobu
    Member
    Posted 2 years ago #

    If a picture has no description, you get an empty tooltip when hovering on it in the gallery with IE (always) and Chrome (from time to time). There is no problem with FF and Opera.
    After digging a bit in the code, I came across line 368 of nggfunctions.php (version 1.9.3) :
    $picturelist[$key]->description = ( empty($picture->description) ) ? ' ' : htmlspecialchars ( stripslashes(nggGallery::i18n($picture->description, 'pic_' . $picture->pid . '_description')) );

    If I replace it with I dont' have the problem anymore (just removed the space between the ''):
    $picturelist[$key]->description = ( empty($picture->description) ) ? '' : htmlspecialchars ( stripslashes(nggGallery::i18n($picture->description, 'pic_' . $picture->pid . '_description')) );

    I was wondering if there is any reason (there must be one) for those ' ' in case of empty string. There are many other ones in the code. Otherwise, removing them would allow for those empty tooltip to disappear.

    http://wordpress.org/extend/plugins/nextgen-gallery/

  2. crdunst
    Member
    Posted 1 year ago #

    Thanks for posting this, it helped me at least..

  3. Nattypat Crochet
    Member
    Posted 1 year ago #

    Helped me too! Thanks! I also had to remove the space on line 369 to make it work. ]
    From:
    $picturelist[$key]->alttext = ( empty($picture->alttext) ) ? ' ' : htmlspecialchars ( stripslashes(nggGallery::i18n($picture->alttext, 'pic_' . $picture->pid . '_alttext')) );

    To:
    $picturelist[$key]->alttext = ( empty($picture->alttext) ) ? '' : htmlspecialchars ( stripslashes(nggGallery::i18n($picture->alttext, 'pic_' . $picture->pid . '_alttext')) );

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.