WordPress.org

Support

Support » Plugins and Hacks » [Plugin: NextGEN Gallery] Problem with pagination with 2 or more galleries

[Plugin: NextGEN Gallery] Problem with pagination with 2 or more galleries

  • Hello,

    I am using NGG version 1.7.4.
    I have problems with pagination if I have more then 1 gallery on a site.
    In options I set to display 2 thumbnails at the same time for a gallery with 10 pics so I have 5 pagination steps.

    I did this with 2 different galleries and included them on the same site so I have 2 Thumbs a little text and again 2 different 2 thumbs.
    If I hit pagination for gallery 1 on the site, it also paginates for gallery 2 vice versa.
    Is this behavior right?

    Can I solve this problem by using colorbox and nextgen with ajax pagination?

    Any suggestion is welcome.

    Regards Armin

Viewing 5 replies - 1 through 5 (of 5 total)
  • I have this problem too. Multiple galleries should have independent pagination. Now they move all at the same time, and this really defeats the purpose of having more than one gallery on one page. Is there a solution to this?

    Cheers!

    Hey,

    I have solved not the problem but I have the ajax pagination now working with colorbox.
    Works absolutly smooth and is much better then the normal pagination so try to get ajax pagination working.

    I can help someone who wants to get colorbox and ngg together via ajax pagination.

    So long

    Hi,

    Can you please explain how you got Ajax working with Colorbox? Or nextgen gallery?

    Got 2-3 galleries per page and clicking page number links causes all sorts of issues.

    Thanks!

    Hi s0lnishk0,

    yeah, I got it again working, still after update, but every time I update, I have to replace 2 files of ngg 😉

    These 2 files are:
    – ngg.js ( to initialize colorbox again)
    – nggallery.php (enable ajax call for custom effect – I use rel=”fade)

    See my following post for the changes I made.

    file ngg.js
    from( Idon’t now if really needed, try it by yourself)

    // try to find gallery number by checking the parents ID until we find a matching one
    	var currentNode = obj.parentNode;

    to

    // try to find gallery number by checking the parents ID until we find a matching one
    	var currentNode = obj;

    from(needed! to reinit colorbox)

    // add shutter-listeners again
    				shutterReloaded.init('sh');

    to(adjust colorbox settings plz)

    // add shutter-listeners again
    				//shutterReloaded.init('sh');
    				jQuery("a[rel='elastic']").colorbox();
    				jQuery("a[rel='gallery']").colorbox();
    				jQuery("a[rel='lightbox']").colorbox();
    				jQuery("a[rel='fade']").colorbox({transition:"fade"});
    				jQuery("a[rel='clear']").colorbox({transition:"none", width:"75%", height:"75%"});
    				jQuery("a[rel='slideshow']").colorbox({slideshow:true});
    				jQuery(".ajaxi").colorbox();
    				jQuery(".video").colorbox({iframe:true, innerWidth:425, innerHeight:344});
    				jQuery(".iframe").colorbox({width:"80%", height:"80%", iframe:true});
    				jQuery(".inline").colorbox({width:"50%", inline:true, href:"#inline_example1"});
    				jQuery("#click").click(function(){
    				jQuery('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
    				return false;
    				});

    file nggallery.php
    from

    // activate modified Shutter reloaded if not use the Shutter plugin
    		if ( ($this->options['thumbEffect'] == "shutter") && !function_exists('srel_makeshutter') ) {
    			wp_register_script('shutter', NGGALLERY_URLPATH .'shutter/shutter-reloaded.js', false ,'1.3.2');
    			wp_localize_script('shutter', 'shutterSettings', array(
    						'msgLoading' => __('L O A D I N G', 'nggallery'),
    						'msgClose' => __('Click to Close', 'nggallery'),
    						'imageCount' => '1'
    			) );
    			wp_enqueue_script( 'shutter' );
    	    }
    
    		// required for the slideshow
    		if ( NGGALLERY_IREXIST == true && $this->options['enableIR'] == '1' && nggGallery::detect_mobile_phone() === false )
    			wp_enqueue_script('swfobject', NGGALLERY_URLPATH .'admin/js/swfobject.js', FALSE, '2.2');
            else {
                wp_register_script('jquery-cycle', NGGALLERY_URLPATH .'js/jquery.cycle.all.min.js', array('jquery'), '2.88');
                wp_enqueue_script('ngg-slideshow', NGGALLERY_URLPATH .'js/ngg.slideshow.min.js', array('jquery-cycle'), '1.05'); 
    
            }   
    
    		// Load AJAX navigation script, works only with shutter script as we need to add the listener
    		if ( $this->options['galAjaxNav'] ) {
    			if ( ($this->options['thumbEffect'] == "shutter") || function_exists('srel_makeshutter') ) {
    				wp_enqueue_script ( 'ngg_script', NGGALLERY_URLPATH . 'js/ngg.js', array('jquery'), '2.1');
    				wp_localize_script( 'ngg_script', 'ngg_ajax', array('path'		=> NGGALLERY_URLPATH,
                                                                        'callback'  => home_url() . '/' . 'index.php?callback=ngg-ajax',
    																	'loading'	=> __('loading', 'nggallery'),
    				) );
    			}
    		}
    
    	}

    to (adjust this line!!!! wp_register_script(‘colorbox’, NGGALLERY_URLPATH .’../../themes/denizy/js/colorbox/jquery.colorbox.js’, false ,’1.3.0′);)

    // activate modified Shutter reloaded if not use the Shutter plugin
    		if ( ($this->options['thumbEffect'] == "custom") && !function_exists('colorbox') ) {
    			wp_register_script('colorbox', NGGALLERY_URLPATH .'../../themes/denizy/js/colorbox/jquery.colorbox.js', false ,'1.3.0');
    			wp_localize_script('colorbox', 'colorboxsettings', array(
    						'msgLoading' => __('L O A D I N G', 'nggallery'),
    						'msgClose' => __('Click to Close', 'nggallery'),
    						'imageCount' => '1'
    			) );
    			wp_enqueue_script( 'colorbox' );
    	    }
    
    		// required for the slideshow
    		if ( NGGALLERY_IREXIST == true && $this->options['enableIR'] == '1' && nggGallery::detect_mobile_phone() === false )
    			wp_enqueue_script('swfobject', NGGALLERY_URLPATH .'admin/js/swfobject.js', FALSE, '2.2');
            else {
                wp_register_script('jquery-cycle', NGGALLERY_URLPATH .'js/jquery.cycle.all.min.js', array('jquery'), '2.88');
                wp_enqueue_script('ngg-slideshow', NGGALLERY_URLPATH .'js/ngg.slideshow.min.js', array('jquery-cycle'), '1.05'); 
    
            }   
    
    		// Load AJAX navigation script, works only with shutter script as we need to add the listener
    		if ( $this->options['galAjaxNav'] ) {
    			if ( ($this->options['thumbEffect'] == "custom") || function_exists('srel_makeshutter') ) {
    				wp_enqueue_script ( 'ngg_script', NGGALLERY_URLPATH . 'js/ngg.js', array('jquery'), '2.0');
    				wp_localize_script( 'ngg_script', 'ngg_ajax', array('path'		=> NGGALLERY_URLPATH,
                                                                        'callback'  => site_url() . '/' . 'index.php?callback=ngg-ajax',
    																	'loading'	=> __('loading', 'nggallery'),
    				) );
    			}
    		}
    
    	}

    I hope this helps.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: NextGEN Gallery] Problem with pagination with 2 or more galleries’ is closed to new replies.