PDA

View Full Version : End-User Options - PB Usergroup Choice on registration


RLShare
07-22-2008, 10:00 PM
What does it do?
Allows a user to be assigned to a certain usergroup based on a drop down menu at registration time.

How is it different from the one posted a couple of days ago by Viet:
Well,
1. This one will work with email verification. So you can still require email verification for all new users and they will be assigned to the appropriate usergroup after their email has been verified.
2. It will automatically draw in the usergroup names for the ids instead of having you type out both the usergroup ID's and usergroup names.

Installation:
1. Import the product
2. Go to AdminCP->vbulletin Options->Vbulletin Options->PB Usergroup Choice on Register
and set up the options the way you want...

Notes:
Will add 1 query when showing the registration form.
Will add 1 more query to the processing of a registration if VB is set up for every user having to verify email addresses.

Fixed:
Forgot table prefix in one call to the database causing database error.

bxbigt
07-23-2008, 02:07 AM
Anymore detail ?

RLShare
07-23-2008, 02:38 AM
It adds the drop down menu shown in the attachements. Each option in the dropdown is a usergroup allowing the people registering to be assigned to a usergroup based on a dropdown list.

Inspired by this thread...
https://vborg.vbsupport.ru/showthread.php?t=184651

bokmade
07-23-2008, 04:12 AM
I like th idea ..

Install ..

schlottkej
07-23-2008, 03:08 PM
well done

schlottkej
07-23-2008, 03:17 PM
Would be good if they picked a Usergroup with a subscription that it took them to the subscription page before completing registration activation.

Trana
07-23-2008, 03:41 PM
Nice idea. What would be even better would be if it used checkboxes and members could pick multiple groups that they want to be affiliated with. That would solve a major problem for me.

I'd like to make a Paypal donation if you could get this to work.

bchertov
07-23-2008, 03:50 PM
Good idea!

I'd love to see a similar option for joinable public user groups.

Hornstar
07-25-2008, 05:29 AM
Yeah really good idea. thanks for sharing.

Bellinis
07-25-2008, 09:11 AM
Thanks for this. Very useful!

MrNase
07-25-2008, 11:11 AM
Does it put the user into the primary or secondary usergroup?

RLShare
07-27-2008, 01:01 AM
It sets their primary usergroup.

PlymWS
07-29-2008, 12:01 PM
Could this be coded so that instead of manually entering the usergroupids in the ACP the script could look in the database for publically joinable groups and then output them in the list ?

I've been messing around with SELECT usergroupid FROM usergroup WHERE ispublicgroup = 1 but I can't get the SQL to output the correct array :(

GHC Webmaster
08-10-2008, 08:07 AM
This would be useful for me, if it would also be a profile field. In other words if the name off the chosen group shows (along with the field title) up in the user profile and everywhere where user profile fields can be used (memberlist, mods which add profile fields to postbit etc). I also would have to be editable through Edit Your Details, and on edit it should also change the usergroup.

Basically it would have to act like a custom single selection list profile field, which just happens to be connected to usergroups.

(I want to use it for a country field, which should also put members into a usergroup for that country.)

Btw, it also would be more usefull if it would set the usergroup as a secondary group, and leave the primary group as it is (Registered Users or otherwise).

As it is now, I unfortunately cannot use it.

ShadowOne
08-10-2008, 09:04 AM
i really like this...
i.e...you can do male or female...
change the text color of each and you will have a diff color for male and female...
so when they register... they can choose male or female...

wmlvb
08-12-2008, 01:01 PM
What if two of my usergroups require certain moderation procedures before they are put in that user group? Can the register and fill in information I need to get approval and while they are waiting be regular registered user group. I do not want the regular registered usergroup to have to go through this moderation! Thanks for the help.

justchil
08-13-2008, 12:55 PM
Any suggestion for those of us who have email verification and moderation on new accounts?

oz_girl
08-13-2008, 10:54 PM
I love this idea but one of usergroups is a subscription only. Is there anyway to have members who chose the subscription group to be redirected to the subscription information after they fill out the registration? i'd also pay to have this done.

Tharos
08-13-2008, 11:03 PM
excelent
I will use it for woman and mesn ;)

d-wiz
08-14-2008, 09:35 AM
I would like it if the usergroups each had there registration and information options so that I can custom it for customers and companys so that I get different information from them and the other group don't have to see the questions.

d-wiz
08-20-2008, 11:16 AM
The members of my groups do not recieve the welcome message on the board?

iBaker
08-22-2008, 11:15 PM
Unfortunately I have had to uninstall this mod - it really is a great idea but I need it to put the user into a secondary usergroup NOT their primary one

Trana
08-26-2008, 09:30 PM
If anyone can complete some simple mods to this hack including the following:

addition of user to secondary group
ability to specify multiple groups via checkboxes

Please PM me. I'd be willing to pay.

Thanks.

Greek76
09-06-2008, 11:35 PM
Great mod exactly what I was looking for. Installed and works great! Thanks

Thamelas
09-17-2008, 11:46 AM
Agreed. This is exactly what I am looking for...just one problem.

I need to put people in Secondary Usergroups. Not Primary Usergroups. How can this be implimented?

dengbej
09-17-2008, 12:25 PM
Thanks.i made male and female.

Savage702
09-17-2008, 01:25 PM
This is great... have been looking for this too, but like others have said, I need this to add people to a secondary usergroup, not a primary.

Bilderback
10-11-2008, 05:21 PM
Sorry, I also had to uninstall this Mod since it only works for Public usergroups.
I have Usergroup Leaders assigned which moderate any requests and this Mod
bypasses any Leader moderation and adds them automatically.
Wonderful concept though.
Hopefully future release will have more options.

soundboy
02-28-2009, 07:58 AM
Will this work for vBulletin 3.6.7? I need this exact mod for vb3.6 :(

coffee
03-11-2009, 11:50 AM
I need this to add people to a secondary usergroup, not a primary.

I'm using it on a 3.8.1_PL1 installation for secondary usergroups, I had to do the next:

1- Find and delete this code block:
<plugin active="1" executionorder="5">
<title>pb_usergroupchoice_ifemail</title>
<hookname>register_addmember_complete</hookname>
<phpcode><![CDATA[if($vbulletin->options['verifyemail']){
$vbulletin->input->clean_gpc('p', 'accounttype',TYPE_INT);

$accountusergroupid=$vbulletin->GPC['accounttype'];
$pb_usergroup_ids=explode(" ",$vbulletin->options['pb_usergroupchoice_ids']);
if(in_array($accountusergroupid,$pb_usergroup_ids) ){
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "useractivation SET usergroupid = '".$accountusergroupid."' WHERE activationid = '".$activateid."' LIMIT 1 ");
}
}]]></phpcode>
</plugin>
2- Find this line:
$userdata->set('usergroupid', $accountusergroupid);
3- Replace it with:
$userdata->set('membergroupids', $accountusergroupid);

Hope that will solve your problem :)

Edit: Make sure you force group selection, so that new members are directed automatically.

HaS?R
03-11-2009, 06:44 PM
Thanks.Nice Mod.

Mum
04-26-2009, 03:19 AM
Anyone worked out how to do it for multiple groups?

I would also like to do it for changes on the profile edit page as well, not just upon registration.

ryancooper
06-08-2009, 01:31 PM
any way this can be modified to allow users to join a social group?:erm:

COBRAws
06-12-2009, 05:45 AM
any way this can be modified to allow users to join a social group?:erm:
that would be a killer!

-
I have a custom made script from a year ago. This is great for me when upgrading to 3.8.x series.

ukchat
07-15-2009, 03:20 PM
This mod seemed at first glance to do exactly what we wanted, then we realised that it was bypassing the registered users group, and making it the primary group they joined.
We then read further and saw coffees mod of the mod which bypassed adding them to the primary user group but for us it didnt add them into the secondary user group either, although this option was given to join. any ideas?

ideally we would like for users requests to join to be submitted to the group leaders rather than being directly injected into the chosen group, has anyone made this work yet?

coffee
07-24-2009, 11:19 AM
All I did was that I wrote here from before ..

But also forced new registrations to select one group; in my case: Male OR Female.

garyion
08-25-2009, 11:11 AM
I needed (as everybody of course) the user choice to be put in a secondary group, which is the field "membergroupids".
the usergroupid is a one value field and it's meant to have usergroup id's from 1 to 9 (standard users, admin, moderators, registered etc..) which is "2" as default registration.

I modified the "if not email" script to write "2" in usergroupid and the user choice in the membergroupids.
that might work fine..

the problem is when you are using email verification.. (of course, everybody does).
the user is temporarily registered in a "useractivation" table and the userchoice goes into the usergroupid of the useractivation table.
when the activation is completed from the email link the membergroupids "hack" is lost again. so if you want to modify it as you did for the if-not-email script you can't!

I am a fan of this plugin, I currently have it installed, but I would recommend some vBulletin official user to clarify what should be done and what should not by plugins like this.
I'm afraid I'll have to uninstall it before launching my board, I don't want to have to manually modify the usergroup memberships of every user once it's up and running.

cheers mates

garyion
09-01-2009, 10:52 AM
ok I think I sorted out the scripts and now I have this plugin adding the usergroup choice on the memberships (secondary usergroup) instead of the primary usergroup (that is defaulted to "2")

change the part of the ifnotemail script to:

$userdata->set('usergroupid', 2);
$userdata->set('membergroupids', $accountusergroupid);

(obviously only the userdata set line)

and then add a plugin into the same product with hook location:
"register_addmember_process"

and paste inside this:

if($vbulletin->options['verifyemail']){
$vbulletin->input->clean_gpc('p', 'accounttype',TYPE_INT);
$accountusergroupid=$vbulletin->GPC['accounttype'];
$userdata->set('membergroupids', $accountusergroupid);
}


and in the end change the ifemail script, the SQL query has to become like this:

$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "useractivation SET usergroupid = 2 WHERE activationid = '".$activateid."' LIMIT 1 ");


I'm actually using it for another pourpose but the principle is the same..
I'll keep an eye on this thread for any questions.

Cheers

Trana
09-20-2009, 07:07 AM
Good job, it works!

songoibiza
09-23-2009, 03:45 PM
thanks !

beleebala
03-28-2010, 02:08 PM
Would it work on the new VBB4? This is such a great mod!

Bobbo
04-06-2010, 01:16 PM
This is interesting. I'm doing something like this in vb4. Did anyone ever figure out how to support selecting multiple groups? I'm trying to figure out what the code would be to assign more than a single usergroupid or membergroupids at a time.

Bobbo

Artes_Marciales
04-06-2010, 05:38 PM
ok I think I sorted out the scripts and now I have this plugin adding the usergroup choice on the memberships (secondary usergroup) instead of the primary usergroup (that is defaulted to "2")

change the part of the ifnotemail script to:

$userdata->set('usergroupid', 2);
$userdata->set('membergroupids', $accountusergroupid);

(obviously only the userdata set line)

and then add a plugin into the same product with hook location:
"register_addmember_process"

and paste inside this:

if($vbulletin->options['verifyemail']){
$vbulletin->input->clean_gpc('p', 'accounttype',TYPE_INT);
$accountusergroupid=$vbulletin->GPC['accounttype'];
$userdata->set('membergroupids', $accountusergroupid);
}


and in the end change the ifemail script, the SQL query has to become like this:

$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "useractivation SET usergroupid = 2 WHERE activationid = '".$activateid."' LIMIT 1 ");


I'm actually using it for another pourpose but the principle is the same..
I'll keep an eye on this thread for any questions.

Cheers
does not work for me : S
Please. You can upload the edited file?
Thanks!

bwhite
05-27-2010, 02:13 AM
We need this for VB4!

ShackMaster
12-22-2010, 09:12 PM
Anyone tried this in 4.1 yet?

ShackMaster
12-23-2010, 02:00 AM
I can verify that it does not work in 4.1

Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: pb_usergroupchoice_field in [path]/includes/functions.php on line 4055

Parse error: syntax error, unexpected T_VARIABLE in /includes/class_core.php(4414) : eval()'d code on line 276

royg
03-13-2011, 06:31 AM
I'm really interested in having this mod work on my board, and would be willing to pay to have it upgraded to v4.1.x.

Any chance of this happening? :rolleyes:

AFemaleProdigy
03-28-2011, 03:23 AM
I really would like to use this for vb4 too. Tried to install and got the same error.

temsamane
04-02-2012, 08:19 PM
i need this for vb 4

Tyran1
04-17-2012, 01:23 AM
Thanks works with 3.8.7 PL2

bchertov
04-17-2012, 05:20 PM
I'd be happy to kick-in to have this re-developed for VB4!

FTG LIQUID CL
06-01-2012, 01:41 AM
i need this for 4.1.12

Tyran1
02-05-2013, 04:10 PM
Update to vB 5???

vBarsiv
02-12-2013, 03:27 AM
this good. thank you

orionpk2
03-11-2013, 09:48 PM
good job, but there is a solution parecidad for 4.2?

Thanks

phalanxents
02-28-2016, 04:18 PM
I have custom user groups, which users choose on registration.

However, it automatically defaults to "Junior Member" until I update user titles and ranks.
Obviously I'm not going to be online all the time to be able to do that.

Is there anything I can do where it will automatically update their usergroup once registered? It will update fine after I update user titles and ranks