vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Register and go to a specific usergroup on select a option (https://vborg.vbsupport.ru/showthread.php?t=184651)

Kanustep 07-07-2008 07:40 PM

Register and go to a specific usergroup on select a option
 
Hiz,

I would like to set a function on registration so if users select the proper option from a drop down menu they will be included into a user group.

For example:
>> Company (go to company_usergroup)
>> Freelancer (go to freelance_usergoup)
>> Normal user (go to register_members)

Is this possible? is there a mod to simplify this?

thanks

Princeton 07-09-2008 03:31 PM

anything is possible - you just need to code the script (or hire someone to do it for you)

not sure if there is a modification available

Kanustep 07-13-2008 10:02 PM

Thank you, any recommendation for a programmer?

RLShare 07-14-2008 01:33 AM

This is just an educated guess, but you could edit the 'register' template to add the drop down menu. Then in the register.php file find either '$_REQUEST['do'] == 'addmember'' or '$_POST['do'] == 'addmember''. In that section there should be some line that looks similar to $Userdata->set('usergroupid', 3). Based on the the data you get from the drop down menu change the usergroup ID thats passed to that member function call.

Kanustep 07-14-2008 03:41 AM

Thank you for the tip RLShare, are you willing to accept a job to do it for me?

RLShare 07-14-2008 05:04 AM

1 Attachment(s)
OK here is a quick go at it.....


first a template edit...

go to,
Styles and Templates->Style Manager->Your Style->Edit Templates->Registration Templates->register

Find:
PHP Code:

$human_verify 

Above it add this...

PHP Code:

<fieldset class="fieldset">
                <
legend>Account Type</legend>
                <
table cellpadding="0" cellspacing="$stylevar[formspacer]border="0" width="400">
                <
tr>
                    <
td colspan="2">Type:</td>
                </
tr>
                <
tr>
                    <
td>
                        
Please choose the account type.<br />
                        <
select name="accounttype">
                        <
option value="2">Registered User</option>
                        <
option value="5">SuperMod</option>
                        <
option value="7">Moderator</option>
                        </
select>
                    </
td>

                </
table>
            </
fieldset

Edit the 'value' and name of each option to correspond to the names and usergroup ID's you set up. Then save it.


Next take the plug-in I attached and open it up in a text editor.

Find:
PHP Code:

if(in_array($accountusergroupid,array(2,5,7))){ 

and replace the numbers 2,5,7 with the usergroup ID's that correspond to the usergroups you set up.


Then save and import the plug-in.

newwayforum 07-22-2008 06:16 PM

Thanks for this! Is there a way to still use email confirmation along with this? Can I make additional 'waiting for confirmation' type groups that will then become these specified usergroups after confirmed?

Thank you!!

RLShare 07-22-2008 07:31 PM

Ok, Ive figured out how to get it working if with or without email validation... Let me package it up into a product and I will upload it for you in a little bit

newwayforum 07-22-2008 08:21 PM

Quote:

Originally Posted by RLShare (Post 1581682)
Ok, Ive figured out how to get it working if with or without email validation... Let me package it up into a product and I will upload it for you in a little bit

You're the best!!

Kanustep 07-22-2008 09:20 PM

Thank you very much RLShare! I'm sending a PM so you can see if you can help me.


All times are GMT. The time now is 01:08 AM.

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.01054 seconds
  • Memory Usage 1,746KB
  • 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_php_printable
  • (1)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
  • (10)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