The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
AUTOJOIN - Auto-entry in membergroup via field in profile Details »» | |||||||||||||||||||||||||||
AUTOJOIN - Auto-entry in membergroup via field in profile
Developer Last Online: Oct 2016
Here's a little something to give back to this community that has been of such help to me.
With this plugin, you can have a user entered into or removed from a secondary usergroup according to several types of controls that can be placed in the user's profile via custom fields. This acts only on SECONDARY usergroups and will not affect the user's PRIMARY usergroup. At each login, the plugin will check for the appropriate setting in the user's profile, then add or remove the user from the specified membergroup as appropriate. Note that this does not act instantaneously upon entry of the data in the profile, but requires a new login for this to take effect. [Starting with vB 3.6.4 (maybe earlier, I didn't install anything between 3.5.4 and 3.6.4) this will take effect with one or two page reloads.] Controls currently available: 1) Password for single usergroupNote that you may write your own additional controls and use the two included functions to do the actual insertion into, and removal from, the target usergroups. Tested with vB 3.5.4, 3.6.4, 3.6.7-PL1, 3.8.7PL3 only. Full instructions are in the downloadable text file autojoin.txt. Update log:
Show Your Support
|
Comments |
#12
|
||||
|
||||
Quote:
A wouldn't think a password text field is the best way to do this. As long as you're going to be modifying code anyway, a radio button would make more sense. |
#13
|
|||
|
|||
thanxxxxxxxxxxx
|
#14
|
||||
|
||||
Code revised to version 1.02 - see first post in thread.
Rewritten using defined functions for adding to, and removing from, memberbgroups. This should make it easier to follow the logic and to make it easier for you to adapt the code for other situations (e.g. checkboxes or radio buttons instead of text profile fields). |
#15
|
||||
|
||||
Quote:
So say for an example a clan called BobsArmy. Is it possible that BobsArmy can have a password, but once the user enters the password instead of being automatically joined into the BobsArmy usergroup he is added automatically to the application process which is found in the group membership page, allowing a second check by the group leader |
#16
|
||||
|
||||
Quote:
Perhaps someone more familiar with that feature can give a more authoritative answer. But in that case, as long as it requires moderator intervention anyhow, how would this be an improvement over the standard application process? The whole idea here was to eliminate moderator involvement. |
#17
|
||||
|
||||
Quote:
|
#18
|
|||
|
|||
Understand i right, that for my problem i only modify this codes:
Code:
// Add or remove user from secondary usergroups // according to radio button choice in user's profile // (Choice of one of several forums) global $vbulletin; // Enter values in the strings below for your forum // custom field containing your radio button $field = 'fieldX' // membergroup number associated with FIRST radio button choice $mg[0] = 'XX'; // membergroup number associated with SECOND radio button choice $mg[1] = 'YY'; // add additional radio button choices as needed // Derive additional needed variables $userid = ($vbulletin->userinfo['userid']); // userid of user $mgarr = explode(',' , (''.$vbulletin->userinfo['membergroupids'])); // current membergroups as array // Do the work foreach ($mg as $value) { $iii = 0 { if ($field == pow(2,$iii)) { InGroup($mgarr, $mg[$iii], $userid); } else { OutGroup($mgarr, $mg[$iii], $userid); } $iii++ } } |
#19
|
||||
|
||||
Quote:
|
#20
|
||||
|
||||
Quote:
BUT, I'm now trying to get this running on a test system, and there are some syntax errors that I'm working on correcting. (I warned you that this was untested code.) Please check back later. |
#21
|
|||
|
|||
Quote:
Maybe you can wrote me a plugin, cause its to confusing for me what here is written, sorry. |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|