Quote:
Originally Posted by Savage702
I need this to add people to a secondary usergroup, not a primary.
|
I'm using it on a 3.8.1_PL1 installation for secondary usergroups, I had to do the next:
1- Find and delete this code block:
PHP Code:
<plugin active="1" executionorder="5">
<title>pb_usergroupchoice_ifemail</title>
<hookname>register_addmember_complete</hookname>
<phpcode><![CDATA[if($vbulletin->options['verifyemail']){
$vbulletin->input->clean_gpc('p', 'accounttype',TYPE_INT);
$accountusergroupid=$vbulletin->GPC['accounttype'];
$pb_usergroup_ids=explode(" ",$vbulletin->options['pb_usergroupchoice_ids']);
if(in_array($accountusergroupid,$pb_usergroup_ids)){
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "useractivation SET usergroupid = '".$accountusergroupid."' WHERE activationid = '".$activateid."' LIMIT 1 ");
}
}]]></phpcode>
</plugin>
2- Find this line:
PHP Code:
$userdata->set('usergroupid', $accountusergroupid);
3- Replace it with:
PHP Code:
$userdata->set('membergroupids', $accountusergroupid);
Hope that will solve your problem
Edit: Make sure you force group selection, so that new members are directed automatically.