What I typically do is on my dev site I take a look at the bitfield in question via phpMyAdmin and convert them to binary, noting the choice made. In this case, we are interested in the "options" column of the "user table. Here is what I found regarding the "DST Correction Option":
Code:
10101100000100110011010111 (auto-detect)
10101100000100110000010111 (always off)
10101100000100110010010111 (always on)
Counting from the right, and beginning with zero in our count, we see that we are interested in the 6th and 7th bits (2^6+2^7 = 192), so we want to mask off all the other bits by performing a bitwise AND on the options value and 192 then divide that by 2^6 = 64 to move the unmasked bits all the way to the right.
So, a PHP statement like:
PHP Code:
$dst_option = ($vbulletin->userinfo['options'] & 192)/64
will store in that variable for the browsing user the following values:
- 0 - always off
- 2 - always on
- 3 - auto detect
Does this make sense?