XF 1.4 Ads under several different posts in thread

dave11

Member
Hi,

Within this condition:

Code:
<xen:if is="{$post.position} == 0">

How do I combine several different post position of 0 + 5 + 10 ?(instead of putting 3 rules).

Thanks'.
 
The simplest way is:
Code:
<xen:if is="{$post.position} == 0 OR {$post.position} == 5 OR {$post.position} == 10">

If you want to use an array:
Code:
<xen:if is="in_array({$post.position}, array(0, 5, 10))">
 
I want an ad in the ad_message_body on the 1st and 2nd post on each page. Currently I use this:

Code:
<xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 OR {$post.position} == 1">

This only works on page 1, on other pages of the thread the ad only shows up in the 1st post. Any way to fix this? @Brogan
 
Last edited:
Back
Top Bottom