vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Using vb3's USEROPTIONS fields? (https://vborg.vbsupport.ru/showthread.php?t=73112)

memobug 12-20-2004 05:58 AM

Using vb3's USEROPTIONS fields?
 
Can anyone explain how the USEROPTIONS array works? I would like to determine the COPPA status of the user. It used to be a field user.coppauser in vb2, but now I understand I need to extract it somehow of the useroptions in vb3

PHP Code:

// Defined constants used for user field.
$_USEROPTIONS = array(
        
'showsignatures'    => 1,
        
'showavatars'     => 2,
        
'showimages'        => 4,
        
'coppauser'         => 8,
        
'adminemail'        => 16,
        
'showvcard'         => 32,
        
'dstauto'         => 64,
        
'dstonoff'         => 128,
        
'showemail'         => 256,
        
'invisible'         => 512,
        
'showreputation'    => 1024,
        
'receivepm'         => 2048,
        
'emailonpm'         => 4096,
        
'hasaccessmask'     => 8192,
        
//'emailnotification' => 16384, // this value is now handled by the user.autosubscribe field
        
'postorder'         => 32768,
); 

How would I recover coppa status for a user? I am using this in PHP, not a template, if that matters.

Regards,

Matt

Xenon 12-23-2004 09:46 AM

actually very easy, you just have to use binary operators

so in vb2 you did use:

PHP Code:

if ($bbuserinfo['coppauser']) { 

which will become
PHP Code:

if (($bbuserinfo['options'] & $_USEROPTIONS['coppauser']))



memobug 12-23-2004 10:20 AM

Thanks!

Regards,

Matt

Xenon 12-23-2004 12:06 PM

you're welcome


All times are GMT. The time now is 07:07 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.01027 seconds
  • Memory Usage 1,723KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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