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

XF 1.4 Ads under several different posts in thread

Discussion in 'Styling and Customization Questions' started by dave11, Jan 28, 2015.

  1. dave11

    dave11 New 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'.
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    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))">
     
  3. dave11

    dave11 New Member

    Thank you, works like charm.
     
  4. Jens1986

    Jens1986 Active Member

    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: Jan 29, 2015
  5. Brogan

    Brogan XenForo Moderator Staff Member

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

    Jens1986 Active Member

    Still only shows on page 1

    Edit: this works:
    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 OR {$post.position} % {$xenOptions.messagesPerPage} == 1">
     
    Last edited: Jan 29, 2015
  7. Jens1986

    Jens1986 Active Member

    How do i Prevent this from showing on private messages?
     
  8. Brogan

    Brogan XenForo Moderator Staff Member

Share This Page