XF 1.3 Ad in the first and last post on each page

dojo

Active member
Another question from me :)

I need to show ads in the first and last post. The first post worked with this conditional:
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !{$message.conversation_id}">

The ads show in the first post on each page of the thread.

Was able to do something 'weird' and show it for the last one (if it's a 'full' page - 20 posts) with this one:
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !{$message.conversation_id}">

It's not quite orthodox, but it did the job.
On the pages where there are less than 20 messages, the second ad doesn't show.

So .. what I need to accomplish:
Show the ad on EACH page in the first and last post (if there's just one post, I need to show only one banner).
Is there a conditional that would allow me to do this?
Thank you.
 
Back
Top Bottom