vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Registration [custom userfield] (https://vborg.vbsupport.ru/showthread.php?t=192763)

radekarc 10-05-2008 01:38 PM

Registration [custom userfield]
 
Welcome!
I have a problem.

I added the required field for users.
Type: Single-Selection Menu
Values:
Male
Female

I want to set that when you choose to register after the female - a new user to automatically save the group id 9

Here is an modification of their file, but it does not work. Moves to a group of 9 all new users (including those who select 'Male').

Please help ...

With Thanks

File: register.php
Version: 3.7.3 PL1
Line: 345
PHP Code:

// assign user to usergroup 3 if email needs verification
    
if ($vbulletin->options['verifyemail'])
    {
        
$newusergroupid 3;
    }
    else if (
$vbulletin->options['moderatenewmembers'] OR $vbulletin->GPC['coppauser'])
    {
        
$newusergroupid 4;
    }
    else if (
$vbulletin->userfield["field5"] = 2)
    {
        
$newusergroupid 9;
    }
    else
    {
        
$newusergroupid 2;
    }
    
// set usergroupid
    
$userdata->set('usergroupid'$newusergroupid); 

//edit
I tried it with:
PHP Code:

else if ($vbulletin->GPC['userfield["field5"]'] = 2

but does not work :(

Dismounted 10-06-2008 05:43 AM

Last time I looked at register.php, it should be:
PHP Code:

$vbulletin->GPC['userfield']['field5'


radekarc 10-06-2008 06:42 AM

YEAH!! I did it :D
Thank you very much, Dismounted

Correct code:
PHP Code:

// assign user to usergroup 3 if email needs verification
    
if ($vbulletin->options['verifyemail'])
    {
        
$newusergroupid 3;
    }
    else if (
$vbulletin->options['moderatenewmembers'] OR $vbulletin->GPC['coppauser'])
    {
        
$newusergroupid 4;
    }
    else if (
$vbulletin->GPC['userfield']['field5'] == 2)
    {
        
$newusergroupid 9;
    }
    else
    {
        
$newusergroupid 2;
    } 



All times are GMT. The time now is 05:00 AM.

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.01364 seconds
  • Memory Usage 1,728KB
  • 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
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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