WordPress.org

Ready to get started?Download WordPress

Forums

Photoswipe for NextGEN Gallery
bug with disable fancybox option and better mobile detection (12 posts)

  1. Tribalpixel
    Member
    Posted 1 year ago #

    hello,

    nice plugin tanks!
    there is a little bug with the option -> disable fancybox
    the checkbox does not work: dont stay checked when you come back in the option page, and every time you load the page option -> option is reset to false.
    solution:
    in ngg-photoswipe.php, put the update_option in the if ($_REQUEST['nggphotoswipe_enabled']) on line 73

    if ($_REQUEST['nggphotoswipe_enabled']) {
      update_option('nggphotoswipe_enabled',$_REQUEST['nggphotoswipe_enabled']		;
      update_option('additional_viewers',$_REQUEST['additional_viewers']);
    }

    and i think you can use the wordpress function wp_is_mobile() for detection, so you dont need to update your code -> $isMobile ;)

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

  2. CrouchingBruin
    Member
    Posted 1 year ago #

    Hi, Tribalpixel. Thanks for the code fix, but the first update_option seems to be missing a closing parenthesis just before the semicolon. Second, I made the changes (including setting $isMobile to wp_is_mobile()), but the Disable Fancybox option still doesn't stay checked. Is there something else that needs to be done?

    I've found that Fancybox isn't being disabled. It still comes up in the background, and while you can't see the Fancybox frame, the semi-transparent overlay from Fancybox covers up the PhotoSwipe, and I have to tap on it to clear it before I can reach PhotoSwipe.

  3. zackcello
    Member
    Posted 12 months ago #

    Same problem here! Is the code fixed yet?

  4. tegotha
    Member
    Posted 12 months ago #

    same here!

  5. stealthkinetics
    Member
    Posted 9 months ago #

    +1 (or more for each site I'd like to implement this on)

    I have tried editing/adding more "unbind" attempts to the plug-in code, but cannot get this plug-in to disable fancybox no matter what we try. quite frustrating.

  6. ste9890
    Member
    Posted 8 months ago #

    Seriously is this issue ever going to get some support?

    It's very frustrating.

  7. stealthkinetics
    Member
    Posted 8 months ago #

    To the frustrated masses - I went with a plug-in called WP Jaipho. Little bit different interface and has some css bugs on ipad landscape mode, but it works with NGG and disables fancybox properly out of the box.

  8. wilbur07
    Member
    Posted 8 months ago #

    I corrected the disable fancybox issue. First use tribalpixel's code fix of putting 2nd update_option INSIDE if brackets above it.
    Then, on line 3 of ngg-photoswipe-disable-fancybox.js in the js folder in the photoswipe plugin folder, add or replace this line:
    jQuery('a.fancybox').unbind('click.fb').addClass('nolightbox').removeClass('fancybox');

    with:

    jQuery('a.ngg-fancybox').unbind('click.fb').addClass('nolightbox').removeClass('ngg-fancybox');

    because nextgen uses ngg-fancybox as a triggering class not the normal fancybox class.

  9. stealthkinetics
    Member
    Posted 7 months ago #

    I've got easy fancybox installed too and it does appear to use the normal fancybox class. I can't get it to work no matter what I've tried, the 'disable fancybox' checkbox never stays checked.

    Back to jaipho for now

  10. ashrodan
    Member
    Posted 7 months ago #

    Im seeing an interesting issue. Im using easyfancybox and when checking the tickbox to remove the fancy box class I can see the class being added "nolightbox" but it fails to remove the "fancybox" in the class.

    The no lightbox class does not do anything for me, its the removal of the fancybox that will disable the fancybox. (tested it dev tools)

    I have trippled checked that the "fancybox" class is spelt correctly, im really not sure why it cannot remove the class but can add the "nolightbox" class.

    Ive been testing recommended solutions on this page and on this thread. http://wordpress.org/support/topic/plugin-photoswipe-for-nextgen-gallery-using-fancybox-for-wordpress-plugin-with-photoswipe

    Let me know if you have any ideas...

  11. ashrodan
    Member
    Posted 7 months ago #

    Worked out what my issue was.

    It was apparent that there was 2 places that fancybox class was being added to the thumbnail link.

    Place 1 - in the nextgen gallery where it asked to add the custom code
    place 2 - in the fancy box setting that had images checked as default

    So to fix this either have place 1 or 2 and dont have both.

  12. wilbur07
    Member
    Posted 7 months ago #

    ashrodan i have solved this issue.

    ... on line 3 of ngg-photoswipe-disable-fancybox.js in the js folder in the photoswipe plugin folder, add or replace this line:
    jQuery('a.fancybox').unbind('click.fb').addClass('nolightbox').removeClass('fancybox');

    with:

    jQuery('a.ngg-fancybox').unbind('click.fb').addClass('nolightbox').removeClass('ngg-fancybox');

    because nextgen uses ngg-fancybox as a triggering class not the normal fancybox class.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic