Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #1  
Old 12-05-2004, 02:43 PM
ataraxia's Avatar
ataraxia ataraxia is offline
 
Join Date: May 2004
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default HOW DO I automatically add someone to a Usergroup based on a Profile field?

HOW DO I automatically add someone to a Usergroup based on a Profile field?

For example, if I have a single choice Profile field for, say, "Gender" with possible responses of "Male", "Female" and "Other", is there some way they could automatically be added as an "additional" member to my corresponding "male", "female" or "other" usergroup?

(A 2nd, related question is how do I update my existing users based in this?)

Thanks
Reply With Quote
  #2  
Old 12-07-2004, 02:57 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ataraxia
bump
Do you mean at registration?
Reply With Quote
  #3  
Old 12-07-2004, 02:59 PM
ataraxia's Avatar
ataraxia ataraxia is offline
 
Join Date: May 2004
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by amykhar
Do you mean at registration?

Yes

(Plus I also need to update all of my exisiting userrs, as well.)
Reply With Quote
  #4  
Old 12-07-2004, 03:40 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ataraxia
Yes

(Plus I also need to update all of my exisiting userrs, as well.)
If you require users to activate emails, the code you are looking for in register.php is here:

Code:
		if ($userinfo['coppauser'] OR ($vboptions['moderatenewmembers'] AND !$userinfo['posts']))
		{
			// put user in moderated group
			$user['usergroupid'] = 4;
		}
		if (empty($user['usergroupid']))
		{
			$user['usergroupid'] = 2; // sanity check
		}
If you are going to change their primary group, simply add:
Code:
   if ($userfield['field16']=='yes') // change this to suit you
		{
		   $user['usergroupid'] = 12;  // change this to suit you.
		}

If you want to add them to a secondary group, the code will be different, but it will go in the same area.
Reply With Quote
  #5  
Old 12-07-2004, 04:01 PM
ataraxia's Avatar
ataraxia ataraxia is offline
 
Join Date: May 2004
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
if ($userfield['field16']=='yes') // change this to suit you
		{
		   $user['usergroupid'] = 12;  // change this to suit you.
		}
Thanks, Amy

This looks close but I need to add the user to an "additional" usergroup, not as a primary one.

What code would you use to add a user to an additional (secondary) group. (the user may also belong to several other additional groups.)

Thanks
Reply With Quote
  #6  
Old 12-29-2004, 12:54 PM
error_22 error_22 is offline
 
Join Date: Nov 2004
Location: Stockholm, Sweden
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is great, I rellay needed this, but there semms to be a problem....It simply doesn't work. Any ideas amykhar?
Reply With Quote
  #7  
Old 12-30-2004, 06:48 PM
error_22 error_22 is offline
 
Join Date: Nov 2004
Location: Stockholm, Sweden
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone?
Reply With Quote
  #8  
Old 01-07-2005, 12:27 AM
steven s's Avatar
steven s steven s is offline
 
Join Date: Aug 2004
Location: Greenville, SC
Posts: 572
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Funny, I searched for the exact subject as I need something like this too.
My variation would be if my exttra profile field is a number from 1 to 6 digits or starts with an M or A or LIFE plus 1-6 digits they are placed in their own usergroup which can be a primary group.
Reply With Quote
  #9  
Old 02-22-2005, 06:19 AM
error_22 error_22 is offline
 
Join Date: Nov 2004
Location: Stockholm, Sweden
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump
Reply With Quote
  #10  
Old 03-08-2006, 02:42 PM
mustang_lex mustang_lex is offline
 
Join Date: May 2005
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

"other" ?????
Reply With Quote
Reply

Thread Tools
Display Modes

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 07:31 AM.


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.04264 seconds
  • Memory Usage 2,251KB
  • Queries Executed 13 (?)
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
  • (3)bbcode_code
  • (3)bbcode_quote
  • (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_postinfo_query
  • fetch_postinfo
  • 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