vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=325175

Auto-Select Usergroup Based On Profile Field(s)
by MarkFL
01 Jun 2017 03:21

2 Attachment(s)
This product is in response to a request posted by RaYdeN.ADM here:

Auto-select usergroup depending on registration option?

Overview:

This product allows you to designate one or more of your profile fields as deciding which primary usergroup a user will be assigned. This can be done at registration and/or profile change (whether by user or admin).

To define any profile fields, in the setting labeled "Profile Field Definitions," enter the definition for each profile field on a separate line in the following format:

fieldX|Value1_1,...,Value1_n:usergroupid1|...|Value1_m,...,Valuen_m:usergroupidm

X is the number of the custom profile field you wish to use at registration/profile change to determine the new user's primary usergroup. If you wish to move all users not matching any of the given choices to a usergroup, then use "[other]" as the last choice.

Note: The first field value a user matches will determine their new usergroup, so ordering matters. List the definitions from most to least important.

For example, suppose you have a profile field (field10) that allows/requires your users to specify their favorite music group/performer. You could use the definition:

field10|Rush:6|Judas Priest,Iron Maiden,Korn:5|Justin Beiber:8|[other]:2

Any user choosing "Rush" would be an administrator, those choosing Judas Priest, Iron Maiden, or Korn would be super moderators, those choosing Justin Beiber would be banned, and any other choice would put them into the registered users group. Without the "[other]" option as a fallback, a user who has chosen for example "Rush" initially, and then later changes their choice to an choice not accounted for in your definition, such as Lady Gaga, would remain an administrator...and we wouldn't want that! So, if you are using profile changes as a trigger, and a user can edit this field, the "[other]" option is useful.

Compatibility:

Tested and working on VB 4.2.x and may work on all 4.x versions of vBulletin.

Backup/Warning:

This product does not alter the structure of your database, however it is always good practice to make regular backups and you should make a backup before installing ANY new product.

As always, products are USE AT YOUR OWN RISK. I will provide support and do my best to help but no absolute guarantee is offered.

To Install:
  1. Download and extract the attached .zip file.
  2. Follow AdminCP -> Plugins & Products -> Manage Products -> Add/Import Product.
  3. Click on "Choose File" and browse to the product .xml file that was packaged in the .zip file.
  4. Click "Import."
  5. You MUST enable the product in the settings before it will function.
  6. Configure the remaining settings to your liking. Each setting has a detailed explanation of its use.

https://www.vbulletin.org/forum/atta...1&d=1496283550

Support for this product can be found here:

RaYdeN.ADM 01 Jun 2017 03:40

Nice, oh thanks for credits :3

grey_goose 01 Jun 2017 14:06

Works like a charm. As usual, you the man!

SilverBoy 05 Jul 2017 02:09

Nice work as always Mark

I want to discus this scenario with you if you don't mind, and unfortunately I don't have a forum online to make a check.

I have a profile field which I want my users to divided to 2 usergroups depending on its value after registration, but the case is when a user complete the registration process, he moved directly to user awaiting email confirmation user group, so I want the user to move to one of these 2 groups after activation, is this possible?

MarkFL 05 Jul 2017 04:40

Quote:

Originally Posted by SilverBoy (Post 2588139)
Nice work as always Mark

I want to discus this scenario with you if you don't mind, and unfortunately I don't have a forum online to make a check.

I have a profile field which I want my users to divided to 2 usergroups depending on its value after registration, but the case is when a user complete the registration process, he moved directly to user awaiting email confirmation user group, so I want the user to move to one of these 2 groups after activation, is this possible?

I'm fairly certain that's what will happen by default. :)

RichieBoy67 05 Jul 2017 07:06

I have a use for this! Thank you Mark!

SilverBoy 06 Jul 2017 01:29

Quote:

Originally Posted by MarkFL (Post 2588140)
I'm fairly certain that's what will happen by default. :)

Thank you Mark


All times are GMT. The time now is 15:04.

Powered by vBulletin® Version 3.8.13
Copyright © 2019, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.