Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Add User to Secondary Usergroup Based on the Value of a Custom Profile Field at Reg. Details »
Add User to Secondary Usergroup Based on the Value of a Custom Profile Field at Reg.
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: (3 votes - 4.67 average) Installs: 55
Released: 13 Jun 2005 Last Update: 13 Jun 2005 Downloads: 181
Not Supported Uses Plugins  

This version is for the SECONDARY group. The one for primary groups is here:

http://www.vbulletin.org/forum/showthread.php?t=82992

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 secondary user group based on that selection.

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 you are checking field10 instead of field5, change all references of field5 to field10.

Example: if you are checking your field to see if the value is male, you would change (change field number as needed):


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.

And in this line as well,

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

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.
----------------
Example Gender Mod that separates users into secondary groups based on their gender. Don't forget, the values are case sensitive and the field numbers and usergroup numbers need to be changed to suit your site's setup.


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

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 Primary Usergroup Based on Value of Custom Profile Field amykhar vBulletin 3.5 Add-ons 129 22 Dec 2013 17:06

Comments
  #2  
Old 13 Jun 2005, 07:19
djr's Avatar
djr djr is offline
 
Join Date: Nov 2001
Real name: Jean-Paul
Ooooooooooooh! This is so great. I'm not running vB3.5 yet, so if you could make this for vB 3.07??? Please Amy? (begging). If there's already a hack, I'd be much obliged with a pointer.
Reply With Quote
  #3  
Old 14 Jul 2005, 16:29
Cyricx Cyricx is offline
 
Join Date: Sep 2002
Would it be possible to use this code to check their and thereby age?

Like I have an 18+ forum that I use a secondary usergroup to control access to.
__________________
Cyricx (Chris)
Reply With Quote
  #4  
Old 14 Jul 2005, 16:33
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Real name: Amy
Originally Posted by Cyricx
Would it be possible to use this code to check their and thereby age?

Like I have an 18+ forum that I use a secondary usergroup to control access to.
Yes, you could use this basic structure. It wouldn't check the value of the userfield. It would do the math on their age.

Amy
__________________
amykhar.com
----------------------------------------
I do not respond to PM requests for coding assistance.
Reply With Quote
  #5  
Old 15 Jul 2005, 00:23
merk merk is offline
 
Join Date: Nov 2001
Real name: Tim
It would be nice if you could also hook the usercp pages so if they change an option the usergroups that were assigned at registration would also change.

Other than that, nice plugin
Reply With Quote
  #6  
Old 15 Jul 2005, 03:07
Brinnie's Avatar
Brinnie Brinnie is offline
 
Join Date: Jul 2005
Hello,

Would you be so kind as to give an example of how this mod might be used? I am looking to do something with my usergroups (see attachment) but I don't know if I need this mod or the primary group mod.

Thanks a million.

Brinnie
Attached Images
File Type: gif example.gif (6.9 KB, 227 views)
Reply With Quote
  #7  
Old 15 Jul 2005, 03:09
Brinnie's Avatar
Brinnie Brinnie is offline
 
Join Date: Jul 2005
Originally Posted by merk
It would be nice if you could also hook the usercp pages so if they change an option the usergroups that were assigned at registration would also change.

Other than that, nice plugin
That's what I was just wondering.
If I install this, would my members be able to cross party lines?
Reply With Quote
  #8  
Old 15 Jul 2005, 03:11
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Real name: Amy
Originally Posted by merk
It would be nice if you could also hook the usercp pages so if they change an option the usergroups that were assigned at registration would also change.

Other than that, nice plugin
I'll see what I can do.

Amy
__________________
amykhar.com
----------------------------------------
I do not respond to PM requests for coding assistance.
Reply With Quote
  #9  
Old 15 Jul 2005, 03:51
Brinnie's Avatar
Brinnie Brinnie is offline
 
Join Date: Jul 2005
no love 4 my question?
Reply With Quote
  #10  
Old 15 Jul 2005, 03:59
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Real name: Chris Murphy, BSc
Originally Posted by Brinnie
no love 4 my question?
You asked it in the wrong place - Ask it in the "vBulletin Modification Questions" forum for vB 3.5.0 or the "General Modification Discussion" for 3.0.x depending on which forum you want it to run on

Satan

Last edited by hellsatan; 15 Jul 2005 at 04:05.
Reply With Quote
  #11  
Old 15 Jul 2005, 04:06
Brinnie's Avatar
Brinnie Brinnie is offline
 
Join Date: Jul 2005
Originally Posted by hellsatan
You asked it in the wrong place - Ask it in the "vBulletin Modification Questions" forum for vB 3.5.0 or 3.0.x depending on which forum you want it to run on

Satan
oh ok. I'm a n00b, I don't know these things.

Do I need to entitle it: " Add User to Secondary Usergroup Based on the Value of a Custom Profile Field at Reg."?
Reply With Quote
  #12  
Old 15 Jul 2005, 04:10
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Real name: Chris Murphy, BSc
Originally Posted by Brinnie
oh ok. I'm a n00b, I don't know these things.

Do I need to entitle it: " Add User to Secondary Usergroup Based on the Value of a Custom Profile Field at Reg."?
No - Reeve of Shinra has provided one way of doing it, here

If you decide to do it that way, you will only require the use of one of the hacks by amy

If you decide to do it via custom code, you will need to ask

Satan
Reply With Quote
  #13  
Old 15 Jul 2005, 04:35
Brinnie's Avatar
Brinnie Brinnie is offline
 
Join Date: Jul 2005
Originally Posted by hellsatan
No - Reeve of Shinra has provided one way of doing it, here

If you decide to do it that way, you will only require the use of one of the hacks by amy

If you decide to do it via custom code, you will need to ask

Satan
Do you know which one of these hacks would be better?
Reply With Quote
  #14  
Old 15 Jul 2005, 04:37
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Real name: Chris Murphy, BSc
Originally Posted by Brinnie
Do you know which one of these hacks would be better?
It depends whether you want the user to be moved into a different Primary Group or added to a Secondary Group

Satan
Reply With Quote
  #15  
Old 01 Aug 2005, 22:14
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Real name: Anton Kanevsky
Nice hack. A few suggestions:

1. Make it configurable from admincp.
2. Replace


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

With


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

__________________
I can no longer support any of my hacks. Please do not contact me for that. Feel free to create and post new versions of my hacks, as long as you give me credit for the original work.
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 08:40.

Layout Options | Width: Wide Color: