WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery Voting
[resolved] Can't enable voting on single images (6 posts)

  1. BidBoxUSA
    Member
    Posted 1 year ago #

    My website crashed a few days ago and now I can't get my voting for my images to work again. I have added the code to the gallery.php and it's just not working at all. Even if I go into manage gallery and try to enable voting for an image and then save it it won't let me. Any suggestions?

    Here is my gallery php file:

    <?php
    /**
    Template Page for the gallery overview
    
    Follow variables are useable :
    
    	$gallery     : Contain all about the gallery
    	$images      : Contain all images, path, title
    	$pagination  : Contain the pagination content
    
     You can check the content when you insert the tag <?php var_dump($variable) ?>
     If you would like to show the timestamp of the image ,you can use <?php echo $exif['created_timestamp'] ?>
    **/
    ?>
    <?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($gallery)) : ?>
    
    <div class="ngg-galleryoverview" id="<?php echo $gallery->anchor ?>">
    
    <?php if ($gallery->show_slideshow) { ?>
    	<!-- Slideshow link -->
    	<div class="slideshowlink">
    		<a class="slideshowlink" href="<?php echo $gallery->slideshow_link ?>">
    			<?php echo $gallery->slideshow_link_text ?>
    		</a>
    	</div>
    <?php } ?>
    
    <?php if ($gallery->show_piclens) { ?>
    	<!-- Piclense link -->
    	<div class="piclenselink">
    		<a class="piclenselink" href="<?php echo $gallery->piclens_link ?>">
    			<?php _e('[View with PicLens]','nggallery'); ?>
    		</a>
    	</div>
    <?php } ?>
    
    	<!-- Thumbnails -->
    	<?php foreach ( $images as $image ) : ?>
    
    	<div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box" <?php echo $image->style ?> >
    		<div class="ngg-gallery-thumbnail" >
    			<a href="<?php echo $image->imageURL ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> >
    				<?php if ( !$image->hidden ) { ?>
    				<img title="<?php echo $image->alttext ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" <?php echo $image->size ?> />
    				<?php } ?>
    			</a>
    		</div>
    		<div style="text-align:center">
    			<?php echo nggv_imageVoteForm($image->pid); ?>
    		</div>
    	</div>
    
    	<?php if ( $image->hidden ) continue; ?>
    	<?php if ( $gallery->columns > 0 && ++$i % $gallery->columns == 0 ) { ?>
    		<br style="clear: both" />
    	<?php } ?>
    
     	<?php endforeach; ?>
    
    	<!-- Pagination -->
     	<?php echo $pagination ?>
    
    </div>
    
    <?php endif; ?>

    I am using the following short code:

    [nggallery id=13 template=caption]

    SO I also edit my gallery-caption.php (just to be sure) and it looks like this:

    <?php
    /**
    Template Page for the gallery overview
    
    Follow variables are useable :
    
    	$gallery     : Contain all about the gallery
    	$images      : Contain all images, path, title
    	$pagination  : Contain the pagination content
    
     You can check the content when you insert the tag <?php var_dump($variable) ?>
     If you would like to show the timestamp of the image ,you can use <?php echo $exif['created_timestamp'] ?>
    **/
    ?>
    <?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($gallery)) : ?>
    
    <div class="ngg-galleryoverview" id="<?php echo $gallery->anchor ?>">
    
    <?php if ($gallery->show_slideshow) { ?>
    	<!-- Slideshow link -->
    	<div class="slideshowlink">
    		<a class="slideshowlink" href="<?php echo $gallery->slideshow_link ?>">
    			<?php echo $gallery->slideshow_link_text ?>
    		</a>
    	</div>
    <?php } ?>
    
    <?php if ($gallery->show_piclens) { ?>
    	<!-- Piclense link -->
    	<div class="piclenselink">
    		<a class="piclenselink" href="<?php echo $gallery->piclens_link ?>">
    			<?php _e('[View with PicLens]','nggallery'); ?>
    		</a>
    	</div>
    <?php } ?>
    
    	<!-- Thumbnails -->
    	<?php foreach ( $images as $image ) : ?>
    
    	<div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box" <?php echo $image->style ?> >
    		<div class="ngg-gallery-thumbnail" >
    			<a href="<?php echo $image->imageURL ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> >
    				<?php if ( !$image->hidden ) { ?>
    				<img title="<?php echo $image->alttext ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" <?php echo $image->size ?> />
    				<?php } ?>
    			</a>
    			<span><?php echo $image->caption ?></span>
    		</div>
    	<div style="text-align:center">
    			<?php echo nggv_imageVoteForm($image->pid); ?>
    	</div>
    	</div>
    	<?php if ( $image->hidden ) continue; ?>
    	<?php if ( $gallery->columns > 0 && ++$i % $gallery->columns == 0 ) { ?>
    	<br style="clear: both" />
    	<?php } ?>
     	<?php endforeach; ?>
    
    	<!-- Pagination -->
     	<?php echo $pagination ?>
    
    </div>
    
    <?php endif; ?>

    Please help I am fresh out of ideas.

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

  2. shauno
    Member
    Plugin Author

    Posted 1 year ago #

    Hi BidBoxUSA

    You probably need to de-activate and then re-activate the voting plugin. There was an update, and if the activation hasn't run, the database tables will need to be updated.

    You are right adding the voting code to the gallery-caption.php file when using the template=caption argument in the shortcode though.

    Do the de-activate / re-activate, and let me know if you are still having problems.

  3. BidBoxUSA
    Member
    Posted 1 year ago #

    I de-activated and re-activated it and it allows me to enable the voting but it is not accepting my default settings for the plugin.

    For my default settings I have ALL the gallery boxes unchecked.

    For the Image settings I have enable, one per image (# of votes), and allow users to see votes checked. I also have star rating set up.

    When I upload an image into the gallery the voting options under manage gallery for that image default to > Enable, Only allow logged in users, Only allow 1 vote per person for this GALLERY, and allow users to see results. The rating type is also star rating.

    Why is it defaulting to 1 vote per person per GALLERY and only logged in users can vote? I don't want that.

  4. shauno
    Member
    Plugin Author

    Posted 1 year ago #

    Hi again BidBoxUSA
    You seem to have uncovered a bug. New images always seem to take on the 'One per gallery image is in' option.
    I will get a fix out ASAP, sorry for the inconvenience.

  5. shauno
    Member
    Plugin Author

    Posted 1 year ago #

    Please update to 2.3.2, and re-test. This should fix the problem with new images not taking on the correct default settings. Please make sure to re-save the default settings before uploading a new image.

    Let me know how it goes.

  6. BidBoxUSA
    Member
    Posted 1 year ago #

    That seems to have fixed the problem. Thanks! =)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.