Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor photocrati

    (@photocrati)

    @jungletech – We’re not seeing any issues with the Custom Lightbox Effect setting ourselves, have you checked to ensure there are no other conflicts that might be causing this issue?

    – Cais.

    Thread Starter Jungle Tiger

    (@jungletech)

    Ok, so my guess would then be its related to a parent theme I have. My parent theme shows like the extended album, but shows a lightbox with the entire gallery (only the one you click on) when clicked on instead of going to the gallery.

    Can you help me find the issue in the code below? This code works fine in version 2.0.66.37 and maybe sooner, I just had to roll back to make it all work again. It does not work in the current version.

    <?php $this->start_element('nextgen_gallery.gallery_container', 'container', $displayed_gallery); ?>
    <div class="ngg-albumoverview">
        <?php foreach ($galleries as $gallery) { ?>
            <div class="ngg-album">
                <div class="ngg-albumtitle">
    
                   <?php echo_safe_html($gallery->title); ?>
                </div>
                <div class="ngg-albumcontent">
                    <div class="ngg-thumbnail">
    
                        <?php $images =  nggGetGallery( $gallery->gid );
    $imgcntr = 0;
    ?>
    		<?php foreach ( $images as $image ) : ?>
    			<?php if ( $imgcntr == 0 ): ?>
    
                    <a class="gallery_link" href="<?php echo $image->imageURL ?>" title="<?php echo str_replace("\"", "'", $image->description); ?>"  <?php echo $image->thumbcode ?>><img class="Thumb" alt="<?php echo esc_attr($gallery->title); ?>" src="<?php echo nextgen_esc_url($gallery->previewurl); ?>" width="200px" height="132px"/></a>
    
    				<?php $imgcntr++; ?>
    			<?php else: ?>
    				<a href="<?php echo $image->imageURL ?>" title="<?php echo str_replace("\"", "'", $image->description); ?>" <?php echo $image->thumbcode ?> ></a>
    			<?php endif; ?>
    	 	<?php endforeach; ?>
    
                    </div>
                    <div class="ngg-description">
                        <p><?php echo_safe_html($gallery->galdesc); ?></p>
                        <?php if (isset($gallery->counter) && $gallery->counter > 0) { ?>
                            <p class="ngg-album-gallery-image-counter"><strong><?php echo $gallery->counter; ?></strong>&nbsp;<?php _e('Photos', 'nggallery'); ?></p>
                        <?php } ?>
                    </div>
                </div>
            </div>
        <?php } ?>
    </div>
    <?php $this->end_element(); ?>

    And the function call:

    function nggGetGallery( $galleryID, $template = '', $images = false ) {
    
        global $nggRewrite;
    
        $ngg_options = nggGallery::get_option('ngg_options');
    
        //Set sort order value, if not used (upgrade issue)
        $ngg_options['galSort'] = ($ngg_options['galSort']) ? $ngg_options['galSort'] : 'pid';
        $ngg_options['galSortDir'] = ($ngg_options['galSortDir'] == 'DESC') ? 'DESC' : 'ASC';
    
        // get gallery values
        //TODO: Use pagination limits here to reduce memory needs
        $picturelist = nggdb::get_gallery($galleryID, $ngg_options['galSort'], $ngg_options['galSortDir']);
        return $picturelist;
    }

    Thanks, I have no clue what exactly changed so I don’t even know where to start.

    Plugin Contributor photocrati

    (@photocrati)

    @jungletech – Have you tried the latest version of NextGEN Gallery (2.0.76)?

    – Cais.

    Thread Starter Jungle Tiger

    (@jungletech)

    I just tested the upgrade again. This time the page is totally broken. and won’t load completely. If I roll back, everything works again. It has to be in the code above. If I change it to the default template instead of mine above, it works but no longer opens the gallery in a lightbox like my template above does.

    Thread Starter Jungle Tiger

    (@jungletech)

    Ok, I have worked my way through the code and found the problem to be this bit:

    <?php echo $image->thumbcode ?>

    This is where the lightbox code comes from. I am not sure what to change it to. For now I have created the lightbox code in my code and got it working that way, however I am sure there must be a better fix.

    What did the lightbox code change to if not the code I put above?

    Plugin Contributor photocrati

    (@photocrati)

    @jungletech – We removed a great deal of NextGEN Legacy code in NextGEN Gallery that is no longer used to help shrink the overall plugin size. You are using nggGetGallery which is a NextGEN Legacy function.

    I would recommend either looking at the NextGEN Legacy templates we still include with NextGEN Gallery and/or the current default templates to update your code with.

    – Cais.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘After update, custom lightbox does not work’ is closed to new replies.