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 |
#102
|
|||
|
|||
please, could somebody help me
any moderators/coders? |
#103
|
||||
|
||||
I have imported this into 3.6.8 after the making the changes but my test users aren't being put into the correct groups based on their registration field selection.
Can anyone help? This is a fresh install of vb and I have done the necessary changes as outlined in the instructions here? If I can get it working it would save me a lot of work, Thanks |
#104
|
|||
|
|||
Can someone write cron something like this?
I mean automatic move to an usergroup if that user is Female? Thanks |
#105
|
|||
|
|||
How can I do this with this mod.....
Spammers 99% of the time put a url in my FULL NAME field, and I would like to use this mod if possible. I installed it, and want any user that enters "http" in the FULL NAME field to be moved to the banned usergroup. This is the code I'm using but it doesn't work: HTML Code:
// Get the value for field 6 $user = $db->query_first(" SELECT field6 FROM " . TABLE_PREFIX . "userfield WHERE userid = " . $vbulletin->userinfo['userid'] . " "); if ($user['field6'] == 'http') { $userdata->set('usergroupid', 8); } |
#106
|
|||
|
|||
Is this still be supported? I tried installing on the board with no luck. 3.6.8pl2. Anyone?
|
#107
|
|||
|
|||
Hi, It seems that you've got a very interesting mod here. :-)
I have Vbulletin 3.6.8 Patch Level 2 and vBadvanced CMPS v3.0 RC2 installed to my forum. Will it work to my forum or it works only with 3.5.x??? Should I try it?? Can you provide us with a 3.6.8 version that works for sure? (I haven't try it yet...because I am waiting for your answer first). :-) |
#108
|
|||
|
|||
Can I use this mod to do this: all users that have EN language are automatically moved to usergroup: en_users
can I do this? I have also Vbulletin 3.6.8 Patch Level 2 |
#109
|
|||
|
|||
it doesn't work for me, any help?
|
#110
|
|||
|
|||
is there a way to move people who have already answered the question?
|
#111
|
|||
|
|||
i would like to incorporate this into my postbit using this as a base so that the admin can change the users primary usergroup from the postbit .. can't figure out how any idea?
PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|