vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Integration with vBulletin - Select Usergroup on registration (https://vborg.vbsupport.ru/showthread.php?t=267585)

lympboy 07-27-2011 10:00 PM

Select Usergroup on registration
 
1 Attachment(s)
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:
https://vborg.vbsupport.ru/

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.
http://img5.imageshack.us/img5/2558/mujerpk.jpg

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']) ? 2), 0);

                eval(
fetch_email_phrases('activateaccount'));

                
vbmail($email$subject$messagetrue);

            } 

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']) ? 16), 0);
                }
                else
                {    
                    
$activateid build_user_activation_id($userid, (($vbulletin->options['moderatenewmembers'] OR $vbulletin->GPC['coppauser']) ? 2), 0);
                }

                eval(
fetch_email_phrases('activateaccount'));

                
vbmail($email$subject$messagetrue);
            } 


NOTE:
Again, where is the X put the number of field of field of user profile created
Aca says the number of the field:
https://vborg.vbsupport.ru/

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.

Credits: 3xtr4 3xtr4
Example

Sorry my english!

Boofo 07-28-2011 09:26 PM

There is an easier way to do this without any file edits at all.

Preech 07-29-2011 01:37 AM

Boofo, can you shed any light on how to do it without editing the php files.

nacaruncr 07-29-2011 04:44 AM

tagged + installed + 5 stars + MOTM :D

thanks men :D

Preech 07-29-2011 08:32 PM

This is definitely something I'm looking forward to. But I don't want to have to do this every time I decide to update to the newest version.

cloferba 08-01-2011 08:20 PM

Quote:

Originally Posted by Boofo (Post 2226206)
There is an easier way to do this without any file edits at all.

and which is that way?

Boofo 08-01-2011 09:03 PM

The "Boofo did a mod for a client" way. ;)

Juggernaut 08-02-2011 01:35 AM

Quote:

Originally Posted by Boofo (Post 2227885)
The "Boofo did a mod for a client" way. ;)

That means that this is the next best thing. :D

Boofo 08-02-2011 02:08 AM

Sure, no doubt. I would use it if I needed it and I hadn't done one. ;)

SEW810 10-19-2011 02:55 AM

Jesus, I know this is pretty easy to edit but crap!!!,it didn't work form me.

I've edited my register.php file with the correct fieldid and usergroupid stuff but nothing happends :( , New users always go to usergroup 2


All times are GMT. The time now is 04:09 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01190 seconds
  • Memory Usage 1,776KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (7)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete