![]() |
|
Mod Options |
![]() |
|||||||||||||||||||||||||||
Add User to Primary Usergroup Based on Value of Custom Profile Field
![]() Developer Last Online: Nov 2013 ![]() ![]() ![]() This modification is in the archives.
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.
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
to:
And, finally, change the usergroup as appropriate. Instead of 10 in this line:
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
No members have liked this post.
|
![]() |
||||
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
|
|||
|
|||
![]()
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 No members have liked this post.
|
#47
|
||||
|
||||
text fields will work as well.
__________________
amykhar.com ---------------------------------------- I do not respond to PM requests for coding assistance. No members have liked this post.
|
#48
|
||||
|
||||
amykhar, you wrote:
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) ![]() No members have liked this post.
|
#49
|
|||
|
|||
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". No members have liked this post.
|
#50
|
||||
|
||||
It's possible to do it, just not with this mod.
__________________
amykhar.com ---------------------------------------- I do not respond to PM requests for coding assistance. No members have liked this post.
|
#51
|
|||
|
|||
If I use moderated public groups, the user is active in this group without moderation. Is there a workaround?
No members have liked this post.
|
#52
|
||||
|
||||
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. No members have liked this post.
|
#53
|
||||
|
||||
Originally Posted by amykhar
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...
No members have liked this post.
|
#54
|
||||
|
||||
Script
Hey.
![]()
Talk to you later, Paul F No members have liked this post.
|
#55
|
||||
|
||||
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. No members have liked this post.
|
#56
|
|||
|
|||
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 No members have liked this post.
|
#57
|
||||
|
||||
Originally Posted by paulfletcher
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. No members have liked this post.
|
#58
|
||||
|
||||
![]()
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:
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?! No members have liked this post.
Last edited by ThePiston; 19 Jun 2006 at 22:21. |
#59
|
|||
|
|||
This installed beautifully, Amy! I'm all about automation and this cuts down on quite a bit of work for me. Thank you!
No members have liked this post.
|
#60
|
||||
|
||||
happy to be of service
![]()
__________________
amykhar.com ---------------------------------------- I do not respond to PM requests for coding assistance. No members have liked this post.
|
![]() |
«
Previous Mod
|
Next Mod
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Mod Options | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 15:13.