vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   XML Bitfield help please (https://vborg.vbsupport.ru/showthread.php?t=129886)

Dragon_IBA 10-25-2006 12:21 AM

XML Bitfield help please
 
I need to be able to interpret the bitfield code in the options field of the user table (vbulleting 3.6.0) I use this table to update another database for a sql/asp program we wrote to track tournamnet points. We also now do html mail outs from this program and i need to be able to extract each users choice on receive admin email (yes or no) from the bitfields. Can anyone help me please?

Paul M 10-25-2006 12:51 AM

From the vb bitfields list you can see that the adminemail option value is 16 ;

Code:

<group name="useroptions">
        <bitfield name="showsignatures">1</bitfield>
        <bitfield name="showavatars">2</bitfield>
        <bitfield name="showimages">4</bitfield>
        <bitfield name="coppauser">8</bitfield>
        <bitfield name="adminemail">16</bitfield>
        <bitfield name="showvcard">32</bitfield>
        <bitfield name="dstauto">64</bitfield>
        <bitfield name="dstonoff">128</bitfield>
        <bitfield name="showemail">256</bitfield>
        <bitfield name="invisible">512</bitfield>

So you need to do a logical AND of the useroptions value and 16 - and test the result.

Dragon_IBA 10-25-2006 01:20 AM

so basically i will need to run a decimal to binary conversion on the options field for every user, then do a logic check in our .net program that checks that ***~**1***** is set.

Paul M 10-25-2006 02:37 AM

Well in php it would be this, not sure about .net

PHP Code:

if ($useroptionsvalue 16)
{
    
// option is set.


BTW, 16 = bit 5, not bit 6 as in your post.


All times are GMT. The time now is 06:16 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.01006 seconds
  • Memory Usage 1,716KB
  • 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)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