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

  #46  
Old 11 Mar 2006, 07:45
paulfletcher paulfletcher is offline
 
Join Date: Jan 2006
Thumbs up 3.5.4

Thanks for getting back to me. I wasn't sure if it still worked for 3.5.4. I'm working on an Activation Code text field that would appear during registration. This would allow for a community license to be issued to a school or company (we will be creating video tutorials).

After talking to other users they suggested that I use the secondary usergroup script that you created, this would allow me to easily demote a group of users back to a normal registered usergroup if needed.

Will your primary or secondary script that you created work with text fields? Or only Radio & Check boxes?

Thanks,
Paul
Reply With Quote
  #47  
Old 11 Mar 2006, 17:15
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Real name: Amy
text fields will work as well.
__________________
amykhar.com
----------------------------------------
I do not respond to PM requests for coding assistance.
Reply With Quote
  #48  
Old 01 Apr 2006, 00:43
trigon trigon is offline
 
Join Date: Dec 2005
amykhar, you wrote:
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

So on my Board i have no email verifycation, can i use this one too, or must i wait until your next variation??
(Btw: I tried but it doesnt go)
Reply With Quote
  #49  
Old 05 Apr 2006, 02:06
harmor19 harmor19 is offline
 
Join Date: Apr 2005
Real name: Andrew Harmor
Is it possible to assign an user to an usergroup depending the value of the profile field after they have registered?

Let me explain.
I run a hosting forum and some members don't even use their hosting account.
I send out an email telling that they haven't used their (sub)domain and that need to reply to the email.
After I send the email I edit their profile and select "Warned" from the drop down list. I also have "Suspended" (from the hosting) and "Terminated".
Reply With Quote
  #50  
Old 05 Apr 2006, 16:15
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Real name: Amy
It's possible to do it, just not with this mod.
__________________
amykhar.com
----------------------------------------
I do not respond to PM requests for coding assistance.
Reply With Quote
  #51  
Old 19 Apr 2006, 23:22
JAV-ISH JAV-ISH is offline
 
Join Date: Mar 2006
If I use moderated public groups, the user is active in this group without moderation. Is there a workaround?
Reply With Quote
  #52  
Old 20 Apr 2006, 00:38
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Real name: Amy
what do mean by moderated public group? A group where the leader must approve the members? This mod is not intended to work with such groups.
__________________
amykhar.com
----------------------------------------
I do not respond to PM requests for coding assistance.
Reply With Quote
  #53  
Old 01 May 2006, 13:30
sepulchres sepulchres is offline
 
Join Date: Apr 2006
Originally Posted by amykhar
what do mean by moderated public group? A group where the leader must approve the members? This mod is not intended to work with such groups.
I'm also getting a parse error when I activate the account of the registered user. It seems that a lot of people are getting the same thing when using this hack. I read that Paul was having similar problems and Amy, you fixed it...But that was in the secondary one. Is there anything I can do to fix mine because it seems to be a similar problem that I am having. Cheers.

btw, I have checked all the userids and options of the custom field. I am using custom groups which are not public and emails must be verified by users. Here is the php code from the plugin...


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

Reply With Quote
  #54  
Old 01 May 2006, 14:18
paulfletcher paulfletcher is offline
 
Join Date: Jan 2006
Script

Hey. Well It was working for the secondary user-group. Although I found out that I needed one for the primary group. So Amykhar helped me out with this slight modification of the script... Works on my board (3.5.4).


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

Talk to you later,
Paul F
Reply With Quote
  #55  
Old 01 May 2006, 14:19
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Real name: Amy
Because this mod requires you to change the code for it to work, you really need to be careful when making the changes. You haven't closed the braces on your first three if clauses, which is what's giving you the parse errors. I'm sorry, but I can't keep fixing these problems on an individual basis here and am referring any further issues to my premium support forum.
__________________
amykhar.com
----------------------------------------
I do not respond to PM requests for coding assistance.
Reply With Quote
  #56  
Old 19 May 2006, 18:18
Tory H Tory H is offline
 
Join Date: Mar 2006
Hi Amy,
I need this mod to read a different field (referrer) rather than profile field.

Basically the user is put into a usergroup based on what field is filled out as referrer (automatically passed from URL). Basically if they are my referral they are top dog permissions because they are somebody who I can trust, if a troll refers them then maybe they get put into a special group.

Will this work do you think?
Thx
Matt
Reply With Quote
  #57  
Old 16 Jun 2006, 05:10
futuredood futuredood is offline
 
Join Date: Jan 2002
Originally Posted by paulfletcher
Hey. Well It was working for the secondary user-group. Although I found out that I needed one for the primary group. So Amykhar helped me out with this slight modification of the script... Works on my board (3.5.4).


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

Talk to you later,
Paul F
I presume this means you can let the user input the actual text in the case "X" area, correct? In that case, can you tell me where I would place this in the XML file?

I plan on having available more usergroups in the future, and would like to have the individual be able to type in the group they are entering (I'd have a link to the possibilities on the registration page).

Also, has their been any changes so that this could work all the time (for example, they can change their usergroup as they like through edit profile)? Thanks.
Reply With Quote
  #58  
Old 19 Jun 2006, 22:02
ThePiston ThePiston is offline
 
Join Date: Jun 2006
Question

can someone post some working, multi-item xml code? I got mine working for multiple raio buttons with the secondary code, but i switched all of those groups to 'non-joinable custom/primary' usergroups and now I get nothing showing up when Iclick the registration email link and I can't get it to work. I've trid every combination i can think of... Ive got the right field, correct spelling and syntax, groups... i think i need to see someone's successful code for a multi-item xml file to compare. tia

this is the code i have now that does not want to work:

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

I tried using all 'if's but that didn't work either... i'm not too hip on PHP, but i should be able to crack this?!

Last edited by ThePiston; 19 Jun 2006 at 22:21.
Reply With Quote
  #59  
Old 30 Jun 2006, 19:18
JazzleBug JazzleBug is offline
 
Join Date: Feb 2004
This installed beautifully, Amy! I'm all about automation and this cuts down on quite a bit of work for me. Thank you!
Reply With Quote
  #60  
Old 30 Jun 2006, 19:51
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Real name: Amy
happy to be of service
__________________
amykhar.com
----------------------------------------
I do not respond to PM requests for coding assistance.
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 11:11.

Layout Options | Width: Wide Color: