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

XF 1.5 Conditional to show ad after fifth post ONLY if the thread has 7 messages or more

Discussion in 'Styling and Customization Questions' started by LaxmiSathy, Mar 16, 2016.

  1. LaxmiSathy

    LaxmiSathy Member

    Hello,

    I have Messages per Page set at : 10
    and I would want to show ad after fifth post and I understand the conditional for the same as :

    Code:
    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 5">
    Code for Ad here
    </xen:if>
    but I would want to include additional conditional where I want to show the ad after fifth post ONLY if the thread has 7 messages or more.
    Can anyone help me tweak the above conditional.
    Thanks.
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Add:
    Code:
    AND {$thread.reply_count} > 5
     
  3. Liam W

    Liam W Well-Known Member

    Wouldn't it be > 6 (the 6 replies + the 1st post = 7).

    Liam
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Greater than 5 = 6, + the first post = 7.
     
    LaxmiSathy and Liam W like this.
  5. Liam W

    Liam W Well-Known Member

    I'm still tired. I need more caffeine it would seem...

    Liam
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    Or maths* practice ;)


    * Suppose I'd better get used to incorrectly calling it math soon ...
     
    Amaury likes this.
  7. Liam W

    Liam W Well-Known Member

    Nah, I'm doing A2 maths...

    You could still call it maths... You just have to get used to people using it incorrectly around you.

    Liam
     

Share This Page