Conditional Statement Help

Dazed
Dazed
@dazed
12 years ago
1,022 posts
I have a blog that is set for a specific quota. When it is used, a message appears on my index page that a dj is live on the air. I just added a list to display the users in chat which works great. The problem I have is we use an "auto dj" that is set when no one is live and this is causing the list of users in chat to appear. Since no one will be in chat, I do not want the list to display. Unfortunately nothing I am using is working. Thoughts?

{if $item.blog_on_air == "on" || $item._user_id != "7822" }
and
{if $item.blog_on_air == "on" || $item._user_id !== "7822" }

I have also tried profile_id.

Suggestions?
updated by @dazed: 12/18/13 06:00:37PM
michael
@michael
12 years ago
7,772 posts
What do you think those statements read as? What do you want them to read as?

I read the first one as:
"If the blog is on air or the user who owns the item does not equal 7822, then show this..."

but im not sure what that means. perhaps the && could make a cleaner statement. perhaps:
{if $item.blog_on_air == "on" && $item._user_id == "7822" }
Dazed
Dazed
@dazed
12 years ago
1,022 posts
ahh man had a brain melt. I will check this out later but basically what I have is this blog will only appear if they are in a specific quota using a specific category. I then added a "who's in chat" code but I do not want that to show for a specific dj since no one will be in chat for them. So this conditional statement is basically saying display when "on" but not if it is dj with user_id 7822.
michael
@michael
12 years ago
7,772 posts
Try it with just {if $item.blog_on_air == "on"} then wrap the inside in another one, so you can see what part of the statement its not working at, after you know that, then reduce it to one line.
{if $item.blog_on_air == "on"}
 {if $item.blog_on_air == "7822"} 
 // do nothing
{else}...
Dazed
Dazed
@dazed
12 years ago
1,022 posts
Thanks Steve. I just spaced the operator. Once I saw your post I had that "oh shit" moment. Appreciate the help.