Conditional Statements

Conditional Statements

I've tried this condition but i see an error (condition not valid):
Code:
<xen:hook name="ad_message_below" />

<xen:if is="({$post.position} % {$xenOptions.messagesPerPage} == 0 OR {$post.position} % {$xenOptions.messagesPerPage} == {$xenOptions.messagesPerPage} - 1) AND !{$visitor.user_id}  == x AND !in_array({$thread.node_id}, array(25))">

How i can fix it?
@Brogan or @Jake Bunce , can you help me?
 
I've tried this condition but i see an error (condition not valid):
Code:
<xen:hook name="ad_message_below" />

<xen:if is="({$post.position} % {$xenOptions.messagesPerPage} == 0 OR {$post.position} % {$xenOptions.messagesPerPage} == {$xenOptions.messagesPerPage} - 1) AND !{$visitor.user_id}  == x AND !in_array({$thread.node_id}, array(25))">

How i can fix it?
What do you want to accomplish?
 
@RoldanLT I want to have 2 fake posts under the first post.

One *only* for the welcome area and the other for all the forum except the welcome area. The fake post should be invisible for the guests.
 
Code:
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND {$visitor.user_id} AND in_array({$thread.node_id}, array(1, 2,3,4))">
This content will show after 1st post on every thread page, only in forums 1,2,3 visible for members only.
</xen:if>

Code:
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND {$visitor.user_id} AND !in_array({$thread.node_id}, array(5,6))">
This content will show after 1st post on every page, not on forums 5,6 visible for members only.
</xen:if>

Code:
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !{$visitor.user_id} AND in_array({$thread.node_id}, array(1, 2,3,4))">
This content will show after 1st post on every thread page, only in forums 1,2,3 visible for guest only.
</xen:if>

Code:
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !{$visitor.user_id} AND !in_array({$thread.node_id}, array(5,6))">
This content will show after 1st post on every page, not on forums 5,6 visible for guest only.
</xen:if>
 
Is there a way to tell if we are dealing with a PAGE node? I'd like to add some conditional CSS to hide the #notices block on Page nodes.
Is this possible?
 
Trying to set up a conditional to remove adsense code in ad_above_top_breadcrumb.

I want adsense removed on forum_list and on thread_list for one particular forum . Also, I want to preserve the ads on thread_view in all forums.

Ideas?
 
I want adsense removed on forum_list and on thread_list for one particular forum
That doesn't make any sense.
The template for forums is forum_view.

If you want to remove ads from specific forums, use the node ID: <xen:if is="!in_array({$forum.node_id}, array(x, y, z))">
 
I need some help, please.

I would like to show content to logged in users, but hide if it's you (like the conversation link in membercard; you can't start a conversation with yourself) AND hide if user is guest (but you allow them to post in certain forum).

For now I have this:
Code:
<xen:if is="{$visitor.user_id} AND {$user.user_id} != {$visitor.user_id}">
... some content ...
</xen:if>

Can't figure it out what to add to hide it from guests.
 
You are already using the logged in conditional statement - <xen:if is="{$visitor.user_id}">
 
But guests are still able to see it. :confused:
If you mean conversation, here's what I'm using:
Code:
<xen:if is="{$canStartConversation}">
<a href="{xen:link 'conversations/add', '', 'to={$user.username}'}">
{xen:phrase start_conversation}</a>
</xen:if>
 
If you mean conversation, here's what I'm using:
Code:
<xen:if is="{$canStartConversation}">
<a href="{xen:link 'conversations/add', '', 'to={$user.username}'}">
{xen:phrase start_conversation}</a>
</xen:if>
I know that, but it works only on member view page... Ok, thanks, I'll see what I can do and report back if I don't find any solution.
 
Ah, sorry, I mean on profile page. That conditional statement won't work in postbir (message_user_view template). I would like to hide content on postbit for guests.
 
Just can't get postId and threadId conditionals working. I'd like to show some advertising through ad_message_body template and only in one specific thread and in the first post only. I managed to show the right stuff with in certain forums and in the first post of a thread with conditionals, but conditionals with postId or threadId do nothing. The correct conditional would be show stuff in one thread and in the first message only:

Code:
<xen:if is="{$threadId} == 54512 AND {$post.position} == 0 AND !{$message.conversation_id}">
Stuff
</xen:if>

I'm sure the thread ID is correct. Also tried with postId conditional only but that didn't work either.
 
Ok so it's $thread.thread_id and not $threadId like it's in the resource. $thread.thread_id works at least in xf 1.3.4.
 
Top Bottom