It hasn't even gone a day yet, give us some time will ya! ;]
Actually, I wrote an answer to this right after you wrote your post, but threadsdev hasn't been working properly since.
Here's what I wrote:
This is a bit tricky, but it is possible. This seems to work, but please make a backup of your database before running any of these queries.
When a user gets rated, the rate given is added to all other ratings given, and a counter is increased by one. The number of stars are calculated by dividing the total ratings by the number of times the user has been rated, and this number is also stored in the database.
So if you want to remove one users' rating, you first need to read how many stars that user gave to the user, which can be done with this SQL query:
code:
SELECT R_Rating
FROM w3t_Ratings
WHERE R_What = 'RatedUser'
AND R_Rater = 'RatingUser'
AND R_Type = 'u'
Now you can do this query, which removes the vote and recalculates the number of stars:
code:
UPDATE w3t_Users
SET U_Rating = U_Rating - ***INSERT_NUMBER_FROM_LAST_QUERY_HERE***,
U_Rates = U_Rates - 1,
U_RealRating = U_Rating / U_Rates
WHERE U_Username = 'RatedUser'
You can also remove the rating from the ratings table, but I don't think it's necessary, with this query:
code:
DELETE FROM w3t_Ratings
WHERE R_What = 'RatedUser'
AND R_Rater = 'RatingUser'
AND R_Type = 'u'
If you just want to set the number of stars to something else, you will also have to set U_Rating and U_Rates to something which can be properly calculated into the number of stars you want. Otherwise the number of stars will be screwed up when someone rates the user again. To set the number of stars to three, you could use the following query, which doesn't take into consideration any of the earlier ratings:
code:
UPDATE w3t_Users
SET U_Rating = 3,
U_Rates = 1,
U_RealRating = '3'
WHERE U_Username = 'RatedUser'
DISCLAIMER: I haven't gone through the ratings scripts thoroughly, but I'm quite sure that this is how it works.