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

Ads under first post but not conversations?

Discussion in 'XenForo Questions and Support' started by karoshio, Mar 29, 2012.

  1. karoshio

    karoshio Active Member

    So,

    I'm using

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

    </xen:if>

    To display an add under only the first post each post and each page of each post but I now noticed this also displays in conversations..

    Is there any way to avoid this as it just looks really bad in conversations and if you have a smaller monitor the ad goes under the sidebar.
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

  3. karoshio

    karoshio Active Member

  4. Brogan

    Brogan XenForo Moderator Staff Member

    Change the x to a 0.
     
    karoshio likes this.
  5. Diablotic

    Diablotic Active Member

    To extend that - how would the line look like if I wanted to show ads after first post AND after first conversation message?
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    Just remove the check for the conversation message, like so:

    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == x">

    That will work after the first post on every page.
     
  7. Diablotic

    Diablotic Active Member

    Hmm this will show ads under EVERY conversation message but I want it to show only under the first one
     
  8. bump, i'd like to know aswell.

    I want a code that will display an ad under only the first post and disable it for more than one group so it will show to everyone besides my 2 donator groups. Thanks!
     
  9. Brogan

    Brogan XenForo Moderator Staff Member

    There is a link to my conditional resource in my signature.
     
  10. Russ

    Russ Well-Known Member

    Bumping this... using Brogan's reference here:

    Code:
    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == x">
    
    In conversations it'll display in every message, any hint to this at all?
     
  11. Brogan

    Brogan XenForo Moderator Staff Member

    What do you want to do?
     
  12. Russ

    Russ Well-Known Member

    Sorry, display inside the first post on every page, that snippit I provided works for regular forum threads, but in conversations it shows on every single message.

    EDIT: And yes the goal would be to show in every regular thread + conversations on the first post of every page.


    I guess @Diablotic had the same problem but it was never answered in this thread.

    http://xenforo.com/community/threads/ads-under-first-post-but-not-conversations.29790/#post-501183
     
    Last edited: Nov 5, 2013
  13. mbt131

    mbt131 Member

    I am using these.I want to show my ads every page's first message body and below ? How can I do it?

    ad_message_below <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND {$thread.reply_count} > 0">
    ad_message_body <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !{$message.conversation_id}">
     
  14. Brogan

    Brogan XenForo Moderator Staff Member

    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND {$thread.reply_count} > 0 AND !{$message.conversation_id}">
     
  15. mbt131

    mbt131 Member

    Same as mine right?
     
  16. Brogan

    Brogan XenForo Moderator Staff Member

    I don't really understand what you're asking but that single conditional statement incorporated both of yours.
     
  17. surfsup

    surfsup Well-Known Member

    Any update to this? It would be awesome if we could get the banner ad under the 1st post in thread and 1st post in conversations, cause right now the ad will appear under each post in convos....any fix?
     
  18. Brogan

    Brogan XenForo Moderator Staff Member

    Conversations messages don't have IDs so it's not possible.
     
  19. Beanjam

    Beanjam Active Member

    Could somebody please tell me the difference between these? I've seen both ways mentioned.

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

    ... or ...

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

    Brogan XenForo Moderator Staff Member

Share This Page