The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
php/sql : get number X, remove X points of rep from single person
Here's what I want to do:
(1) Delete all reputation scorings where a reason was not provided. I think the SQL for this is : "'DELETE from '.TABLE_PREFIX.'reputation where reason = \'\';'". (2) Remove the deleted scores from those peoples reputations. e.g. if they had a total of +2 reputation points from scores with no reason, after those scores were deleted, they should lose two points of rep on the display. I think I might have to do a "SELECT reputationid,postid,score from '.TABLE_PREFIX.'reputation where reason = \'\';" first, to get the IDs of the posts. Then another query to find out who owns the posts. Then a third query to remove those scores from those users. All this in a for loop for each score without a reason. Please tell me there is an easier way? For example : a way for the forum to notice those records were deleted, and to update the user's score accordingly without me manually having to rebuild the reputation records for every user... or even that specific person by hand? I have tried requiring people to enter a reason when they give rep. That doesn't work, they just enter junk as the reason, and my forum is too big for me to review all the rep by hand. I have tried altering the reputation.php code so that any rep given with no reason is automatically assigned a score/power of 0, no matter what score the sender intended. To do that, edit reputation.php, find : PHP Code:
PHP Code:
So, my current solution is to let them post rep with no reason, and let the rep stick around for a week, but then to use a cron task to delete that rep from the person who got it, in effect reversing it automatically. Thing is I'm not sure that this method will actually decrease the rep count in the user table. So yeah, any help would be appreciated. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|