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

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

Mr Lucky

Well-known member
#1
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:

Mr Lucky

Well-known member
#2
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>
 

Mr Lucky

Well-known member
#4
Ok thanks.

I tried combining them but got it wrong as I received an error. can you please tell me how to combine them properly?

Thanks