• Resolved netvision

    (@netvision)


    Hi, I see the plugin creates two custom fields (for up and down votes) but I need a third one which provides the average of these two fields. How can I achive this? You don’t have to update the plugin, please just give me an idea and I will play with the codes. I need to order posts by the average of the votes. I like your plugin a lot and do not want to look for another plugin, just gave 5 stars!

    https://www.ads-software.com/plugins/thumbs-rating/

Viewing 1 replies (of 1 total)
  • Plugin Author Ricard Torres

    (@quicoto)

    Hi there netvision,

    Thanks for the review!

    Regarding your question, I think you need to store 2 more fields.

    – Average
    – Number of posts affected

    Although the second could be calculated every time you save the average I don’t know what’d be faster.

    Every time somebody votes you have to update the average field (thumbs_rating_add_vote() function). It’s all there in the plugin source code.

    Cheers.

Viewing 1 replies (of 1 total)
  • The topic ‘Votes average’ is closed to new replies.