Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

Articles: Comments and Ratings (Math is not quite right)

I use the Articles table quite a bit. In fact, my site has close to 7000 articles all told; which are all music/album reviews.

Within it, we use the Comments and Rating system. In fact, I have modified my Rating selections, as the default was too frugal for choices. Mine operates on scores between 100% and 10%, with increments of 5%. This means there are 19 options in there now, compared to the original 5. Changes are made in the includes/ratings_include.php file.

Anyway, my issue is this. At the tail of each article, there is the grey block which shows the Authors username, date, number of comments and ratings. Refer to the attachment.

However, the maths for the ratings don't seem to be right. Here's how the total of Comments and Ratings works out:

If there are zero comments and zero ratings, then the block displays correctly: 0 and 0.
If there are zero comments and one rating, then the block displays correctly: 0 and 1.
If there are two comments and zero ratings, then the block displays correctly: 2 and 0.

However:

If there are two comments and one rating, then the block displays incorrectly: 2 and 2. (2x1)
If there are four comments and three ratings, then the block displays incorrectly: 12 and 12. (4x3)

I know the code uses @Count for Comments and @Sum for Ratings. So I'm not sure if this is correct, but I've had users say to me that the numbers don't add up correctly for ratings. Referring to the mySQL database, the numbers are definitely correct in there, and anyway, on the Article page, you can clearly see the actual comments and the actual ratings.

Any assistance would be appreciated.

Thanks.

Ikandi
ikandi attached the following image:
comments-ratings.png
I think it's fixed in DEV version. Please wait for stable release 9.0.3.
Thread Information
Author
Replies
2 posts
Views
659 times
Last Post
Last updated on 1 year ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: RobiNN, ikandi