Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
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
Mod Version: 1.00, by amykhar (Member) amykhar is offline
Developer Last Online: Nov 2013 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.5.0 Beta 1 Rating: (10 votes - 5.00 average) Installs: 59
Released: 13 Jun 2005 Last Update: Never Downloads: 249
Not Supported Uses Plugins  

This version is for the PRIMARY group. Here is the one for secondary groups:

http://www.vbulletin.org/forum/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.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

If, for example, you want to check the value of field6, change field5 in the XML file to field6. If you are looking for "male" instead of "yes", change

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

to:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

And, finally, change the usergroup as appropriate. Instead of 10 in this line:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

substiture your usergroupid of choice.

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

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Add User to Secondary Usergroup Based on the Value of a Custom Profile Field at Reg. amykhar vBulletin 3.5 Add-ons 133 01 Jan 2013 15:06

  #106  
Old 03 Feb 2008, 00:29
vbob vbob is offline
 
Join Date: Jan 2008
Will it Work in 3.6.8???

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). :-)
__________________
www.madseeds.com

Last edited by vbob; 03 Feb 2008 at 00:35.
Reply With Quote
  #107  
Old 11 Feb 2008, 19:42
Demo16 Demo16 is offline
 
Join Date: Sep 2006
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
Reply With Quote
  #108  
Old 16 Feb 2008, 10:15
Demo16 Demo16 is offline
 
Join Date: Sep 2006
it doesn't work for me, any help?
Reply With Quote
  #109  
Old 26 Mar 2008, 23:01
wtrk wtrk is offline
 
Join Date: Jun 2005
is there a way to move people who have already answered the question?
Reply With Quote
  #110  
Old 15 May 2008, 15:41
WNM07 WNM07 is offline
 
Join Date: Aug 2007
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?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #111  
Old 24 May 2008, 11:04
Conner85 Conner85 is offline
 
Join Date: Jan 2008
Someone needs to update this for 3.7 Gold. It's causing registration errors for my users.
Reply With Quote
  #112  
Old 27 May 2008, 03:55
oz_girl's Avatar
oz_girl oz_girl is offline
 
Join Date: Mar 2008
This is perfect for my forums but is this 3.7 Gold compatible?
Reply With Quote
  #113  
Old 28 May 2008, 11:02
oz_girl's Avatar
oz_girl oz_girl is offline
 
Join Date: Mar 2008
Anyone using this successfully on 3.7 gold or 3.7.1??
Reply With Quote
  #114  
Old 07 Jun 2008, 02:40
jpapadpapa jpapadpapa is offline
 
Join Date: Feb 2008
I, too, really need this for 3.7.1!
Reply With Quote
  #115  
Old 04 Sep 2008, 19:42
steven s's Avatar
steven s steven s is offline
 
Join Date: Aug 2004
Originally Posted by oz_girl View Post
Anyone using this successfully on 3.7 gold or 3.7.1??
Originally Posted by jpapadpapa View Post
I, too, really need this for 3.7.1!
Just installed it on v3.7.3.

THANKS!
This is the answer I've been looking for.
It will automatically ban my spammers.

Edit: Also works on 3.7.4 p1
__________________
...steven
www.318ti.org
forum.nccbmwcca.org

Last edited by steven s; 24 Dec 2008 at 01:11.
Reply With Quote
  #116  
Old 02 Nov 2008, 13:29
steven s's Avatar
steven s steven s is offline
 
Join Date: Aug 2004
This is an old one but I love it.
Spammers usually enter the same number into my location profile field.
Bam, automatic ban. Just banned two more.
They have gotten past answering questions which I'm sure stops a few, and this mod is just another measure.
__________________
...steven
www.318ti.org
forum.nccbmwcca.org
Reply With Quote
  #117  
Old 23 Dec 2008, 21:40
YESS YESS is offline
 
Join Date: Nov 2008
Thank you!

Thank you Amy this is exactly what my client needed to perfect their forums.

Now all I need to do is learn how to do something like this with a cron job so that users who are already registered can choose something in their profile to 'upgrade' their account and set their primary usergroup.
Reply With Quote
  #118  
Old 24 Dec 2008, 01:22
YESS YESS is offline
 
Join Date: Nov 2008
Cron job to accomplish same task without the process registration bit.

There we go, I went ahead and wrote a Scheduled Task that every 10 minutes would check for anybody in the primary group 'Registered users' with the custom profile field9 set to 'Yes' and move them to usergroup 9, and vice versa. Sorry in advance for unclean code and please don't hate.

Place the code in the box below in a .php script in your /includes/cron folder and create a new scheduled task pointing to that script.

Replace 'field9' with the field you want to check. Replace 'Yes' and 'No' with the values of your field9 option.

Replace 'New member' and 'Introductory grower/distributor' with your chosen user titles.

Replace the usergroup numbers 2(Registered member) and 9(Custom usergroup) on the MySQL queries with the numbers of the usergroups you want to migrate to and from.

Sorry I can't go into more detail, sort of in a hurry to get this job done for my client. I don't recommend attempting this if you are not comfortable editing SQL queries.

Be sure to test this out on your forums using the 'Run now' option from the Scheduled Tasks section of the control panel, if you have messed up the syntax at all the control panel should return an error and send a copy of the error to the board owner via email.

I recommend backing up your databases before trying this out just in case you do something wrong, I don't hold any responsibility for lost or corrupt data in your database.

P.S. I recommend putting a notice in your custom usergroup description letting the user know that it can take up to 10 minutes for the changes to take effect to avoid confusion. (Or whatever interval you set your scheduled task job to.)


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #119  
Old 21 Jan 2009, 16:44
forexforum forexforum is offline
 
Join Date: Sep 2008
Hi there,

Does it work on the latest vB 3.8? I need this. Thank you all.
Reply With Quote
  #120  
Old 29 Mar 2009, 19:09
amjadz4's Avatar
amjadz4 amjadz4 is offline
 
Join Date: Aug 2007
i need this for the latest vb too!! can you please update it!!
thanks!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 06:54.

Layout Options | Width: Wide Color: