The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Add User to Primary Usergroup Based on Value of Custom Profile Field Details »» | |||||||||||||||||||||||||||
Add User to Primary Usergroup Based on Value of Custom Profile Field
Developer Last Online: Nov 2013
This version is for the PRIMARY group. Here is the one for secondary groups:
https://vborg.vbsupport.ru/showthread.php?t=82993 As far as plugins goes, this one is an advanced plugin because you WILL need to make some tweaks to suit your needs. What this plugin does: If you have a custom profile field, for example one for gender, it checks to see if the user has selected a specific value and then assigns them to a primary user group based on that selection. This happens at the time the user activates their email account after registering. Instructions for installation: A. Create your custom profile field and make a note of the field number. (Or simply make a note of the field number of an existing field.) B. Make a note of the value you are checking for. For example, you may be looking to see if your member selected "male" in your custom gender field. C. Make a note of the usergroup number that you want to set the user to. D. Here you have two options: Option 1: Edit the attached XML file before you import it to change the field number, the value that you check for and the usergroupid. In my XML file, I am checking field5 to see if the value is yes and changing the usergroup to 10. Code:
<?xml version="1.0" encoding="ISO-8859-1"?> <plugins> <plugin active="1" product="vbulletin"> <title>Put User In User Group Based on Field Value</title> <hookname>register_activate_process</hookname> <phpcode><![CDATA[// Get the value for field 5 $user = $db->query_first(" SELECT field5 FROM " . TABLE_PREFIX . "userfield WHERE userid = " . $vbulletin->userinfo['userid'] . " "); if ($user['field5'] == 'yes') { $userdata->set('usergroupid', 10); }]]></phpcode> </plugin> </plugins> Code:
if ($user['field5'] == 'yes') Code:
if ($user['field5'] == 'male') Code:
$userdata->set('usergroupid', 10); Option 2: Import the XML file as is, open the plugin manager, and make your edits there. NOTE: This mod works for forums that require users to verify their email address upon registration. If your forum does not require users to verify their email address, you will need to use a different hook. If I have time, I'll test that variation. Amy Show Your Support
|
Comments |
#92
|
|||
|
|||
after 2 months of using this with vbulletin v3.6.2 here is what is happening:
- most of the time it is working fine "80% of the time" - sometimes instead of getting the user to the right group it gets him to REGISTERED "15%" - sometimes the user fails to get the activation email "not sure if this is caused by this plug in or not, but this is the ONLY plug in hooked with user_activate_process" "5%" This sample is taken from different 150 different registrations randomly from hotmail/gmail/yahoo/others users. will disable it within 24 hours and wait for another month to see what will happen and if there will be any change in percentages given above. |
#93
|
|||
|
|||
Quote:
Bump!! |
#94
|
|||
|
|||
is there a way to do this to users after they have registered?
how can i force users who have already answered the question into the usergroup? |
#95
|
||||
|
||||
Hey amy.. should this plugin work with NON custom profile fields? ie: default ones?
I have noticed a pattern with certain spambots, they always use 'Man' as field1. Altering the plugin code to the following doesn't seem to work. PHP Code:
|
#96
|
||||
|
||||
any ideas if this works with the latest version ?
|
#97
|
||||
|
||||
Kinda.
Well, 90% of the time for me. |
#98
|
|||
|
|||
Does this mod work in <hookname>register_activate_process</hookname> only?
I don't wanna use email for registration. |
#99
|
|||
|
|||
*notification*
|
#100
|
||||
|
||||
Hey guys,
For those of you interested, a guy has created a modification that will move users to a specified usergroup depending on a profile field selection. For me, when a user registers, they need to select whether they are male or female. Once they have registered, depending on whether they selected male or female, they get moved to the male or female user group i created. You are able to get this mod by sending an email to: hugh@alaweb.com and requesting the 'user profile group modification'. This mod was not made for free, so it will cost you $25.00 US. I have tested it with vb 3.6.5 and it works great, highly recommend! PM me if you want more info. |
#101
|
|||
|
|||
Quote:
Hello, I have made it like this; switch($userinfo['field5']) { case "Male": $userdata->set('usergroupid', 30); break; case "Female": $userdata->set('usergroupid', 29); break; } and added beneath the the plugin Quote:
Thanks for a reply, of any advanced person with this script |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|