#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    2
    Rep Power
    0

    Count # of clicks on image, rating system


    Hey there,
    I am a complete noob when it comes to PHP programming, i know Java, HTML, CSS and a little javascript.
    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.
  2. #2
  3. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,759
    Rep Power
    9397
    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?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    2
    Rep Power
    0
    Originally Posted by requinix
    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?
    Correct.
  6. #4
  7. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,759
    Rep Power
    9397
    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.

IMN logo majestic logo threadwatch logo seochat tools logo