Ok here is my situation: I use vBulletin, and I am trying to code something that would get the Custom Fields for each members from the database and display them
here is how the custom fields works: There is a FIELD NAME and a FIELD NUMBER.
I have a field called "CAT" where the field number is "2"
I have another field with the name "DOG" with the number "3"
Normally i would expect to find in the database where the custom fields are stored either the fields (something like "CAT, DOG") or the numbers (something like "2, 3")
but it displays a weird combinaison of numbers, and i don't understand how i can sort it so display the selected field numbers with their respective names
for example:
I have a member who has selected the following field numbers: 3, 7, 14, 16, 17
the result displayed is 106564
I can already display the weird results numbers and i don't need a script to query the database to find it for each members, this since vBulletin already has a variable to do it. What i want to do is to decode this weird numbers (like 106564) and convert it to the actual field numbers (3, 7, 14, 16, 17 in the example), then sort it in an array or something to replace each numbers with a name (1=fish 2=cat 3=dog 4=horse, etc....)
here is some explications i found on google (by a vbulletin developper), so i post it if this can help any of you to understand my problem:
The options that are selected for multiple choice checkbox fields are recorded using a binary scheme. If the user has only one option selected then the number stored for the profile field will be an integer power of 2 (1,2,4,8,16). If the user has no options selected then the field will be blank (not 0, just blank). If the user has more than one option selected then the number stored will not be an integer power of 2.