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

XF 1.3 Ad position below 1st and 5th post of a thread

Discussion in 'Styling and Customization Questions' started by Mr Lucky, Apr 28, 2014.

  1. Mr Lucky

    Mr Lucky Well-Known Member

    I have an ad below the 1st post of each page of a thread using the conditional in ad_message_below

    Code:
    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !{$message.conversation_id}">
    <xen:if is="{xen:helper ismemberof, $visitor, 3}">
    <!-ad code here-->
    </xen:if></xen:if>
    
    
    But how can I also get an ad below the 5th (or whatever) post as well as the 1st?

    Thanks
     
    Last edited: Apr 28, 2014
  2. Mr Lucky

    Mr Lucky Well-Known Member

    After a bit of trial and error this works, but is this the best way?

    Code:
    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !{$message.conversation_id}">
    <xen:if is="{xen:helper ismemberof, $visitor, 3}">
    <!-ad code here-->
    </xen:if></xen:if>
    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 3 AND !{$message.conversation_id}">
    <xen:if is="{xen:helper ismemberof, $visitor, 3}">
    <!-ad code here-->
    </xen:if></xen:if>
     
  3. Brogan

    Brogan XenForo Moderator Staff Member

    You could combine the statements but that's fine.
     
  4. Mr Lucky

    Mr Lucky Well-Known Member

    Ok thanks.

    I tried combining them but got it wrong as I received an error. can you please tell me how to combine them properly?

    Thanks
     

Share This Page