The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
if ($bbuserinfo[usergroupid != 5 OR $bbuserinfo[usergroupid != 6)
This IF statement is not working. What is wrong? |
#2
|
||||
|
||||
![]()
You forgot the last bracket on $bbuserinfo[usergroupid].
|
#3
|
|||
|
|||
![]()
You might also want to encompass each side of the expression in a container.
if (($bbuserinfo[usergroupid] != 5) OR ($bbuserinfo[usergroupid] != 6)) |
#4
|
||||
|
||||
![]()
Moved to the correct forum
![]() |
#5
|
||||
|
||||
![]()
also it's easier to use the in_array for such things:
PHP Code:
![]() i assume you need an and ![]() |
#6
|
|||
|
|||
![]()
and also, i beleive you should be using || instead of OR
AND and OR are bitwise operators. If you dont know what those are, you should probably avoid them altogether use && instead of AND use || instead of OR |
#7
|
||||
|
||||
![]() Quote:
Somthing about the boolean logic is bad. |
#8
|
|||
|
|||
![]() Quote:
from: http://www.vbulletin.com/docs/html/codestandards |
#9
|
|||
|
|||
![]() Quote:
|
#10
|
||||
|
||||
![]()
bit wise operators are & and |
&& and || as well as AND and OR are boolean operators in PHP using AND/OR in conditions and &/| for bitwise ops makes the code more readable, that's why i defined AND/OR as macros in my C++ as well ![]() |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|