Version: 1.00, by lympboy
Developer Last Online: Jan 2013
Category: Integration with vBulletin -
Version: 4.x.x
Rating:
Released: 07-27-2011
Last Update: Never
Installs: 13
Additional Files
No support by the author.
Well, here I will explain them to VBuletin 4.x, how to make the register can select a user group
I demonstrate using for Men and Women.
1_ Let User Profile Fields ---> Create new profile field ---> Single Selection
Code:
Title: Select your Sex Description: Here you select your sex Options: Man Women Set Default: Yes, including a first option blank Field editable by the user: Just to register
(Leave everything else default, or put it in your opinion)
2_ Open the file register.php (It is located in the folder that your forum dode)
3_ Search:
PHP Code:
if ($vbulletin->options['verifyemail']) { $newusergroupid = 3; } else if ($vbulletin->options['moderatenewmembers'] OR $vbulletin->GPC['coppauser']) { $newusergroupid = 4; } else { $newusergroupid = 2; }
Replace:
PHP Code:
if ($vbulletin->options['verifyemail']) { $newusergroupid = 3; } else if ($vbulletin->options['moderatenewmembers'] OR $vbulletin->GPC['coppauser']) { $newusergroupid = 4; } else if ($vbulletin->userinfo['fieldX'] == "Women") { $newusergroupid = W; } else { $newusergroupid = 2; }
NOTE: Here where is the X put the number of field of field of user profile created
Aca says the number of the field:
This line is the X
PHP Code:
else if ($vbulletin->userinfo['fieldX'] == "Women")
And where is the W put the ID number of the user group, which in this case is the woman.
Here tells you the ID number, which in this case the user group is called Women.
This line is the W
PHP Code:
$newusergroupid = W;
NOTE: With all this echo up here, provided they are registered and NO is selected confirmation email, provided that register and selects men are assigned the default user group that is the id number 2, and when women are chosen will select the user group that you placed the corresponding id.
But should they be assigned the confirmation email option, you must also replace this in the register.php. (both steps are recommended in order to always be able or may not have the option to confirmation by email)
4_ Search:
PHP Code:
if ($vbulletin->options['verifyemail']) { $activateid = build_user_activation_id($userid, (($vbulletin->options['moderatenewmembers'] OR $vbulletin->GPC['coppauser']) ? 4 : 2), 0);
eval(fetch_email_phrases('activateaccount'));
vbmail($email, $subject, $message, true);
}
Replace:
PHP Code:
if ($vbulletin->options['verifyemail']) { if ($vbulletin->userinfo['fieldX'] == "Mujer") { $activateid = build_user_activation_id($userid, (($vbulletin->options['moderatenewmembers'] OR $vbulletin->GPC['coppauser']) ? 4 : 16), 0); } else { $activateid = build_user_activation_id($userid, (($vbulletin->options['moderatenewmembers'] OR $vbulletin->GPC['coppauser']) ? 4 : 2), 0); }
eval(fetch_email_phrases('activateaccount'));
vbmail($email, $subject, $message, true); }
NOTE: Again, where is the X put the number of field of field of user profile created
Aca says the number of the field:
This line is the X
PHP Code:
if ($vbulletin->userinfo['fieldX'] == "Mujer")
5_ Al and have edited the register.php , there is only replaced by that of his board, and ready, at the time of registration, if they choose the women will have group sex user in this case would be if women and men choose will have the default is the user group man.
For those it's not working, he missed one modification detail in the coding on the last step if using email verification:
PHP Code:
if ($vbulletin->userinfo['fieldX'] == "Mujer")
{
$activateid = build_user_activation_id($userid, (($vbulletin->options['moderatenewmembers'] OR $vbulletin->GPC['coppauser']) ? 4 : 16), 0);
}
1) Where 'fieldX' is, change the X to your field code on the registration form
2) Where "Mujer" is, change that to your criteria of your form (in his example 'Women')
3) Where the query coding says "? 4: 16), 0);", change the 16 to your usergroupid number which you wish them to go to.
He failed to mention to identify the usergroupid stated in step 3 there.
I have successfully installed this on my VB 4.2 patch level 2. If some one needs this to be done, let me know, I can help. Just post your fieldid, usergroup ids, title of the custom field. I would give you the exact code and you can easily install it.
If you need to see a live, then ask me... I have included 3 usergroup on register page.