ok I think I sorted out the scripts and now I have this plugin adding the usergroup choice on the memberships (secondary usergroup) instead of the primary usergroup (that is defaulted to "2")
change the part of the ifnotemail script to:
Code:
$userdata->set('usergroupid', 2);
$userdata->set('membergroupids', $accountusergroupid);
(obviously only the userdata set line)
and then add a plugin into the same product with hook location:
"register_addmember_process"
and paste inside this:
Code:
if($vbulletin->options['verifyemail']){
$vbulletin->input->clean_gpc('p', 'accounttype',TYPE_INT);
$accountusergroupid=$vbulletin->GPC['accounttype'];
$userdata->set('membergroupids', $accountusergroupid);
}
and in the end change the ifemail script, the SQL query has to become like this:
Code:
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "useractivation SET usergroupid = 2 WHERE activationid = '".$activateid."' LIMIT 1 ");
I'm actually using it for another pourpose but the principle is the same..
I'll keep an eye on this thread for any questions.
Cheers