Contitional based on total number of posts in a thread

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Trommsdorff
    Member
    • Apr 2002
    • 92

    Contitional based on total number of posts in a thread

    Is it possible to show an ad (a horizontal skyscraper) only if, for example, 10 or more posts are within a certain thread? I have the space already setup in the showthread templates, but need a conditional to only show the ads if there are enough posts to guarantee the thread is long enough.
  • Trommsdorff
    Member
    • Apr 2002
    • 92

    #2
    TTT - any help here?

    Comment

    • Lats
      Senior Member
      • Mar 2002
      • 3671

      #3
      Check post# 2 here...
      Edit this template: Admin CP -> Styles & Templates -> Style Manager -> « » -> Postbit Templates -> postbit or postbit_legacy (depending on which layout you are using) Add this code to the very bottom of the template: <if condition="$post[postcount] == 1"> $spacer_open <div
      Lats...

      Comment

      • Trommsdorff
        Member
        • Apr 2002
        • 92

        #4
        Originally posted by Lats

        Oops - - I made a mistake in the first post. I wrote "horizontal skyscraper," but I meant "Vertical skyscraper."

        The post you are referring to puts ads in between posts. I need an ad to show on the SIDE of the posts IF the # of posts (and hence the length of the screen) is higher than a certain number.

        Even better would be if the # of posts ON THAT PAGE is higher than a certain number. I hope this makes sense.

        Consider a site with a 120x600 ad on the left site. If there is one post, it looks funny as the ad is MUCH longer than the posts. If there are 10 posts on that page, it looks OK.

        Comment

        • Trommsdorff
          Member
          • Apr 2002
          • 92

          #5
          Ttt.

          Comment

          • Trommsdorff
            Member
            • Apr 2002
            • 92

            #6
            Ttt

            Comment

            • Lats
              Senior Member
              • Mar 2002
              • 3671

              #7
              You said you needed a conditional, did you check the conditional Jake used?

              What does Ttt mean?
              Lats...

              Comment

              • Trommsdorff
                Member
                • Apr 2002
                • 92

                #8
                That conditional that Jake used addresses the total number of posts in the thread. I really need the total number of posts displayed on a certain page.

                TTT = to the top.

                Comment

                • Lats
                  Senior Member
                  • Mar 2002
                  • 3671

                  #9
                  Try something like this...
                  Code:
                  <if condition="($post[postcount]-1) % $GLOBALS[perpage] == 0">
                       <if condition="($GLOBALS[totalposts] - $post[postcount]) > 10">skyscraper here
                       <else />no room
                       </if>
                  </if>
                  Lats...

                  Comment

                  • cclaerhout
                    Member
                    • Aug 2004
                    • 63
                    • 3.5.x

                    #10
                    Originally posted by Lats
                    Try something like this...
                    Code:
                    <if condition="($post[postcount]-1) % $GLOBALS[perpage] == 0">
                         <if condition="($GLOBALS[totalposts] - $post[postcount]) > 10">skyscraper here
                         <else />no room
                         </if>
                    </if>
                    Works great !
                    But i haven't understand anything. If you've got time, can you explain your code step by step ?

                    Thank you

                    Comment

                    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                    Working...
                    😀
                    😂
                    🥰
                    😘
                    🤢
                    😎
                    😞
                    😡
                    👍
                    👎