December 18th, 2012, 03:25 PM
Count # of clicks on image, rating system
I am trying to develop a rating system based off 3 DIFFERENT images, where after each vote, it will display how many times each image has been clicked, limited to one vote per ip. If possible, would like it to just display dynamically beneath all the images after a user votes.
Now, i have found a few tutorials on a voting system that loops through and places the according single Image or star for the rating system, but these all seem different and more complex than i really need it.
Any help is appreciated on how i can go about doing this, and any code someone is willing to provide is even more appreciated. I learn very well from seeing working code.
December 18th, 2012, 03:42 PM
It's a voting/poll system, not a voting/rating system.
So the "poll" is a collection of images and the "poll option" would be an image, right?
December 18th, 2012, 03:44 PM
Originally Posted by requinix
December 18th, 2012, 05:08 PM
Have you found any tutorials about the kind of voting system you want? Not about rating but about polling. So really "poll" would be a better search term.
Regardless the underlying stuff is pretty much always the same. Assuming a database, one table tracks the overall poll and includes information like title and start/end dates. Another table tracks the individual poll options, all related to the parent poll topic, with (in your case) the image location, maybe dimensions and a caption, stuff like that.
Finally a third table tracking people (like IP addresses) and the poll option they chose. That's also how you tell if someone has voted before: the existence of a record for that IP address and that poll. You use that to count votes per poll option too.