vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   End-User Options - PB Usergroup Choice on registration (https://vborg.vbsupport.ru/showthread.php?t=186076)

RLShare 07-22-2008 10:00 PM

PB Usergroup Choice on registration
 
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

Quote:

Originally Posted by Savage702 (Post 1624089)
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:
PHP Code:

        <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:
PHP Code:

$userdata->set('usergroupid'$accountusergroupid); 

3- Replace it with:
PHP Code:

$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

Quote:

Originally Posted by ryancooper (Post 1825669)
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:

Code:

$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:

Code:

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:

Code:

$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 !


All times are GMT. The time now is 09:17 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01207 seconds
  • Memory Usage 1,834KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (3)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete