Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-26-2005, 12:37 AM
rrr rrr is offline
 
Join Date: Oct 2004
Location: California
Posts: 132
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 01-26-2005, 12:42 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 01-26-2005, 01:39 AM
rrr rrr is offline
 
Join Date: Oct 2004
Location: California
Posts: 132
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 01-26-2005, 01:42 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So you want to change their primary usergroup or have 9/10 as an additional usergroup?
Reply With Quote
  #5  
Old 01-26-2005, 04:40 AM
rrr rrr is offline
 
Join Date: Oct 2004
Location: California
Posts: 132
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 01-27-2005, 01:57 AM
jzewatsky jzewatsky is offline
 
Join Date: Nov 2004
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 01-27-2005, 02:27 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@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' 
Reply With Quote
  #8  
Old 01-27-2005, 02:41 AM
rrr rrr is offline
 
Join Date: Oct 2004
Location: California
Posts: 132
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #9  
Old 01-27-2005, 02:44 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 01-27-2005, 05:01 AM
rrr rrr is offline
 
Join Date: Oct 2004
Location: California
Posts: 132
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, that worked perfectly
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 05:51 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.04133 seconds
  • Memory Usage 2,259KB
  • Queries Executed 11 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (7)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)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
  • 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