The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Using if (in_array with $vboptions?
In a PHP file, I try the following condition:
PHP Code:
Help would be appreciated. |
#2
|
||||
|
||||
then depending what is that $vboptions['vbma_pmember'], is it an array ? I don't think it can be an array, if you want something like this:
$vboptions['vbma_pmember'] store the value of "1,2,4,5,7" then you must first explode() it so that it can be an array, then in the function in_array() it'll surely work. The "," can be " " or any special character. |
#3
|
|||
|
|||
The vbma_pmember is a basic ACP setting, with 6,11,9 in it.
Anyway, I'll look into it a bit closer, I'll let you know if I still can't get it to work. |
#4
|
||||
|
||||
if it's 6,11,9 then follow the way I posted it sure works
|
#5
|
|||
|
|||
If I use the explode() feature, will I still be able to get the data from the $vboptions variable?
Could you post a little example code maybe . It's my first hack public hack, so I'm not used to using variables... |
#6
|
||||
|
||||
explode() doesn't eat any of your data. I won't suggest it if it can't get the data from $vboptions varible, absolutely. Of course if the data is entered correctly like if you use explode(',',$vboptions['something']) but you then will have to give some exceptions when someone suddenly enter 1,2-3,4 which returns unexpected value.
I regard the above is an example. if you don't know explode(), php.net then |
#7
|
|||
|
|||
Thanks for the reply.
I tried this and it didn't work: PHP Code:
EDIT: FIXED |
#8
|
|||
|
|||
Leave out the array( ..) around $pusergroups
|
#9
|
|||
|
|||
Yes, that's how I fixed it .
Little late, but thanks for the reply. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|