XF 1.3 Inserting ad within the thread

Jeff Fuqua

Well-known member
I had been using this code on a previous style (non-responsive) and it has worked well. Now, with a responsive style, it's creating some strange results. For example, if I produce the 6th post in a thread, and hit the submit button, I am taken to a new screen where it will be either blank or contains the ad.

Here's what I am using:

<xen:hook name="ad_message_below" />
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 5">
<table style="background-color: #f5f7f8;" width="100%" border="0" cellspacing="0" cellpadding="0">
<td style="padding-top: 15px; padding-bottom: 0px;"><div align="center"><div style="float:middle;">
<!-- BEGIN RICH-MEDIA Burst Media CODE -->
<script type="text/javascript" language="JavaScript">
rnum=Math.round(Math.random() * 100000);
if (window.self != window.top) {nf=''} else {nf='NF/'};
document.write(ts+'script src="http://www.burstnet.com/cgi-bin/ads/ad12798a.cgi/v=2.3S/sz=300x250A/NZ/'+rnum+'/'+nf+'RETURN-CODE/JS/">'+ts+'/script>');
</script><noscript><a href="http://www.burstnet.com/ads/ad12798a-map.cgi/ns/v=2.3S/sz=300x250A/" target="_top">
<img src="http://www.burstnet.com/cgi-bin/ads/ad12798a.cgi/ns/v=2.3S/sz=300x250A/" border="0" alt="Click Here" /></a>
<!-- END Burst Media CODE --></div>
<div style="clear:both"></div>
Anything stand out as being something which might cause some issues?


Well-known member
I had the blank page issue too and I added the following to prevent it:

<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 5 AND {$firstPost} AND !{$message.conversation_id}">