When you use 'AND', then the expression is true only if the expressions on both sides of AND are true. In this code:
Code:
if ($vbulletin->userinfo['usergroupid'] != 6 AND 7)
the left side is $vbulletin->userinfo['usergroupid'] != 6, and the right side is just 7. As it turns out (using php the rules of type conversion), an integer converts to 'false' if it's 0 and true otherwise, so the expression '7' is always true. So the result is the same as this:
PHP Code:
if ($vbulletin->userinfo['usergroupid'] != 6)
I hope that makes sense.
Or maybe a better way to put it would be that the != has higher precedence than AND, so if you were to put parens in the expression to make it clear, what you'd have is this:
PHP Code:
if (($vbulletin->userinfo['usergroupid'] != 6) AND (7))
which is obviously not what you want.