vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Allow user to choose usergroup at registration (https://vborg.vbsupport.ru/showthread.php?t=75130)

rrr 01-26-2005 12:37 AM

Allow user to choose usergroup at registration
 
I thought I found the thread on how to do this at vbulletin.com, but it seemed to be missing the final step. I just found out that the reason it was missing the final step was that the standard vbulletin doesn't have a feature like this:

I'd like for my forums to have 2 usergroups (like 'buyers' and 'sellers').

At the registration point, I know I can add a new required field that asks if the person is a seller.

What I don't know is how to take that information (seller = yes) and have it automatically add that user to the 'seller' usergroup.

I'm hoping to have it as automated as possible.

Does a hack like this already exist?

Andreas 01-26-2005 12:42 AM

I did that on my board, but this is pretty custom as it depends on the profile field you are using, etc.
If you can post more information (eg. field number, gorup ids, etc.) I could tell you which changes would be necessary.

rrr 01-26-2005 01:39 AM

Thanks for the help:

I have the custom field in 'field5' as a 'Single-Selection Radio Buttons'. The user can select "yes I am a seller" or "no I'm not a seller".

If they are a seller, they should go in usergroup id9. Otherwise, they should be put in usergroup id10 (or I guess they could be in the default "Registered Users" group id2 if putting them in id10 is too difficult).

If you need any other information, just let me know.

Andreas 01-26-2005 01:42 AM

So you want to change their primary usergroup or have 9/10 as an additional usergroup?

rrr 01-26-2005 04:40 AM

Hmm...I didn't think of that.

I guess I want them all to be "registered users" (the primary usergroup). On top of that, I want them to have 9/10 as an additional usergroup.

I didn't know I could do that.

jzewatsky 01-27-2005 01:57 AM

I've too have been looking for a mod like this for a while. I'd like mine to allow users to select a usergroup from a dropdown menu at the time of registration based on an answer to a custom profile field.

Andreas 01-27-2005 02:27 AM

@rrr
In register.php FIND
PHP Code:

$DB_site->query("
    INSERT INTO " 
TABLE_PREFIX "user 

ABOVE that ADD
PHP Code:

switch ($_POST['field5']) {
  case 
'1':   $secgroup 9;
                              break;
  case 
'2'$secgroup 10;
                              break;


FIND
PHP Code:

reputationlevelidreputationautosubscribebirthdaybirthday_search

REPLACE that with
PHP Code:

reputationlevelidreputationautosubscribebirthdaybirthday_searchmembergroupids

FIND
PHP Code:

'$birthday_search' 

REPLACE that with
PHP Code:

'$birthday_search''$secgroup' 


rrr 01-27-2005 02:41 AM

Thanks! I'm going to give this a try now.

One thing:

PHP Code:

switch ($_POST['field5']) {
  case 
'yes I am a seller':   $secgroup 9;
                              break;
  case 
"no I'm not a seller"$secgroup 10;
                              break;


in the "case" area, the part in between the single quotes should match what I have in the Admin Cp > User Profile Field > Options exactly, correct? With spaces, hyphens, CaSe SENstivity or whatever?

Andreas 01-27-2005 02:44 AM

Yes. I know that it is a bit of pain, but this is how vBulletin stores the data ;)
That's the reason why I used double quotes for the 2nd one - there is a single quote inside.

rrr 01-27-2005 05:01 AM

Thanks, that worked perfectly :)


All times are GMT. The time now is 01:02 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.01676 seconds
  • Memory Usage 1,741KB
  • 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
  • (7)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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