XF 1.2 Advertisements for guests under first posts on a page?


Active member
I hope the title is easy to explain. >_<

I'd like to have advertisements under the first post of each topic... Maybe possible under the first post of each page... Or maybe the middle post on each page? I don't know.

I searched for it before on Google and found a post that Brogan made, but now I can't find it.

<xen:if is="!{$visitor.user_id}">
This content will show to guests
You got that code, so how do I modify it to make an ad work under a certain post for guests only?

I would appreciate the help. :)


XenForo moderator
Staff member
I use this:
<xen:if is="!{$visitor.user_id}">
    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND {$thread.reply_count} > 0">
You could combine the two xen:if statements but I have left them separate in case I ever want to easily change the visitor criteria.