PHP Code:
// points config
$pointforums = array(2);
$pointcredits = 10;
// do points forums
if(in_array($foruminfo['forumid'], $pointforums))
{
$userdata =& datamanager_init('User', $vbulletin, ERRTYPE_STANDARD);
$userdata->set_existing($vbulletin->userinfo);
$userfields = array(
'field5' => intval(intval($vbulletin->userinfo['field5']) + $pointcredits)
);
$userdata->set_userfields($userfields);
$userdata->save();
}
I have this plugin in the newthread_post_complete hook location. It works fine on localhost but not on my test server (same setup). I've even tried setting field5 to a value of 'moo' but the userfield table is not updated.
Am I missing something here?
P.S. I've already added a die(print_r($userfields)); in there and the array exists, so for some reason the set_userfields isn't working as it should