vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Default Usergroup Set by Profile Field On Registration (https://vborg.vbsupport.ru/showthread.php?t=180202)

Conner85 05-23-2008 12:49 AM

Default Usergroup Set by Profile Field On Registration
 
How would I get the following plugin code to work with 3.7?

Depending on the choice of the profile field, it places the user in a certain group.

Example: I have a forum for bands and fans to register. One of the fields ask "Is this a band profile?" and the choices are Yes and No.

If Yes is chosen, they are placed into the Band usergroup. If No is chosen, they are places in the registered users usergroup.

I installed this plugin when I had 3.6.8 running and it was working. But the plugin is for 3.5. Now when people register, they get an error message saying it couldn't process their request. I'm almost sure this is what is messing the registration up and giving users errors.

Code:

<?xml version="1.0" encoding="ISO-8859-1"?>

<plugins>
        <plugin active="1" product="vbulletin">
                <title>Put User In User Group Based on Field Value</title>
                <hookname>register_activate_process</hookname>
                <phpcode><![CDATA[// Get the value for field 5
        $user = $db->query_first("
                        SELECT field44
                        FROM " . TABLE_PREFIX . "userfield
                        WHERE userid = " . $vbulletin->userinfo['userid'] . "
                ");


                if ($user['field44'] == 'Yes')
                {
                        $userdata->set('usergroupid', 9);
                }]]></phpcode>
        </plugin>
</plugins>


Conner85 06-01-2008 10:48 AM

Bump


All times are GMT. The time now is 04:10 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.01273 seconds
  • Memory Usage 1,710KB
  • 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
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete