PDA

View Full Version : How to create nice looking ranking system?



auriaks
01-31-2010, 02:38 AM
Hi,
I have some files, and want them to be ranked by users... How I can do something like in this site? HERE (http://marabu.xz.lt/main.php)

There you can see stars, blue line and how many votes... Something like that would fit my needs :) Thanks

Nile
01-31-2010, 05:39 AM
What I would do is have a database looking like this:
http://localhostr.com/files/4690d3/capture.png
And then, say since there are 4 votes for poll #1, I would get everyone that has 1 [true or yes], and do [number of votes for yes] * 100 / total votes, then have a div thats 100px and every percent counts as 1 px. So:
1: 50% ( 2 * 100 / 4 = 50)
2: 50% ( 1 * 100 / 2 = 50)

If you don't understand I can make you an example, also for the stars that would be 2.5 stars / 5 because:
1: 50% ( 2 * 100 / 4 = 50), 2.5 stars ( 5 * 2 / 4 )
2: 50% ( 1 * 100 / 2 = 50), 2.5 stars ( 5 * 1 / 2 )

auriaks
02-01-2010, 05:26 PM
Thanks, that is a good idea...

Nile
02-01-2010, 10:40 PM
Need help, or do you completely understand?

auriaks
02-04-2010, 02:31 PM
I understood it nicely :) But it looks like in the page stars are divided into 5 stars... its javascript or what?

Nile
02-04-2010, 11:54 PM
Oh - the hover effect? Yes... this is javascript. I find this very cool: http://www.nickstakenburg.com/projects/starbox/ But it uses prototype. Search around google vote rating star scripts or something like that

auriaks
02-09-2010, 11:12 PM
whats the difference with prototype?

auriaks
02-25-2010, 07:39 PM
Maybe there is a way to do it without the prototype?