XF 1.1 Thread Creator Template Conditional

Brent W

Well-known member
I need to have a conditional that won't show advertisements on threads created by a certain userid.
 
Hmm this doesn't appear to work.

Code:
<xen:if is="{$thread.user_id} != 6859">
<xen:if is="!{xen:helper ismemberof, $visitor, 9}">
<!-- book_160x600 -->
<div id='div-gpt-ad-1362983438283-0' style='width:160px; height:600px;'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1362983438283-0'); });
</script>
</div>
</xen:if>
</xen:if>

That still shows advertisements for threads started by that member.
 
Just checked with Mike and he suggested something like this.

<xen:container var="$isThreadOwner">{xen:if '{$thread.user_id} == {$visitor.user_id}', 1}</xen:container>

Then just <xen:if is="{$isThreadOwner}"> in the container.

He also said to name the variable $hideAd or something so a different condition could be applied elsewhere and it would make sense.
 
Back
Top Bottom