Support » Plugin: NextGEN Gallery Voting » [Plugin: NextGEN Gallery Voting] show total result for an image

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

    (@shauno)

    Hi tomas
    Unfortunately there isn’t anything like that in the plugin currently. You can run a query on the database yourself if you want. Something like this should do it:
    SELECT COUNT(*) AS total_votes FROM wp_nggv_votes

    That’s not going to take into account images that have votes cast, and then were deleted from NGG, but it will give you the total number of votes ever cast.

    Hi,
    thanks for your answer, but it is not what i need, you know. In the past version of plugin was able to see results for image via function:

    $results = nggv_getImageVotingResults($image->pid, array(“num”=>true));
    echo $results[‘number’];

    but it does’t work anymore although i rewrote name of function to “getImageVotingResults”.

    Plugin Author shauno

    (@shauno)

    Sorry, I thought you were after all the votes across the site.
    You can still get that info, it’s just now wrapped in an object.

    $results = $officalNggVoting->getImageVotingResults($image->pid, array("num"=>true));

    That should do it 🙂

    Hi,
    thanks for that piece of code, but it doesn’t work for me. do you have any idea where the problem should be?

    /*code*/
    ‘$results = $officalNggVoting->getImageVotingResults($image->pid, array(“num”=>true));
    echo $results[‘number’];’

    placed after the tag with voting form.

    Thanks for your time!

    Plugin Author shauno

    (@shauno)

    You need to declare the scope of the object. So the full code would be:

    <?php
    global $officalNggVoting;
    $results = $officalNggVoting->getImageVotingResults($image->pid, array("num"=>true));
    echo $results['number'];
    ?>

    Thanks a lot! Works like a charm:)

    I’ve the same problem for the creation of recent blog : I wish Insert the score or number of total vote on all image. Ok, I must placed the latest code :

    <?php
    global $officalNggVoting;
    $results = $officalNggVoting->getImageVotingResults($image->pid, array("num"=>true));
    echo $results['number'];
    ?>

    in php page but I’m Just a WebDesigner … In which page? And Where in this page?

    Sorry for my horrible english

    Plugin Author shauno

    (@shauno)

    Hi Nicolas
    You need to add that code to the template that you added the original voting tag. If you are using the shortcode [nggallery id=x] then that file is wp-content/plugins/nextgen-gallery/views/gallery.php

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: NextGEN Gallery Voting] show total result for an image’ is closed to new replies.