You need to define ALL the nodes you don't want it to display in... probably with an array. Refer to @Brogan's excellent resource at http://xenforo.com/community/resources/conditional-statements.1604/Hello, thanks!
The problem is that it does not work for sub forum.
Exemple :
Forum 1 (Ads ok)
Forum 2 (Ads ok)
Forum 23 (No ads)
Sub 24 (no ads)Forum 128 (ads ok)
Sub 25 (no ads)
etc... (no ads)
Thanks for u help
<xen:if is="{$post.position} == 0 AND {$conversation.first_message_id} == {$message.message_id}">
<li class="message">
<div class="messageUserInfo">
<div class="messageUserBlock">
<div class="avatarHolder"><span class="avatar av2m"><img src="/1.jpg?1379939746" width="96px" height="96px"></span></div>
<h3 class="userText">
Monsieur
<em class="userTitle" itemprop="title">Pub</em>
</h3>
<span class="arrow"><span></span></span>
</div>
</div>
<div class="messageInfo primaryContent">
<div class="messageContent">
<blockquote class="messageText ugc baseHtml">
<div align="center">
<!-- DEBUT DU SCRIPT SLIDER -->
<xen:if is="{$forum.node_id} != 23">
<a href="http://www.URL/" onclick="javascript:_paq.push(['trackPageView', '2emepost']);" target="blank"><img src="IMG.gif" height="170" width="100%" alt="cigarette electronique"/></a>
</xen:if>
test
<!-- FIN DU SCRIPT SLIDER -->
</div>
</blockquote>
</div>
</div>
</li>
</xen:if>
<xen:if is="{$forum.node_id} != 23">
<xen:if is="{$post.position} == 0 AND {$conversation.first_message_id} == {$message.message_id}">
<li class="message">
<div class="messageUserInfo">
<div class="messageUserBlock">
<div class="avatarHolder"><span class="avatar av2m"><img src="h1.jpg?1379939746" width="96px" height="96px"></span></div>
<h3 class="userText">
Monsieur
<em class="userTitle" itemprop="title">Pub</em>
</h3>
<span class="arrow"><span></span></span>
</div>
</div>
<div class="messageInfo primaryContent">
<div class="messageContent">
<blockquote class="messageText ugc baseHtml">
<div align="center">
<!-- DEBUT DU SCRIPT SLIDER -->
<a href="" onclick="javascript:_paq.push(['trackPageView', '2emepost']);" target="blank"><img src="s2eme.gif" height="170" width="100%" alt="cigarette electronique"/></a>
<!-- FIN DU SCRIPT SLIDER -->
</div>
</blockquote>
</div>
</div>
</li>
</xen:if>
</xen:if>
Let me get straight on what you want - no ads displayed in forum node #23 and all the associated sub-forums under node 23?@Brogan
Sorry for my English, but if I understand you told me to wrap all the code in the variable, so I made this, but it does not work.
where (x,y,z) will be the nodes that you do NOT WANT it displayed in.When working with arrays, the ! is placed just before the argument.
For example, <xen:if is="in_array({$forum.node_id}, array(x, y, z))"> for true, <xen:if is="!in_array({$forum.node_id}, array(x, y, z))"> for false.
@Brogan, I am aware of that but I'm basing the array on his statement of "I would like the advertising does not appear in the forum: 23 and all sub forums: 23" ,which I understood to be inclusive of node 23 and all the nodes he has listed under that one (he gives a more detailed descriptor in post #3 in this topic). In that case (it being more than 1 node) would not an array be required (or multiple statements for each node in the format you provided)?An array is only required if multiple IDs are going to be entered.
As it is, he only wants to stop them showing in one node (23) so the simple condition will suffice: <xen:if is="{$forum.node_id} != 23">
Suggestion... how about adding that nice little snippet into your resource on conditional statements. It's one that I wasn't aware of and probably would be useful to several folks.Hmm, I didn't get that from his posts but perhaps you are right.
In which case, perhaps the parent conditional will work (along with the node itself)?
<xen:if is="{$forum.parent_node_id} != x">
As I run off to implement some stuff on my site. I can't believe that I overlooked that.
We use essential cookies to make this site work, and optional cookies to enhance your experience.