XF 1.3 After the 11th Post on every thread page

akia

Well-known member
Can someone help me with what condition I'd use to show something after the 15th post on every page of a thread but only on threads, not conversations.

Thanks in advance.
 
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 14 AND !{$message.conversation_id}">

Not sure if you mean 11 or 15, as the thread title differs from the post content.
 
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 14 AND !{$message.conversation_id}">

Not sure if you mean 11 or 15, as the thread title differs from the post content.
Can this be used in the header template, or something equivalent,the problem with using dfp is that along with the ad slot on the page I need to put code in the header, which I don't want to be calling if the ad isn't going to be displayed.
 
Why do you need to put it in the header if it's only going to display in the thread view?
Because the DoubleClick code comes in two parts, the part in the head, and the part in the template:

this is what I currently have in my head at the moment:

Code:
<script type='text/javascript'>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function() {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
</script>

<script type='text/javascript'>
googletag.cmd.push(function() {
googletag.defineSlot('/xxxx/on_ad_above_content_guests', [[234, 60], [468, 60], [728, 90]], 'div-gpt-ad-1425417951975-0').defineSizeMapping(mappingad_above_content).addService(googletag.pubads());
googletag.defineSlot('/xxxx/on_ad_below_bottom_breadcrumb_guests', [[234, 60], [468, 60], [728, 90]], 'div-gpt-ad-1425417951975-1').defineSizeMapping(mappingad_below_bottom_breadcrumb).addService(googletag.pubads());
<xen:if is="{$contentTemplate} == 'thread_view'">googletag.defineSlot('/xxxx/on_ad_message_below_guests', [[234, 60], [468, 60], [728, 90]], 'div-gpt-ad-1425417951975-2').defineSizeMapping(mappingad_message_below).addService(googletag.pubads());</xen:if>
<xen:if is="in_array({$contentTemplate}, array('forum_list','member_notable','online_list'))">googletag.defineSlot('/xxxx/on_ad_sidebar2_guests', [250, 250], 'div-gpt-ad-1425417951975-3').addService(googletag.pubads());</xen:if>
<xen:if is="in_array({$contentTemplate}, array('forum_list','member_notable','online_list'))">googletag.defineSlot('/xxxxx/on_ad_sidebar_guests', [250, 250], 'div-gpt-ad-1425417951975-4').addService(googletag.pubads());</xen:if>
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
 
Back
Top Bottom