vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Usergroup for new members (https://vborg.vbsupport.ru/showthread.php?t=223441)

matthewhotdude 09-17-2009 03:45 PM

Usergroup for new members
 
I can see how to create a usergroup, But how do I set up what usergroup new members go into?

James Birkett 09-17-2009 03:52 PM

I could be mistaken but I believe it's the register.php file (was looking at it yesterday):
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
    {
        
$newusergroupid 2;
    } 

As you can see , "$newusergroupid = 2" (line 356) is the new usergroup ID, so it could be possible that by changing the integer in this variable to the usergroup ID you want; it should work.


The nearest hook to this location is
PHP Code:

($hook vBulletinHook::fetch_hook('register_addmember_process')) ? eval($hook) : false

which is like 385.

matthewhotdude 09-17-2009 04:33 PM

So I just change this to the usergroup id and thats it

$newusergroupid = 3;

James Birkett 09-17-2009 04:34 PM

I've not tested it but I would guess so.
Feel free to change it and register a test account then see what usergroup they are inserted into; you can always change it back by changing the integer.

matthewhotdude 09-17-2009 04:39 PM

// 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
{
$newusergroupid = 2;
}

So which one am I changing

as I changed the 3 one but it didnt work

James Birkett 09-17-2009 04:41 PM

No, change the 2 to whichever you want.
PHP Code:

if ($vbulletin->options['verifyemail'])
{
$newusergroupid 3// users awaiting e-mail verification
}
else if (
$vbulletin->options['moderatenewmembers'] OR $vbulletin->GPC['coppauser'])
{
$newusergroupid 4// coppa users/if you are moderating new members
}
else
{
$newusergroupid 2// standard usergroup if registration went fine.



HMBeaty 09-17-2009 04:42 PM

you would change the
PHP Code:

$newusergroupid 2


matthewhotdude 09-17-2009 04:52 PM

Works a treat, Thank you


All times are GMT. The time now is 12:18 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.00987 seconds
  • Memory Usage 1,730KB
  • 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
  • (8)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