Yeah I had it working that way originally, then I decided to see if I could find crafty new ways of doing it, just to see what was possible.
I guess while I know it doesn't work, it doesn't fully make sense to me the reasoning why. In english, I would read that as ( IF variable NOT EQUAL TO (string OR string) ), not ( IF variable NOT EQUAL TO true ). See what I mean?
Think of it like maths - everything in brackets gets evaluated first i.e.
2 * 3 + 4 = 10 2 * (3 + 4) = 2 * 7 = 14
In the same way the expression in brackets gets evaluated before being compared to $list_type. Since neither 'category' or 'versions' evaluate to false, the result of ('categories' || 'versions') is true. This is what then gets compared to $list_type.
I would read it as:
IF variable NOT EQUAL TO (string OR string)
in the same way as you, but I would see that:
(string OR string) == true
since everything in brackets gets evaluated first.
Last edited by Theo : 08-17-2008 at 04:38 AM.