How should I go about creating a point system for users like SO and yahoo answers?(PHP)

Posted by ggfan on Stack Overflow See other posts from Stack Overflow or by ggfan
Published on 2010-04-12T16:05:20Z Indexed on 2010/04/12 16:33 UTC
Read the original article Hit count: 351

Filed under:
|

I am creating a voting system for a Q&A site project in which if a user asks a question, he/she losses -5 points; answer a question +5, vote a question +1, etc. (kind of like SO and yahoo answers)

-->To create the basic arithmetic, I have a "users_points" table that relates the user_id and their total points.

+---+---------+
| 1 | 100     |
+---+---------+
| 2 | 54      |
+---+---------+

-->Basically if the users does certain task, it would + or - the points. How do I prevent users from say voting an answer up 100 times. ex: I want a user to be only able to vote once per question, etc.

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql