• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Select Usergroup on registration

Admin

Well-Known Member
Staff member
Administrator
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:
 [U] Title:[/U]  [B] Select your *** [/B]
[U] Description: [/U] [B]Here you select your *** [/B]
[U] Options:[/U]  [B] Man [/B]
           [B] Women [/B]
[U] Set Default:[/U]  [B] Yes, including a first option blank [/B]
[U] Field editable by the user:[/U]  [B] Just to register [/B]
(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:
if ($vbulletin->options['verifyemail'])
    {
        $newusergroupid = 3;
    }
    else if ($vbulletin->options['moderatenewmembers'] OR $vbulletin->GPC['coppauser'])
    {
        $newusergroupid = 4;
    }
    else
    {
        $newusergroupid = 2;
    }
Replace:
PHP:
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:
fieldrb.jpg

This line is the X
PHP:
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.
mujerpk.jpg

This line is the W
PHP:
$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:
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:
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:
fieldrb.jpg

This line is the X
PHP:
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 *** user in this case would be if women and men choose will have the default is the user group man.
Credits: 3xtr4 3xtr4
Example
Sorry my english!
 

Facebook Comments

Similar threads
Thread starter Title Forum Replies Date
Admin Xenplaza – Select ALL & Clipboard: CODE, PHP, HTML Xenforo 0
Admin Share code tiền tố v3 bản select fixed cho wapka Wap builder, wapego, xtgem, wen.ru, wapka, wap4 0
Admin Sử dụng hàm Select Case PHP 0
Admin Share cách tạo màu select khi copy hay xem bài viết Vbulletin 0
Admin Hướng dẫn thêm nút chọn "select all" cho code, php, html vbb 4.1.x Vbulletin 1
Admin [OzzModz] Usergroup View In ACP Xenforo 0
Admin [Scandal's] Style Usergroup Permissions Add-ons 0
Admin Other Usergroup Display Add-ons 0
blog4me Share Share Mod Chọn Nhóm Khi Đăng Ký (Register Usergroup Choice) Vbulletin 0
Admin Usergroup Legend for vbb5 Add-ons 0
Admin Share How To Set Up A Usergroup And Moderate Their Threads & Posts Vbb tutorial 0
Admin Share Mod Chọn Nhóm Khi Đăng Ký (Register Usergroup Choice) Vbulletin 0
Admin Move Inactive and Lurker Users To New Usergroup Add-ons 0
Admin [OzzModz] Email Staff When New Registration Xenforo 0
Admin Cloudflare Registration Tools vBulletin 4.2.5 Add-ons 0
Admin Country Registration Ban xenforo 2 Xenforo 0
Admin e360 - Intro On Registration Add-ons 0
Admin vBSocial.com Registration Booster (Pro) Add-ons 0
Admin Really Fast Registration by BOP5 Add-ons 0
Admin Anti-spambot: disallow registration if referer page = register.php Add-ons 0
Admin Verifiy Email Before Registration Add-ons 0
L Domain4Post | FREE .com Domain Name for Life Time - Registration Hosting & Domain Free 0
Admin Advanced Registration v1.1.1 for vBulletin v4.1.x PHP NULL-DGT Add-ons 1
Admin VSa - Advanced Registration-mod thêm chức năng phần đăng ký cho vbb 4.x.x Add-ons 1
Admin VSa - Advanced Registration Add-ons 0

Similar threads

New posts New threads New resources

Back
Top