Im trying to modify a couple of userfields using the new user data manager.
code:
PHP Code:
$userfields = array('field7' => $data1, 'field8' => $data2);
$userdata = datamanager_init('User', $vbulletin, ERRTYPE_STANDARD);
$userdata->set_existing($userinfo);
if($userdata->set_userfields($userfields))
{
$userdata->save();
} else {
echo "failed";
}
$userinfo is retrieved from fetch_userinfo();.
The script returns "failed". I have no idea why, and im having a bit of trouble following the class structures this late at night.
Any ideas?
Getting slightly closer, it appears the array needs to contain field
x_set and _opt (set being set to 1, opt as far as i know set to 1 if the field is optional?)
Still didnt work though. /me keeps looking.