Formula for "top rated"

Just wondering how the top rated rankings are worked out. I use the zpMinimal theme on my site, with the front page set to use the top-rated image.

Looking at the stats, I can see that the top-rated image is one that has received a single 5* vote, yet there are others that have received more 5* votes and only 5* votes. That suggests that those photos should be top of the list, as they are liked by more people.

Comments

  • acrylian Administrator, Developer
    "Toprated" is measued by the average value `images.total_value/images.total_votes` currently. Done via a db query within the statistics plugin.
  • vpas Member
    OK, that makes sense. What is the sorting order for when 2 or more images have the same result?

    As 5/1 = 20/4 = 5000/1000.
  • acrylian Administrator, Developer
    Well, random I would say. The code currently does not differ. 5 stars by one vote or 5 stars by 5 votes is the same average rating naturally. Those calculation is directly done in a db query.
  • vpas Member
    Certainly not random.

    As per the stats page, I've over 10 photos rated with an average of 5*, but they are listed in the same way each time I refresh the page.

    Though I accept that this may be down to the caching, the photo that has been "top rated" and therefore shown as the main image on the zpMinimal entry page has remained the same every since I moved to that theme.

    Additionally, with the same data on my LAMP system at home, the same image is shown on the front page also.
  • acrylian Administrator, Developer
    Ok, randomly was not technically exact. Actually I have to admit I don't know how MySQL sorts things if they all have the same value.
Sign In or Register to comment.