Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6207427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:37:42+00:00 2026-05-24T05:37:42+00:00

I’ve been looking for some good rating system tutorials on the internet and I

  • 0

I’ve been looking for some good rating system tutorials on the internet and I can’t seem to find the one i’m looking for!
I’ve come across this article http://www.expertcore.org/viewtopic.php?f=74&t=1451 which uses the Bayesian Rating algorithm and a like/dislike rating and that one is the rating system I want except that system can only make a “Top rated list of all time”, I want to be able to make a “Top rated of today”, “Top rated of this week” and “Top rated of this month” aswell. I’m not to sure of how I’ll have to approach this problem because I’m not really great at database designs and I don’t want to encounter performance issues later on!

Example I have these three tables.

Table “Item”
id
name

Table “User”
id
name

Table “Vote”
id
itemID
userID
date

The normal algorithm is this:
br = ( (avg_num_votes * avg_rating) + (this_num_votes * this_rating) ) / (avg_num_votes + this_num_votes)

So to get a top rated list of all time I’ll have to calculate the BR for every item I have. Would it mean if I want the top rated list of this month I just do the same but check if the date of the votes are valid? Please give me tips and hints !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:37:44+00:00Added an answer on May 24, 2026 at 5:37 am

    Your table looks like it would work, you would just need to select all Vote records that happen in a date range. So, for “this week”, for all the values in that equation, you could apply a date filter when selecting to only choose rows in this week.

    For: avg_num_votes, avg_rating, this_num_votes, this_rating; all would need to be created off of records from “this week” otherwise your weights will be way off, and your “top this week” would only show records from all time.

    Same with “top rated this month” and “top rated today” you just want to see votes that have been voted in that time frame, and not take into account all votes from all time.

    For speed, you would want to filter as much as possible at the database level, so that would probably mean joining the Item and Vote tables, then selecting only where the date of the Vote is in the range you want, then working with that data.

    His own code would demonstrate this well, just adding in a filter to his select statements:

    $result = mysql_query(”SELECT AVG(item),AVG(vote) FROM itemvotes WHERE vote>’0’ GROUP BY item AND date BETWEEN '2010-08-20' AND '2010-08-21'”) or die(mysql_error());
    
    // this item votes and ratings
    $result = mysql_query(”SELECT COUNT(item),AVG(vote) FROM itemvotes WHERE item=’$theItem’ AND vote>’0’ AND date BETWEEN '2010-08-20' AND '2010-08-21'”) or die(mysql_error());
    

    This might not be exactly the same (or work at all, that example was a little funky), but it demonstrates what I mean.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I am reading a book about Javascript and jQuery and using one of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.