Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Webmaster BG3

    (@webmaster-bg3)

    Nextgen version 1.9.x
    All files in wp-content/plugins/nextgen-gallery/admin

    batch-import.php (user interface)
    http://pastebin.com/AsqVTbHr

    processor.php (do all the job)
    http://pastebin.com/gUZDZS4L

    csv.php (not a real csv class but only a line by line reader)
    http://pastebin.com/HjdhAzAR

    csv format is
    PATH;TITLE;ALBUM

    i.e.
    /testme;A test gallery;3

    import the folder /testme (processor.php contain basepath) in a new gallery, assign the title “A test gallery” and add the gallery to albumID #3

    of course you have to prepare a CSV, and a directory tree with your gallery and picture file (name must be sanitized, no space, no strange character)

    hope to be helpful

    my nextgen: 33 album, 513 gallery, 47786 images… growing everyday!

    same for me +1

    Thread Starter Webmaster BG3

    (@webmaster-bg3)

    Updated today. Everything sounds good with 1.5 release.

    Thread Starter Webmaster BG3

    (@webmaster-bg3)

    I have found the solution by myself, so I like to post the answer for anyone who has the same problem.

    N.B. this work only on development version of Easy Fancybox. Get the plugin link at the end of the post

    1) Configure Nextgen effect for fancybox:
    Go to http://yoursite.com/wp-admin/admin.php?page=nggallery-options at tab “Effects”, select “Custom” as JavaScript Thumbnail effect and put this line of code in Link Code line

    class="fancybox" rel="%GALLERY_NAME%"

    2) Modify plugin code to get ajax pagination for custom effect:
    Open the file wp-content/plugins/nextgen-gallery/nggallery.php and locate this block of code:

    // 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'  => trailingslashit( home_url() ) . 'index.php?callback=ngg-ajax',
    															'loading'	=> __('loading', 'nggallery'),
    		) );
    	}
    }

    Modify the code to be like this:

    // 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'  => trailingslashit( home_url() ) . 'index.php?callback=ngg-ajax',
    															'loading'	=> __('loading', 'nggallery'),
    		) );
    	}
    	else if ( ($this->options['thumbEffect'] == "custom") || 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'  => trailingslashit( home_url() ) . 'index.php?callback=ngg-ajax',
    															'loading'	=> __('loading', 'nggallery'),
    		) );
    	}
    }

    Now open the file wp-content/plugins/nextgen-gallery/js/ngg.js and locate the line:

    shutterReloaded.init('sh');

    You must found two occurrence in Nextgen Gallery 1.9.12. Change the code like this for both occurrence:

    //shutterReloaded.init('sh');
    easy_fancybox_handler();

    That’s all! Now you have Ajax pagination and Easy Fancybox working together.

    Warning: the modification i suggest will broke the default shutter effect, because I commented out it’s call. Another problem is that you could have some error if you uninstall or disable Easy Fancybox. So it need to be hardened if you want a safe code

    My setup:
    – WordPress 3.5.1
    – Easy Fancybox 1.5.0dev11 from http://downloads.wp.xz.cn/plugin/easy-fancybox.zip
    – Nextgen Gallery 1.9.12

    Hope to be helpful

    Thread Starter Webmaster BG3

    (@webmaster-bg3)

    solved by myself

Viewing 5 replies - 1 through 5 (of 5 total)