View Full Version : Profile Enhancements - Random Usergroup on Registration
dstruct2k
04-12-2009, 10:00 PM
This is a remake of one of my earlier mods, found here (https://vborg.vbsupport.ru/showthread.php?t=68566).
The original did not support the plugin system, and could not deal with email activation. Now both of these issues have been addressed!
What does this addon do?
This addon will allow admins to set a list of usergroups by usergroupid for new members to be randomly sorted into. You still have to create the usergroups yourself, this addon just sorts people into them.
Why do I want this addon?
If you have any reason to split your members into groups (the first example that comes to mind would be a Harry Potter website) and would like people to be sorted automatically.
Can the system be disabled?
Just disable the addon from your admincp.
Help! I can't find my usergroupid's/this addon doesn't work/I think it ate my cat!
Post your questions here! I'll be glad to assist in any way. Oh, and good luck with the cat. ;)
Changelog
1.0 - Initial release.
1.01 - Bug Fix Release
Fixed issue where "random" was sometimes selecting an invalid usergroup.
Corrected install file to create a setting under Registration Options in vBulletin where the usergroup list could be maintained.1.02 - Bug Fix Release
Corrected errors in setting validation - Please follow the example when entering your settings.
dstruct2k
04-13-2009, 07:32 AM
<i>Reserved.</i>
Jasem
04-13-2009, 03:29 PM
Nice work, thank you!
Installed
Tobes
04-13-2009, 03:37 PM
I have 3.7.2--will this still work? I installed the product, and it says it worked fine, but I can't find where to define which usergroups should be used during the random assignments.
TigerC10
04-13-2009, 04:09 PM
Glad to see my help (https://vborg.vbsupport.ru/showthread.php?p=1790042#post1790042) got this modification added so quickly! :) You've got a problem with your XML file. It should look like this toward the bottom:
<options>
<settinggroup name="register" displayorder="200">
<setting varname="fpx_rndm_usrgrp_list" displayorder="150">
<datatype>free</datatype>
<defaultvalue>2</defaultvalue>
<validationcode><![CDATA[return( preg_match("/^[\d+[\s,]*]+$|^$/", $data) );]]></validationcode>
</setting>
</settinggroup>
</options>
Without the setting/settinggroup in there at all, it would result in the problem Tobes talked about - being unable to alter the settings. This code change adds an option for the random group thing to the registration options and ensures that the list entered is a valid list of numbers separated by commas or spaces (or if they want to disable it they can just enter a blank, this will stop the extra code from running in the plugins which saves on server load - though they can also enter a singular 2).
dstruct2k
04-13-2009, 04:40 PM
I'm certain the XML should've included that... I exported the product in its entirety. I suppose there's a bug with Advanced Product Management then!
Re-upped, update sent to all installed users. Thanks Tiger, I'll be doing more addons of varying difficulty over the next little while and I'll definitely keep you in mind if I get stumped again ;)
TigerC10
04-13-2009, 04:46 PM
I suppose there's a bug with Advanced Product Management then!
Ah ha! So that's why your XML has a problem with mixed newline characters. :) It contains both linux and windows newline characters, which isn't a problem for machines to overlook but with human debugging it's a real pain. At least this modification isn't a very large one. :cool:
dstruct2k
04-13-2009, 04:49 PM
Yeah, I found APM and it's great for building new addons from scratch... But apparently it has its flaws...
dstruct2k
04-13-2009, 04:55 PM
I have 3.7.2--will this still work? I installed the product, and it says it worked fine, but I can't find where to define which usergroups should be used during the random assignments.
Please update to the latest version, this will correct your issues.
PS - It should work on any version of vB that supports hooks in the registration file. If you're curious, open up your register.php file and look for these 2 text blocks:
($hook = vBulletinHook::fetch_hook('register_form_complete' )) ? eval($hook) : false;
($hook = vBulletinHook::fetch_hook('register_activate_proce ss')) ? eval($hook) : false;
If both of these lines already exist in your register.php file, this addon will work fine. You cannot manually add these lines in, they must already exist in your version of vBulletin.
Wseries
04-13-2009, 04:55 PM
I'd like to use this to assign my users to one of two groups randomly, but how would I go about doing that for members who have already registered? Can this mod do that?
Wseries
04-13-2009, 04:57 PM
Also, does anyone know if this mod plays well with the vMail mod?
dstruct2k
04-13-2009, 04:58 PM
This mod will make new users be assigned into randomized groups. I do plan on releasing a script that will assign existing users to new usergroups, but that will probably be a couple days before it's ready. I want to get any bugs worked out of this script before I make any additions to it.
dstruct2k
04-13-2009, 05:00 PM
Also, does anyone know if this mod plays well with the vMail mod?
It should, assuming vMail does its work prior to allowing users to actually be added. This addon would happen 1 step later than vMail.
Tobes
04-13-2009, 05:15 PM
works fabulously!
One question -- it's not automatically giving users the user title, as defined by the usergroup. Is there anyway I can fix that?
TigerC10
04-13-2009, 05:20 PM
One question -- it's not automatically giving users the user title, as defined by the usergroup. Is there anyway I can fix that?
I thought I handled that... If you wait 15-30 minutes does the user title get changed?
dstruct2k
04-13-2009, 05:20 PM
It is designed to update their user title either when your site's cron script runs to update usertitles, or if email-verification is enabled, when they verify their email.
You may just have to wait until the cron script runs (normally once per hour on the 25th minute) or you can manually run the cron script from the Scheduled Task Manager - you want to run the User Promotions task.
Tobes
04-13-2009, 05:44 PM
All fixed. Thanks so much! This works wonderfully. :)
dstruct2k
04-13-2009, 06:02 PM
<i>Please update to 1.02 to correct issues found with the settings.</i>
murdoc
04-23-2009, 06:46 PM
hi i would like to know would this work if i have a couple of user groups that would expose certain forums
EG
i have a steam community, and then i have the wow community they are very big in all aspects and giving members access to all is a problem as the forums becomes huge for new members
so this mod would be able to split them ?
so they can choose what they like and it would open that forum up to them ?
TigerC10
04-23-2009, 07:35 PM
so this mod would be able to split them ?
so they can choose what they like and it would open that forum up to them ?
This mod randomly assigns users, they do not get a choice.
If you want your users to have a choice, use this modification instead:
https://vborg.vbsupport.ru/showthread.php?t=186076
As for which community they have access to, you'll just have to fuss with the usergroup settings.
dstruct2k
04-24-2009, 06:46 PM
Although it is possible to modify this code to assign a usergroup based off the content of a hidden profile field (which would achieve what you're looking for) I would suggest you rethink the layout of your forums if you believe people will find it "overwhelming" when they join.
If you force people to willingly block themselves from half of your site when they register, you'll either end up with everyone that's interested in the other half of the site making a second account, or a lot of PMs complaining that they want access to the whole site, not just part of it.
Perhaps your dilemma could be solved with a simple reorganization of the site ;)
ti07shadow
05-03-2009, 08:34 PM
ah man im a reserve this. its great for a later thing I want to do :p
Sadie Frost
06-21-2009, 12:28 AM
Would it be possible to make this assign the users to a secondary usergroup during registration rather than primary?
:)
Slamiam
01-24-2010, 03:38 PM
This is what I am looking for, but not necessarily. I want a code like this, but for Post-Registration (Existing) members to click a button a randomly be put into a usergroup.
I know back in April 09' you said you were thinking of designing such a hack, anyone know if one has been released?
Wifey
02-02-2010, 03:10 PM
When people go back and change their email, and have to reverify their account, it removes them from the usergroup. Then when they verify their new email, it puts them back into a NEW usergroup. How can this be fixed?
hermoine22
04-20-2010, 03:21 AM
I installed it but I dont understand how to manage it? how do I add the usergroups and such that I want sorting? I am new to VB
matthewhotdude
04-20-2010, 08:26 AM
Where are the settings for this!!
hermoine22
04-24-2010, 03:46 PM
It workd great but one problem is that under the users profile it shows up as junior member the user groups it does not show thr specified one i stated how do i fix this?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.