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

XF 1.4 Multiple ads under conversation

NeoCHI

Active member
#1
I'm currently using:

Code:
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0">
Adsense code
</xen:if>
within the ad_message_below template to put ads under the first post of each thread view page. It's working perfectly fine for the thread view page but for conversations it's causing an ad to be post under every message...what am I doing wrong?
 

Tracy Perry

Well-known member
#2
within the ad_message_below template to put ads under the first post of each thread view page. It's working perfectly fine for the thread view page but for conversations it's causing an ad to be post under every message...what am I doing wrong?
Have you reviewed the resource by Brogan?

How can I show content after the first message on every page in a conversation?
<xen:if is="{$conversation} AND {$message.position_on_page} == 1">
This content will show after the first message on every page
</xen:if>




How can I show content after the first post on every page in a thread?
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !{$message.conversation_id}">
This content will show after the first post on every page
</xen:if>


Looks to be the two you need to be working with in an if/else setup.