XF 1.3 Ad position below 1st and 5th post of a thread

Mr Lucky

Well-known member
I have an ad below the 1st post of each page of a thread using the conditional in ad_message_below

Code:
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !{$message.conversation_id}">
<xen:if is="{xen:helper ismemberof, $visitor, 3}">
<!-ad code here-->
</xen:if></xen:if>

But how can I also get an ad below the 5th (or whatever) post as well as the 1st?

Thanks
 
Last edited:
After a bit of trial and error this works, but is this the best way?

Code:
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !{$message.conversation_id}">
<xen:if is="{xen:helper ismemberof, $visitor, 3}">
<!-ad code here-->
</xen:if></xen:if>
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 3 AND !{$message.conversation_id}">
<xen:if is="{xen:helper ismemberof, $visitor, 3}">
<!-ad code here-->
</xen:if></xen:if>
 
Back
Top Bottom