The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Hey everyone!
I have a Multiple-Selection Menu profile field I want to grab data from and compare (the raw data for a custom PHP script). I am not quite sure how the data is store or how I would go about parsing the data I get from the field and utilizing it how I want. Does anyone know how I might do this? |
#2
|
|||
|
|||
![]()
The data is stored as one number. You can think of it as a binary number where each bit represents one of your options. Look at this article: https://vborg.vbsupport.ru/showthread.php?t=250418 , specifically the section "For Multiple-Selection Menu and Multiple-Selection Checkbox", Method 2. The code for the plugin shows how you would check the value to see if each option is selected or not.
|
#3
|
||||
|
||||
![]()
So essentially, let's say I grab my user's info from the field and store it as $multilist. Could I simply change the code provided as;
PHP Code:
PHP Code:
Edit: So, this is essentially a bitwise operator, and by the code provided, I am essentially seeing if the bit in my variable (in this case bit 1 in the variable $multilist) is set, and if it is, then that means that the user has selected it, right? Edit 2: It works! Thanks! |
#4
|
||||
|
||||
![]()
That is exactly correct, the single & in php is a bit operator, similarly | is a bitwise OR.
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|