View Single Post
  #4  
Old 16 Apr 2013, 15:13
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
The options column of the user table is a bit field - if you were to write the value in binary, each 0 or 1 would indicate the state of a setting. To change them with a query, you would add or subtract out the value for that option (after making sure the option isn't already in the state you want). For example, to set "Receive Admin Emails" to Yes for everyone who doesn't have it set already, you could do this:

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


and to set it to no,

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


So the next question is, where does the mask value (16) come from? They are defined in the file includes/xml/bitfield_vbulletin.xml. For the user options field, search for <group name="useroptions">. The values (in base 10) might look like random numbers, but in binary they each have only one bit set. You still have to figure out which ones correspond to which options, but hopefully most are obvious, or else you might be able to figure it out by comparing the name in the xml file to the html name attribute of the <input> tag on a page where that option is set.
Reply With Quote