Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Select Usergroup on registration Details »»
Select Usergroup on registration
Version: 1.00, by lympboy lympboy is offline
Developer Last Online: Jan 2013 Show Printable Version Email this Page

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']) ? 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:


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!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:

Comments
  #2  
Old 07-28-2011, 09:26 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is an easier way to do this without any file edits at all.
Reply With Quote
  #3  
Old 07-29-2011, 01:37 AM
Preech Preech is offline
 
Join Date: Aug 2002
Location: Fort Campbell
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Boofo, can you shed any light on how to do it without editing the php files.
Reply With Quote
  #4  
Old 07-29-2011, 04:44 AM
nacaruncr nacaruncr is offline
 
Join Date: Nov 2010
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

tagged + installed + 5 stars + MOTM

thanks men
Reply With Quote
  #5  
Old 07-29-2011, 08:32 PM
Preech Preech is offline
 
Join Date: Aug 2002
Location: Fort Campbell
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 08-01-2011, 08:20 PM
cloferba cloferba is offline
 
Join Date: Apr 2009
Posts: 437
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo View Post
There is an easier way to do this without any file edits at all.
and which is that way?
Reply With Quote
  #7  
Old 08-01-2011, 09:03 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The "Boofo did a mod for a client" way.
Reply With Quote
  #8  
Old 08-02-2011, 01:35 AM
Juggernaut Juggernaut is offline
 
Join Date: Dec 2009
Location: California
Posts: 589
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo View Post
The "Boofo did a mod for a client" way.
That means that this is the next best thing.
Reply With Quote
  #9  
Old 08-02-2011, 02:08 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sure, no doubt. I would use it if I needed it and I hadn't done one.
Reply With Quote
  #10  
Old 10-19-2011, 02:55 AM
SEW810's Avatar
SEW810 SEW810 is offline
 
Join Date: Mar 2008
Location: M?xico City
Posts: 274
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:52 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05157 seconds
  • Memory Usage 2,348KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (7)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete