Post Voting Plugin Not Working

THANK YOU IN ADVANCE!!!

I need help ASAP!

I have installed this plugin and there are a few errors:
1- The voting mechanism isnt sticking, in other words- Once the thumbs up is clicked on then it refreshed but doesnt stay that way. I have tried with multiple IP's and it doesnt work. So, if you click the thumbds up the result stays at "0" after the AJAX refresh.

2- The voting isnt counting the titles of the blogs. They are counting the actual forms to which the entries were submitted then turned into blogs. Each blog should have the voting attached to it to tell which blog is the most popular.

Related info: Website URL is http://familyhelpingfamily.com and we used gravity forms to create a post dreaft which gets approved then published. The voting needs to be placed on every post so a person can vote UP a specific post. We also added on the plugin to only allow one vote per IP per day.

The posts are hosed in essay submissions.

Any advice is GREATLY appreciated!

  • Vladislav

    Hi,

    There indeed was a bug in the 2.1 release that affected the single-site installs, which should be fixed with the latest plugin release (v2.1.1, just released).

    Please, note that post voting restriction is calculated by user ID (if the person that voted was logged into your site), visitor IP (that can be turned off) and a voting cookie. So if you wish to test voting as multiple people, you may want to try from different IPs, not logged in and with cookies cleared (or in incognito mode, with browser restart for each vote).

    As for the other point, the auto-added voting elements can only perform on the post they "see" - which, in your case, is the form associated with the post, but not the post itself. Since this association is arbitrary to the Post Voting plugin, the auto-generated voting elements can't be used to vote on your associated posts.

    However, you can achieve what you need with template tags. To do this, you'll need to add something like this to your template for showing your forms:

    <?php
    // Obtain the actual associated post ID,
    // and put it in the $my_post_id variable
    // i.e. $my_post_id = ....
    // ...
    echo wdpv_get_vote_up(false, $my_post_id);
    echo wdpv_get_vote_result(true, $my_post_id);
    ?>

    Please note the comments in the first couple of lines - you will have to somehow obtain the associated post ID, and use that as the template tags second argument.

  • miquil

    Hello,

    I thinks I'm having the same problem as jchura.
    The results does not show up. I use a custom post type.

    http://www.possol.nl/design-jam/voting/
    As u can see on the voting page all results are 0. When u press one of them the other one also gets the right results.

    On the single post type page I don't have this problem
    http://www.possol.nl/designs/smile-todayy/

    for the voting page I use the following code.
    <?php
    $loop = new WP_Query(array('post_type' => 'designs', 'posts_per_page' => 100));
    while ( $loop->have_posts() ) : $loop->the_post();
    $slug = basename(get_permalink());
    $custom = get_post_custom($post->ID);
    ?>
    <div id="vote-design-<?php the_ID(); ?>" class="vote-design grid_4">
    <div class="vote-design-image"><?php the_post_thumbnail('design-image'); ?></div>
    <h3 class="vote-design-title"><?php the_title(); ?></h3>
    <div class="vote-design-votes"><?php echo wdpv_get_vote_result(true, $id); ?></div>
    <div class="vote-design-text"><?php echo $post->post_content;?></div>
    <div class="vote-design-author">By: Quincy</div>
    <div class="vote-design-voting"><?php echo wdpv_get_vote_up(true, $id); ?></div>
    <div class="vote-design-share">Share on Facebook | Share on Twitter</div>
    </div>
    <?php endwhile; ?>
    <?php wp_reset_query(); ?>

    Can someone please help us with this problem. It seems as if it is a javascript problem.

  • Vladislav

    Hi,

    Going by the code snippet you posted, it is very likely that the problem isn't javascript-related, unless I'm reading it wrong. The Post Voting template tags require the actual post ID to be passed as the second argument and it doesn't seem that the $id variable you're passing is being set within the new loop you created. If I'm right, you'll probably want to pass get_the_ID() instead.

  • miquil

    Hi VeBailovity,

    I tried what you suggested. This is my code now:

    <?php
    $loop = new WP_Query(array('post_type' => 'designs', 'posts_per_page' => 100));
    while ( $loop->have_posts() ) : $loop->the_post();
    $slug = basename(get_permalink());
    $custom = get_post_custom($post->ID);
    ?>
    <div id=&quot;vote-design-<?php the_ID(); ?>&quot; class=&quot;vote-design grid_4&quot;>
    	<div class=&quot;vote-design-image&quot;><?php the_post_thumbnail('design-image'); ?></div>
    	<h3 class=&quot;vote-design-title&quot;><?php the_title(); ?></h3>
    	<div class=&quot;vote-design-votes&quot;><?php echo wdpv_get_vote_result(true, get_the_ID()); ?></div>
    	<div class=&quot;vote-design-text&quot;><?php echo $post->post_content;?></div>
    	<div class=&quot;vote-design-author&quot;>By: Quincy</div>
    	<div class=&quot;vote-design-voting&quot;><?php echo wdpv_get_vote_up(true, get_the_ID()); ?></div>
    	<div class=&quot;vote-design-share&quot;><a href=&quot;#&quot;>Share on Facebook</a> | <a href=&quot;#&quot;>Share on Twitter</a></div>
    </div>
    <?php endwhile; ?>
    <?php wp_reset_query(); ?>

    But it still doesn't work. Only when I press the thumbs up button the right results are being shown. Take a look for yourself if possible. http://www.possol.nl/design-jam/voting/

    It first shows 0 for both designs and when I press the thumbs up. It changes to 2 and 4. (see screenshots). When I then refresh the page it changes to 0 again...

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.