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)

Christine 07-16-2005 04:52 PM

Brinnie,

Unless you paid for copyright removal, at the least, the copyright needs to read:

vBulletin, Copyright ?2000 - 2005, Jelsoft Enterprises Ltd.

You don't have to keep version information, but the rest is required by Jelsoft.

:)

Brinnie 07-17-2005 06:57 AM

Quote:

Originally Posted by Christine
Brinnie,

Unless you paid for copyright removal, at the least, the copyright needs to read:

vBulletin, Copyright ?2000 - 2005, Jelsoft Enterprises Ltd.

You don't have to keep version information, but the rest is required by Jelsoft.

:)

oh well, that's jelsofts problem.
I'm buying the full version next week, so...

anyone have sucess with this on Beta 4?

Marco van Herwaarden 07-17-2005 07:07 AM

Quote:

Originally Posted by Brinnie
oh well, that's jelsofts problem.
I'm buying the full version next week, so...

anyone have sucess with this on Beta 4?

Wrong this is your problem. You must follow your license agreement.

Brinnie 07-17-2005 07:09 AM

Quote:

Originally Posted by MarcoH64
Wrong this is your problem. You must follow your license agreement.

of course...

amykhar 07-17-2005 03:07 PM

Quote:

Originally Posted by Brinnie
oh well, that's jelsofts problem.
I'm buying the full version next week, so...

anyone have sucess with this on Beta 4?

It's running fine for me on Beta 4.

akanevsky 08-01-2005 08:16 PM

I don't think you need the select query. I mean, the custom fields get passed on by the POST method. They should already be somewhere in the script. Get the values from there.

amykhar 08-02-2005 02:03 PM

You would think so, wouldn't you. But, if you look at the code, you'll see that what's passed in to the activation routine are two things: The username and the activation id.

Using the username, the code gets the userinfo BUT not all of it. It only gets what's in the user table. It doesn't get the profile fields. And, it never does a call to fetch_userinfo(). (Which would result in a query as well.)

If I weren't doing this as a plugin, I would have changed the query to do a left join and get the profile field stuff. But, I'm doing this as a plugin and can't change the query. Hence, the second query.

Amy

akanevsky 08-02-2005 02:17 PM

Ah... Sorry, I did not notice that you were hooking it into the activation section. I thought you added the group right upon registration... :P

amykhar 08-02-2005 02:22 PM

Nope. I don't want unactivated users in secondary user groups.

I figured it was safer this way for all concerned because not everybody understands how secondary usergroup permissions work. They could end up with some nasty surprises by putting somebody in a secondary usergroup that has priv to post, view attachments, or whatever.

Yes, the answer is to severely limit secondary groups, but not everybody knows to do that. :)

Amy

justindwhite 10-07-2005 12:02 AM

I am getting a Parse error when the user tries to activate their account. Here is the plugin I used. Is everything OK? Anyone know the problem?

Code:

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

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


                                        if ($user['field9'] == 'OnLineRegulator')
                {
                        $userdata->set('usergroupid', 11);
                       
                                        if ($user['field9'] == 'OLR')
                {
                        $userdata->set('usergroupid', 10);
                       
                                        if ($user['field9'] == 'OLR ANZACs')
                {
                        $userdata->set('usergroupid', 19);
                       
                                        if ($user['field9'] == 'OLR Canada')
                {
                        $userdata->set('usergroupid', 20);
                       
                                        if ($user['field9'] == 'OLR Divas')
                {
                        $userdata->set('usergroupid', 12);
                       
                                        if ($user['field9'] == 'OLR Elite')
                {
                        $userdata->set('usergroupid', 13);
                       
                                        if ($user['field9'] == 'OLR GreatBritain')
                {
                        $userdata->set('usergroupid', 25);
                       
                                        if ($user['field9'] == 'OLR Holland')
                {
                        $userdata->set('usergroupid', 22);
                       
                                        if ($user['field9'] == 'OLR Spartan')
                {
                        $userdata->set('usergroupid', 9);
                                               
                                        if ($user['field9'] == 'OLR United States')
                {
                        $userdata->set('usergroupid', 24);
                                               
                                        if ($user['field9'] == 'OLR Coalition')
                {
                        $userdata->set('usergroupid', 39);
                                               
                                        if ($user['field9'] == 'OLR Honorary Member')
                {
                        $userdata->set('usergroupid', 38);
                                               
                                        if ($user['field9'] == 'Not A Member')
                {
                        $userdata->set('usergroupid', 16);
                       
                }]]></phpcode>
        </plugin>
</plugins>



All times are GMT. The time now is 06:51 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.01362 seconds
  • Memory Usage 1,759KB
  • 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
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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