PDA

View Full Version : Registration [custom userfield]


radekarc
10-05-2008, 01:38 PM
Welcome!
I have a problem.

I added the required field for users.
Type: Single-Selection Menu
Values:
Male
Female

I want to set that when you choose to register after the female - a new user to automatically save the group id 9

Here is an modification of their file, but it does not work. Moves to a group of 9 all new users (including those who select 'Male').

Please help ...

With Thanks

File: register.php
Version: 3.7.3 PL1
Line: 345
// 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 if ($vbulletin->userfield["field5"] = 2)
{
$newusergroupid = 9;
}
else
{
$newusergroupid = 2;
}
// set usergroupid
$userdata->set('usergroupid', $newusergroupid);

//edit
I tried it with:
else if ($vbulletin->GPC['userfield["field5"]'] = 2)
but does not work :(

Dismounted
10-06-2008, 05:43 AM
Last time I looked at register.php, it should be:
$vbulletin->GPC['userfield']['field5']

radekarc
10-06-2008, 06:42 AM
YEAH!! I did it :D
Thank you very much, Dismounted

Correct code:
// 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 if ($vbulletin->GPC['userfield']['field5'] == 2)
{
$newusergroupid = 9;
}
else
{
$newusergroupid = 2;
}