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 below first post

Discussion in 'Styling and Customization Questions' started by Jens1986, Jun 16, 2014.

  1. Jens1986

    Jens1986 Active Member

    Hi,

    I want to show an adsense ad below the first post on every page in a thread. However I allready have an ad above the quick reply button and I dont want two ads to show up immideatly after each other.

    I have 20 posts on each page of a thread. So if the number of replies is 0, 21, 41, 61.. etc I dont want the ad to show. How do I do this? Is there some code I can wrap around? And what template do I put it in?

    Appreciate all help. Thanks :) :)
     
    Last edited: Jun 16, 2014
  2. Jens1986

    Jens1986 Active Member

    nobody? :(
     
  3. Tracy Perry

    Tracy Perry Well-Known Member

    Have you referred to this resource?
    From what I can see it's answered about midways down and entitled "How can I show content after the first post on every page in a thread?"

    Have you read through the discussions in said resource?
    I believe you would use one of the ad templates that are in existence and modify it with the code... probably ad_message_below (that's what I use).
     
    Last edited: Jun 17, 2014
  4. Jens1986

    Jens1986 Active Member

    Thank you.

    This is the code:
    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !{$message.conversation_id}">
    This content will show after the first post on every page
    </xen:if>


    However, as I said I dont want the ad to show up if there are only 1 post, 21 posts, 41 posts, 61 posts etc. in the thread, because I allready have an ad over the quick reply, and I dont want two ads immideatly after each other.
     
  5. Tracy Perry

    Tracy Perry Well-Known Member

    What exactly are you referring to as the "Quick Reply". I don't have a "Quick Reply" and don't see one on this site either.
    Are you using a custom style?
    A screen cap would help (or a link to your site so that others can see exactly what you mean).
    The same theory should work but you need to add an array in there (and it could be lengthy depending on the number of pages - just think if you have a 300 page topic).
    The ad_message_below should be placing the ads something like this:
    Screen Shot 2014-06-17 at 2.17.36 PM.png

    Are you talking about the typical "Post Reply" submission.
     
  6. Jens1986

    Jens1986 Active Member

    By over the quick reply I mean between the last post on the page and the reply text field (the one I am typing in now lol).

    So here is what i want.

    Post #1
    Ad after first post on page
    Post #2
    Post #4
    ...
    Post #20
    Ad after last post
    Reply text field

    Problem is, when I hit page two it will look like this:

    Post #21
    Ad after first post on page
    Ad after last post
    Reply text field

    My forum is at http://alopeci.info, but i currently only have an ad after the last post (that I reffered to as "above quick reply" earlier)

    Thanks for all your help.
     
  7. Tracy Perry

    Tracy Perry Well-Known Member

    Use an array instead of after the first post on each page in the ad_message_below template.
    Probably something similar to
    Code:
    How can I show content after post x on every page in a thread?
    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == x">
    This content will show after post x on every page
    </xen:if>
    with X being the # of the post you want it to show on (in an array)... will get messy and as your threads increase in number of posts you may have to edit the array.

    Probably would be better served with a custom code from an add-on.... or move the ad from where it is into the footer where most people place them.
     
  8. Jens1986

    Jens1986 Active Member

    Thanks a lot for all the help u give me :)

    So I can do it like this? {$xenOptions.messagesPerPage} == 20, 40, 60, 80">?
     
  9. Tracy Perry

    Tracy Perry Well-Known Member

    Should work as that code was from Brogan's resource that puts it after a set message (the X) on a page... so an array should work fine in there also.
     

Share This Page