• Resolved Anonity

    (@anonity)


    Hey again,

    Could it be possible to show to total amount of votes that each image received even after I disable the voting for the images in that gallery?

    It doesn’t matter if “Allow users to see results” is enabled, the moment it turn off voting, the results dissapear on the gallery (they are still on the CMS though, but I would like people to be able to see the results after the voting finished too.

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author shauno

    (@shauno)

    This is sort-of possible. We can get the voting results, and show them, but in a text based style. So if you are using star rating for example, it won’t show the stars highlighted to the current results like if you have voting enabled.
    What rating type are you using?

    Thread Starter Anonity

    (@anonity)

    Just “Likes”, I guess it has to be kind of easy to implement since what I want to show is the same that is showed when someone votes: “XX likes”… It’s just that after I disable the voting for the images in that gallery, the results are not shown, so yeah, that’s it.

    No stars and nothing else, just the same counter shown when it’s enabled.

    Plugin Author shauno

    (@shauno)

    I will hack something up a bit later today, and post it here

    Plugin Author shauno

    (@shauno)

    Ok, so I altered the code from the previous thread highlighting the top image.
    Change the section at the top to this:

    <?php
    global $officalNggVoting;
    $topVotedScore = 0; $votingResults = array();
    foreach ((array)$images as $image) {
    	$votingResults[$image->pid] = $officalNggVoting->getImageVotingResults($image->pid, array('avg'=>true, 'likes'=>true));
    	if($votingResults[$image->pid]['avg'] > $topVotedScore) {
    		$topVotedScore = $votingResults[$image->pid]['avg'];
    	}
    }
    ?>

    Then, where you would have the voting tag when voting is enabled, put this instead:
    <?php echo $votingResults[$image->pid]['likes'].' '.($votingResults[$image->pid]['likes'] == 1 ? 'Like' : 'Likes') ?>

    That should do it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Show results even after disabling the voting’ is closed to new replies.