Quote:
Originally Posted by Chris.08i
I want to deduct reputation points from the user that is receiving the infraction.
The base amount is 150 points, but each active infraction point (ipoints in users table as far as I know) will apply a 2.5x multiplier. For example, someone with 4 infraction points will receive 1500 points deduction from their reputation column.
I hope that makes sense.
|
Yes, makes perfect sense. What we can do is get this done with just one query. While this code (hopefully) won't be called often, it's a good idea to get in the practice of minimizing the number of queries for any operation.
PHP Code:
global $userinfo;
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "user
SET reputation = (reputation - (375*ipoints))
WHERE userid = " . $userinfo['userid']
);