Quote:
Originally Posted by bananalive
Woops it shouldn't have removed all other membergroups, there was a little mistake in the code  . But if thats what you wanted then that alright
PHP Code:
if ($complete)
{
$user = $userinfo = $vbulletin->userinfo;
$newmembergroupid = '18';
$display_usergroup = $user['membergroupids'] = $newmembergroupid;
$userdata =& datamanager_init('User', $vbulletin, ERRTYPE_STANDARD);
$userdata->set_existing($userinfo);
$userdata->set('membergroupids', $user['membergroupids']);
$userdata->set_usertitle(
$user['customtitle'] ? $user['usertitle'] : '',
false,
$display_usergroup,
($user_usergroup['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canusecustomtitle']) ? true : false,
($user_usergroup['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['cancontrolpanel']) ? true : false
);
$vbulletin->userinfo['membergroupids'] = $user['membergroupids'];
$vbulletin->userinfo['displaygroupid'] = $newmembergroupid;
$userdata->save();
}
|
That didn't work either. It's still removing the user from all membergroups and it didn't successfully set the user to the new displaygroup either. My goal is to have them removed only from one group (17).
Is there a way to use one of the questions as a variable for this? I'd like to enter an userID in one of the questions, let's say question 1. When I enter that userID and submit, it will specifically remove that user from group 17 and and them to 18. As well as update their displaygroup to 18.