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

SEW810 10-22-2011 05:22 AM

Uninstalled... err.... unedited... lol
whatever

vBNinja 11-19-2011 06:16 PM

Does this work with 4.1.X ?

Merenguista 11-20-2011 06:55 PM

thanks .. great job !

vBNinja 11-20-2011 07:01 PM

Quote:

Originally Posted by Merenguista (Post 2270036)
thanks .. great job !

Did you already do it and is it working??

Wild Bronco 11-20-2011 10:56 PM

Something like this to let new users see a list of social groups to join would be interesting :)

Boofo 11-20-2011 11:08 PM

Quote:

Originally Posted by Geiri (Post 2270127)
Something like this to let new users see a list of social groups to join would be interesting :)

That would be very easy to do. Look at the code. ;)

Merenguista 11-24-2011 02:22 PM

Quote:

Originally Posted by ivant (Post 2270039)
Did you already do it and is it working??

I honestly have not tried :D

grey_goose 12-08-2011 12:44 AM

You're so cool Boofo. That's awesome you can do all this stuff that you like to tell people about.

Seriously, though, what's the point of saying "nyah nyah I did it but I'm not telling" ? It's not constructive.

Boofo 12-08-2011 12:56 AM

Quote:

Originally Posted by grey_goose (Post 2275733)
You're so cool Boofo. That's awesome you can do all this stuff that you like to tell people about.

Seriously, though, what's the point of saying "nyah nyah I did it but I'm not telling" ? It's not constructive.

My point was that is can be done as a product, without any file edits.

vBNinja 12-22-2011 01:32 AM

just tried it, didnt work...
maybe it's because i have confirmation emails disabled?

rophi60 04-08-2012 07:40 PM

just tried it, didnt work... :(

Crystal Shards 05-28-2012 05:14 PM

Quote:

Originally Posted by Boofo (Post 2275738)
My point was that is can be done as a product, without any file edits.

But if that product is unavailable, it's not of any use to anyone who can't make them. So really, it's still not constructive.

Boofo 05-28-2012 05:23 PM

Quote:

Originally Posted by vBNinja (Post 2279924)
just tried it, didnt work...
maybe it's because i have confirmation emails disabled?

Yes, that would be the cause.

Boofo 05-28-2012 05:25 PM

Quote:

Originally Posted by Crystal Shards (Post 2333949)
But if that product is unavailable, it's not of any use to anyone who can't make them. So really, it's still not constructive.

You're right. I digress.

FTG LIQUID CL 05-31-2012 09:15 PM

any chance you would share boofo

Cognitio 06-29-2012 12:05 AM

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

raghhav 10-22-2012 11:44 AM

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.

grey_goose 10-23-2012 07:09 PM

field117
usergroup 50
Character

raghhav 10-23-2012 07:22 PM

Quote:

Originally Posted by grey_goose (Post 2375446)
field117
usergroup 50
Character

Character is the title name?

grey_goose 10-23-2012 07:33 PM

yeppers, it's an option in field117

Manoel J?nior 10-23-2012 11:14 PM

Please, send we code used for this!!!

Fluke667 01-29-2013 05:25 PM

Nice it works on vb3.8 too :)

tareqbd 01-31-2013 01:55 PM

Changes need for vb 4.2, may any coder help please?

Manoel J?nior 02-02-2013 11:40 PM

Please!! update for vb 4.2

orionpk2 03-06-2013 01:42 PM

Hi all. I have been following the various instructions, but I can not make it work in version 4.2

I need help, I think we want to compare the variable is not correct any ideas?

Also it seems that the value stored in the variable is numeric, not alphanumeric. Thanks in advance

pepin_bcn 03-14-2013 02:59 AM

I followed the instructions and does not work. :(

Please!! update for vb 4.2 Level 3

Thanks.

Muhammad Rahman 08-30-2013 02:34 AM

no working on vBulletin 4.2.1 ...

tpearl5 04-28-2014 09:34 PM

if anyone needs this please contact me


All times are GMT. The time now is 07:14 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.02343 seconds
  • Memory Usage 1,843KB
  • 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
  • (8)bbcode_php_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (38)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete