Quote:
Originally Posted by MarkFL
Yes for a warning it returns 0 and, for example if I issue a custom infraction for 1 point, it returns 1.
|
strange, then the code should work. it should have worked by using != 0
--------------- Added [DATE]1450894799[/DATE] at [TIME]1450894799[/TIME] ---------------
Ok, let's try removing some of the unneeded code and just getting the basics.
PHP Code:
global $vbulletin, $db, $userinfo;
if ($userinfo['ipoints'] > 0)
{
$newrep = ($userinfo['reputation'] - $userinfo['ipoints']*500);
}
else
{
$newrep = ($userinfo['reputation'] - 150);
}
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "user
SET reputation = " . $newrep . "
WHERE userid = " . $userinfo['userid']
);
Does this work? It should subtract points for Warning & Infraction