vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Add User to Primary Usergroup Based on Value of Custom Profile Field (https://vborg.vbsupport.ru/showthread.php?t=82992)

amykhar 11-08-2005 07:05 PM

Nobody has seniority at registration time, so no. This mod can't help you. You can use the built in promotion system, I believe.

Amy

silly rabbit 11-08-2005 07:23 PM

Quote:

Originally Posted by amykhar
Nobody has seniority at registration time . . .

Amykhar, already have 'senority' as a required 'custom' field upon registration?? Granted don't have 'input verification' yet . . .

Marry Me? Rabbit (with respect)

amykhar 11-08-2005 07:25 PM

Doh. Sorry for my stupid initial response. Let me look at it a bit and get back to you. I'm multitasking right now.

silly rabbit 11-08-2005 07:28 PM

Quote:

Originally Posted by amykhar
Let me look at it a bit and get back to you. I'm multitasking right now. . . .

No Problem!!!

Quote:

Originally Posted by amykhar
You can use the built in promotion system

I'm Not READING either - need to check out as well(if referring to 'posts' have already)

Thx Will Check Back LATER!!

Rabbit

lazyseller 11-08-2005 07:36 PM

Quote:

Originally Posted by amykhar
It sounds like if a user registers from one domain, you want them to see one style and one set of forums and if they register from another domain, you want them to see a different style and set of forums. Is that what you are going for?

Amy

Thanks... for responding i have found a solution for this ..

webspider 11-10-2005 11:47 AM

Nice mod I wondered how to do this.

I'm using this mod to ask the user if they wish to receive the site newsletter or not. This works fine on registration but they can't change their minds. So I added the option and two plugin's for the user to select yes or no on update profile. The problem I'm having is it does not always work I have to select Yes or No and save twice for the plugin to actually do the job of moving the user from one group to the other.

Is there anyway to combine these two options into one and is there a more sure way to ensure that the update actually occurs?

Hook Location profile_updateprofile

// Get the value for field 5
$user = $db->query_first("
SELECT field5
FROM " . TABLE_PREFIX . "userfield
WHERE userid = " . $vbulletin->userinfo['userid'] . "
");
if ($user['field5'] == 'Yes')
{
$userdata->set('usergroupid', 2);
}

AND

// Get the value for field 5
$user = $db->query_first("
SELECT field5
FROM " . TABLE_PREFIX . "userfield
WHERE userid = " . $vbulletin->userinfo['userid'] . "
");
if ($user['field5'] == 'No')
{
$userdata->set('usergroupid', 44);
}

Token55 12-30-2005 05:24 AM

Hey there,

This is exactly what I want to do, but I'm having a little trouble with it. I'm checking the correct field for the correct value (field6 is populating properly & I'm checking for the right values). It's hooked at the right place, register_activate_process.

I am using vB 3.5.2 - is that the problem? If so, any thoughts on how to get this to work?

Here's the code I'm using:

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 6
        $user = $db->query_first("
                        SELECT field6
                        FROM " . TABLE_PREFIX . "userfield
                        WHERE userid = " . $vbulletin->userinfo['userid'] . "
                ");


                if ($user['field6'] == 'chicago')
                {
                        $userdata->set('usergroupid', 11);
                }
                if ($user['field6'] == 'cincinnati')
                {
                        $userdata->set('usergroupid', 10);
                }
                if ($user['field6'] == 'indianapolis')
                {
                        $userdata->set('usergroupid', 9);
                }

  ]]>
  </phpcode>
  </plugin>
  </plugins>

The values for field6 are set up to be all lowercase.

When I click the activation link in the email, a blank window pops up with this address...
http://www.mydomain.com/forums/regis...=15&i=80639843
...but it freezes there. The user gets activated, but is not assigned to the desired usergroup.

Thanks a bunch for any help.

Crrrazzzy 01-24-2006 11:17 PM

fixed

Valentino 01-29-2006 05:20 PM

Great plugin Amy!

I'm wondering if you (or any other able person) would help me? I want to use the plugin, but I don't have email verification turned on. What do I need to change to make this work without email verification?

Val

Valentino 02-11-2006 02:51 PM

Can anyone help me? :)


All times are GMT. The time now is 05:30 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.02650 seconds
  • Memory Usage 1,745KB
  • 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
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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