vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Can any one fix this Gender Plugins Code (https://vborg.vbsupport.ru/showthread.php?t=126766)

bahattab 09-16-2006 12:40 PM

Can any one fix this Gender Plugins Code
 
hi

can any one fix this plugins code for me , i am trying to use it with vb 3.6.1 . but it dosent worke for me :confused: .

This code for ( Putting User in Primary Group Based on Custom Profile Field Value Male,Female ) .


thanks
Regards
Emad Bahattab :tired:


PHP Code:


// Get the value for field 5
        
$user $db->query_first("
            SELECT field5
            FROM " 
TABLE_PREFIX "userfield
            WHERE userid = " 
$vbulletin->userinfo['userid'] . "
        "
);


        if (
$user['field5'] == 'male')
            {
                
$userdata->set('usergroupid'9);
            }
        else
            {
                if (
$user['field5'] == 'female')
                    {
                        
$userdata->set('usergroupid'10);
                    }
    
            } 


nico_swd 09-19-2006 07:01 PM

Give this a try.

PHP Code:

// Get the value for field 5
$user $db->query_first("
    SELECT field5
    FROM " 
TABLE_PREFIX "userfield
    WHERE userid = " 
$vbulletin->userinfo['userid'] . "
"
);


if (
$user['field5'] == 'male')
{
    
$userdata->set('usergroupid'9);
}
else if (
$user['field5'] == 'female')
{
    
$userdata->set('usergroupid'10);
}

$userdata->save(); 


bahattab 09-20-2006 07:46 AM

hi

thanks for the reply. i will try it and i will inform you

Emad Bahattab


All times are GMT. The time now is 09:42 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.00988 seconds
  • Memory Usage 1,729KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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