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

No ad on login page

LPH

Well-known member
#1
Hi,

The ads should not show on the login page or create thread page. This is my current code for the template ad_above_content. What should be changed to keep the ad off the login page?

Code:
<xen:if is="{$contentTemplate} != 'thread_create'">
 
<xen:hook name="ad_above_content" />
 
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-xxxxx";
/* Tux Reports Network */
google_ad_slot = "xxxxx";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
 
</xen:if>

This keeps it off the login page.

Code:
<xen:if is="{$contentTemplate} != 'login'">
 
<xen:hook name="ad_above_content" />
 
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-xxxxx";
/* Tux Reports Network */
google_ad_slot = "xxxxx";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
 
</xen:if>
So - how do I combine the xen:if statements?

is is xen:if and xen:if else ...?

Update: Figured it out. I was using the OR and should have used AND

Code:
<xen:if is="{$contentTemplate} != 'thread_create' AND {$contentTemplate} != 'login'">
 

Jake Bunce

XenForo moderator
Staff member
#2
This syntax is more easily extended:

Code:
<xen:if is="!in_array({$contentTemplate}, array('thread_create', 'login'))">