HI
i'm try to add a rating section to my web site.
i want to make it a pro one just like what you can find here
download.com i like their way.
also here is fine windows market place
i had tried to do it myself but i didn't come to anything.
so i hope if you can help me.
Thanks in advance
Rating System
Moderator: General Moderators
Store the number of votes made, and the total of all the ratings.
So, if someone gave 'mycode' a 3, someone else gave it a 4, and someone else gave it a 1, it would have 3 total votes and a rating of 8.
Store these numbers in a database, and when you need to pull out the average rating, divide 8 (total of the votes) by 3 (total number of votes).
Yaaargh
So, if someone gave 'mycode' a 3, someone else gave it a 4, and someone else gave it a 1, it would have 3 total votes and a rating of 8.
Store these numbers in a database, and when you need to pull out the average rating, divide 8 (total of the votes) by 3 (total number of votes).
Yaaargh
If you want stars, have an image for 1 out of 5, 2 out of 5 ... 5 out of 5. Call them star_1.gif ... star_5.gif.
Now do a ceil on your average score, and call the correct gif, maybe:
Yarrrrrgh
Now do a ceil on your average score, and call the correct gif, maybe:
Code: Select all
$stars = ceil($votetotal / $totalnumberofvotesvotes);
print "<img src=\"star_".$stars.".gif\" />";Yarrrrrgh
-
alexmaster_2004
- Forum Commoner
- Posts: 35
- Joined: Wed Sep 14, 2005 8:44 am