Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 21 Jul 2017, 02:18
Medi0cr3 Medi0cr3 is offline
 
Join Date: Aug 2014
Vb4 user option bitfields, how to extract

How in the world do you extract the bitfields on individual users. I'm really only looking for daylight savings time on, off, and auto dst.

If anybody could help me I'd be greatly appreciative.
Reply With Quote
  #2  
Old 21 Jul 2017, 03:00
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
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":


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


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?
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #3  
Old 21 Jul 2017, 03:20
Medi0cr3 Medi0cr3 is offline
 
Join Date: Aug 2014
dude, that was like way above my brain power to figure out on my own, thanks dude!

I tried it, but no luck. I couldn't get the dst_option to return anything.

a var_dump returns int(1), but its literally NULL
Reply With Quote
  #4  
Old 21 Jul 2017, 03:28
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Glad to help out!
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #5  
Old 22 Jul 2017, 18:16
Medi0cr3 Medi0cr3 is offline
 
Join Date: Aug 2014
never mind. its inherent. thanks dude. I had it practically, just global spam was needed

--------------- Added 22 Jul 2017 at 18:17 ---------------

To build upon this post I've included the following in case people were curious:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 00:37.

Layout Options | Width: Wide Color: