PDA

View Full Version : Usergroup for new members


matthewhotdude
09-17-2009, 03:45 PM
I can see how to create a usergroup, But how do I set up what usergroup new members go into?

James Birkett
09-17-2009, 03:52 PM
I could be mistaken but I believe it's the register.php file (was looking at it yesterday):

// assign user to usergroup 3 if email needs verification
if ($vbulletin->options['verifyemail'])
{
$newusergroupid = 3;
}
else if ($vbulletin->options['moderatenewmembers'] OR $vbulletin->GPC['coppauser'])
{
$newusergroupid = 4;
}
else
{
$newusergroupid = 2;
}


As you can see , "$newusergroupid = 2" (line 356) is the new usergroup ID, so it could be possible that by changing the integer in this variable to the usergroup ID you want; it should work.


The nearest hook to this location is ($hook = vBulletinHook::fetch_hook('register_addmember_proc ess')) ? eval($hook) : false; which is like 385.

matthewhotdude
09-17-2009, 04:33 PM
So I just change this to the usergroup id and thats it

$newusergroupid = 3;

James Birkett
09-17-2009, 04:34 PM
I've not tested it but I would guess so.
Feel free to change it and register a test account then see what usergroup they are inserted into; you can always change it back by changing the integer.

matthewhotdude
09-17-2009, 04:39 PM
// assign user to usergroup 3 if email needs verification
if ($vbulletin->options['verifyemail'])
{
$newusergroupid = 3;
}
else if ($vbulletin->options['moderatenewmembers'] OR $vbulletin->GPC['coppauser'])
{
$newusergroupid = 4;
}
else
{
$newusergroupid = 2;
}

So which one am I changing

as I changed the 3 one but it didnt work

James Birkett
09-17-2009, 04:41 PM
No, change the 2 to whichever you want.

if ($vbulletin->options['verifyemail'])
{
$newusergroupid = 3; // users awaiting e-mail verification
}
else if ($vbulletin->options['moderatenewmembers'] OR $vbulletin->GPC['coppauser'])
{
$newusergroupid = 4; // coppa users/if you are moderating new members
}
else
{
$newusergroupid = 2; // standard usergroup if registration went fine.
}

HMBeaty
09-17-2009, 04:42 PM
you would change the
$newusergroupid = 2;

matthewhotdude
09-17-2009, 04:52 PM
Works a treat, Thank you