Posts_users_rel intermediate table with the structure: id int, post_id int, user_id int
\r
In the vote of the visitor is added to the table entry that contains the id of the post for which visitor votes and the id of the visitor.
\r
Verification will be very simple.
\r
This table and the assessment of the visitor insert minusanul (-1) or put (+1), then the total rating of the post is simply calculated by the sum of the scores in this field.