WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery Voting
Voting error "you have already voted on this image." upon (18 posts)

  1. whappo
    Member
    Posted 2 years ago #

    When I vote, the vote works and all that, but I get a message saying that I've already voted. Why is this message appearing when this is my first vote?
    here is the link for an example.

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

  2. shauno
    Member
    Plugin Author

    Posted 2 years ago #

    Hey Whappo

    What versions of everything are you running? I have just installed the WP 3.2.1, NGG 1.8.2 and NGGV 1.8.2 and clean and fresh and it seems to work perfectly.
    I have tried to register on your site to check it out (username 'shauno'), but the password email either hasn't been sent, or is delayed

  3. shauno
    Member
    Plugin Author

    Posted 2 years ago #

    Ah wait, just looking at your source, I think I might have spotted something. It seems you have the voting tag inside the <a> around the image.
    That is probably confusing the CSS. Move the vote tag out and check again

  4. whappo
    Member
    Posted 2 years ago #

    but I was just following instructions! anyways, my host is godaddy and (as I discovered), the have the worst emailing system possible. You'll probably get the email within 30 mins. I'm going to change hosts for this reason.

    SO I fixed the code and moved it out of the <a> tag, but when I vote I get the message "You have already voted on this image." The vote does count though, I just dont know why it is stating that.

    here's a pic

  5. shauno
    Member
    Plugin Author

    Posted 2 years ago #

    That's freaky. The ajax voting isn't even working?
    I'm guessing it a combination of options I don't use personally, so bugs might have slipped through testing.
    I'm gonna have a look at it, and I will let you know what I find. Might take a bit, still got a day job to attend that pays the rent.

  6. whappo
    Member
    Posted 2 years ago #

    Ok, keep me posted with your developments! Thanks for your help.

  7. shauno
    Member
    Plugin Author

    Posted 2 years ago #

    Can you paste the code from the NGG view template you are using?

  8. whappo
    Member
    Posted 2 years ago #

    Is that the gallery.php file?

  9. whappo
    Member
    Posted 2 years ago #

    This might be what you want.

    *Edit: no it is not.

  10. shauno
    Member
    Plugin Author

    Posted 2 years ago #

    Yes. I'm looking at my test installation, and it works perfectly. For some reason it seems the javascript that ajaxifies the links isnt being loaded on your site. But even then, the voting should work fine (and does if I force js off on my test install).

    No idea what the thing is with your site yet..

  11. shauno
    Member
    Plugin Author

    Posted 2 years ago #

    No, not the style sheet. gallery.php where you pasted the voting tag

  12. whappo
    Member
    Posted 2 years ago #

    <?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>
    
    <?php echo nggv_imageVoteForm($image->pid); ?>
    
    	</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; ?>
  13. whappo
    Member
    Posted 2 years ago #

    Oh, I disabled every plugin but ngg & ngg voting and it seems to be working! Interestingly I vote but only when I refresh do the thumbs disappear

  14. shauno
    Member
    Plugin Author

    Posted 2 years ago #

    Um, is it me, or does it look like it's working now on your site?

  15. whappo
    Member
    Posted 2 years ago #

    Yes it does! It was a conflict with a plugin... have to figure that out later.
    How hard would it be to allow only one vote from all the photos? Eg: vote on a photo, then the rest can't be voted on.
    This would be the best scenario for me, but if that's not possible, I'll just switch to the star rating system (I don't really like it as its not as accurate since each photo may receive a different number of votes)

  16. shauno
    Member
    Plugin Author

    Posted 2 years ago #

    Gah, and I've just spent the last 2 hours trawling through 2 year old code that's perfect to start with :|

    I was gonna try add the single vote per gallery tonight, but you and blackbyrd84 non-problems took all my free time tonight.

    I will try have a look at it sometime soon, as I don't think it would be the end of the world to add. I mean, you did toss me a donation...

  17. whappo
    Member
    Posted 2 years ago #

    Ahaha, sorry about that. Do let me know when you add that code, you'll be my hero! And btw, maybe you should revise your installation instructions to mention to add that code after the <a> tag. Save everyone some time.
    Ok, thanks again for your help!

  18. shauno
    Member
    Plugin Author

    Posted 2 years ago #

    @whappo: I've added the ability to limit voting to once per gallery. Let me know if you find any problems.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic