The Arcive of vBulletin Modifications Site. |
|
|
Checking if a number is either X, Y, or Z
Frequently, you want parts of your hack to only be accessible by moderators and admins. To do so, you use this if-block: PHP Code:
A much more elegant solution would be to use in_array(): PHP Code:
PHP Code:
PHP Code:
|
|
#2
|
||||
|
||||
|
Very nice firefly. This is very helpful... I really didnt like arrays but I am starting to see the usfulness in them.
|
|
#3
|
|||
|
|||
|
Great info Firefly...very much appreciated, thank you! Can someone post something about joins? I am trying to something using joins and it just isn't working right.
|
|
#4
|
||||
|
||||
|
Post in the PHP forum about it and I'll see what I can do.
|
|
#5
|
|||
|
|||
|
Firefly, that's good, but for performance you should really use a switch as this would prevent the test of an array, convert to an array and loop through array stuff that happens partly implicitly...
try something like... PHP Code:
|
![]() |
|
|