• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Conditionals... again

Ray

Active member
#1
I need to display a message in the first post of every thread in all forums, except forum 1, 2, and 3.

Thanks :)
 

Jake Bunce

XenForo moderator
Staff member
#2
Use this condition:

Code:
<xen:if is="{$post.position} == 0 AND !in_array({$thread.node_id}, array(1,2,3))">

</xen:if>
Or this one will show in the first post on every page of the thread (as opposed to just the first page like the previous condition):

Code:
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !in_array({$thread.node_id}, array(1,2,3))">

</xen:if>
edit - these conditions work in the post and message templates. Or you can use the ad_message_body template which is more convenient.