944,111 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1736
  • PHP RSS
Jan 11th, 2007
0

How to best rank items based on vote data

Expand Post »
Hello, I'm new here. Thank you for your time.

I have a PHP module that I use for user submitted poems. Based on the vote data I have poet rankings.

Table schema:
ratingdbid - int
ratinglid - int
ratinguser - char
rating - int
ratinghostname - char
ratingcomments - text
ratingtimestamp - datetime
rating_favorite - int

Right now people are ranked based on Average score. My thought was to create a batch job to maintain a ranking table I could join into this data. My question is what would be best to calculate the ranking on.

Vote data tallies up to:
Average | Reads | Votes | Comments | Page Slam Wins | # Poems

Of that data I can calculate stdev of scores, remove Min and Max from the averages... I can do all sorts of things.

What do you think would work?
Are there any gammers out there with ideas?

Can you think of a better forum on DeniWeb to ask this question?
Last edited by spacebar; Jan 11th, 2007 at 4:12 pm.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
spacebar is offline Offline
1 posts
since Jan 2007
Jan 11th, 2007
0

Re: How to best rank items based on vote data

You can run a mysql query to calculate the average:
PHP Syntax (Toggle Plain Text)
  1. select avg(rating) from ratings where ratinglid=123 group by rating
Reputation Points: 13
Solved Threads: 2
Junior Poster
php_daemon is offline Offline
138 posts
since Aug 2006
Jan 13th, 2007
0

Re: How to best rank items based on vote data

You could add another table that adds value to each type of total.

So you can rate a user like:
Like Average X 5.
Reads X 2
Votes X 3
Comments X1
Page Slam Wins X2
# Poems X 4

etc...

And you can also add value to a rating give by a user by making the rating worth more if the user giving the rating is rated higher.. etc.

could get to be a bit of processing with that second one though...

very interesting stuff...
Moderator
Reputation Points: 457
Solved Threads: 101
Nearly a Posting Virtuoso
digital-ether is offline Offline
1,250 posts
since Sep 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Accessing HTML checkboxes with php and javascript
Next Thread in PHP Forum Timeline: Can a text link pass php variables?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC