How do I add a random banner after the first post of a thread?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • djwins
    New Member
    • Jan 2004
    • 21

    #31
    Now, this is the money shot...I tried to fake it but I couldn't get it to work.
    I thought this would do it.
    Code:
     <if condition="$post[postcount] % 10 == 0 OR $post[postcount] == 1 && !$bbuserinfo[userid]">
    How do you get the ads to display with all the following criteria:
    1) To guests
    2) after first post
    3) every 10 posts

    Thanks!
    Last edited by djwins; Wed 3 Aug '05, 5:29pm.

    Comment

    • Jake Bunce
      Senior Member
      • Dec 2000
      • 46598
      • 3.6.x

      #32
      Add the purple code:

      Code:
      <if condition="[color=blue]$post[postcount] % 10 == 0[/color] [color=green]OR $post[postcount] == 1[/color] [color=purple]AND !$bbuserinfo[userid][/color]">
      
      $spacer_open
      <div style="padding:0px 0px $stylevar[cellpadding]px 0px">
      
      <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
      <tr>
      	<td class="thead" align="left">Sponsored Links</td>
      </tr>
      <tr>
      	<td class="alt1" align="center">
      		[color=red]BANNER CODE HERE[/color]
      	</td>
      </tr>
      </table>
      
      </div>
      $spacer_close
      
      </if>

      Comment

      • djwins
        New Member
        • Jan 2004
        • 21

        #33
        Jake,
        I tried the code and it is showing ads (every 10 posts) to logged in users.
        Thanks!

        Comment

        • Jake Bunce
          Senior Member
          • Dec 2000
          • 46598
          • 3.6.x

          #34
          I am running out of colors!

          Try adding the orange code (parenthesis):

          Code:
          <if condition="[color=orange]([/color][color=blue]$post[postcount] % 10 == 0[/color] [color=green]OR $post[postcount] == 1[/color][color=orange])[/color] [color=purple]AND !$bbuserinfo[userid][/color]">
          
          $spacer_open
          <div style="padding:0px 0px $stylevar[cellpadding]px 0px">
          
          <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
          <tr>
          	<td class="thead" align="left">Sponsored Links</td>
          </tr>
          <tr>
          	<td class="alt1" align="center">
          		[color=red]BANNER CODE HERE[/color]
          	</td>
          </tr>
          </table>
          
          </div>
          $spacer_close
          
          </if>

          Comment

          • djwins
            New Member
            • Jan 2004
            • 21

            #35
            Success!

            Thanks a lot, you are the wind beneath my wings!

            Comment

            • beano33
              Member
              • Jun 2003
              • 89

              #36
              I'm displaying an ad after first post in a thread using the postbit. I'd also like to show an ad after the last post using showthread. Seems simple enough, but it gets tricky. The ads can not be displayed on the same page or it will be a TOS violation. I need a conditional so the ad after the last post will not display when an ad after the first post is shown. In other words whatever ad code I put in showthread has to be blocked if the code in the postbit is being displayed. Anyone know how to do this? Thanks!

              Comment

              • Jake Bunce
                Senior Member
                • Dec 2000
                • 46598
                • 3.6.x

                #37
                Originally posted by beano33
                I'm displaying an ad after first post in a thread using the postbit. I'd also like to show an ad after the last post using showthread. Seems simple enough, but it gets tricky. The ads can not be displayed on the same page or it will be a TOS violation. I need a conditional so the ad after the last post will not display when an ad after the first post is shown. In other words whatever ad code I put in showthread has to be blocked if the code in the postbit is being displayed. Anyone know how to do this? Thanks!
                So it will be on every page except the first page?

                In the SHOWTHREAD template:

                Code:
                <if condition="$pagenumber > 1">
                
                </if>

                Comment

                • beano33
                  Member
                  • Jun 2003
                  • 89

                  #38
                  Thanks Jake, that's just what I was looking for.

                  Comment

                  • jmvb
                    Senior Member
                    • Jan 2005
                    • 259
                    • 3.0.6

                    #39
                    It appears these instructions are not for 3.5 RC3 given the many users having problems with it at vbulletin.org

                    Comment

                    • Jake Bunce
                      Senior Member
                      • Dec 2000
                      • 46598
                      • 3.6.x

                      #40
                      I haven't had to chance to port this to version 3.5. I will probably update all of my template mods after the final release.

                      Comment

                      • hdtvoice
                        Member
                        • Jun 2003
                        • 60

                        #41
                        crap, i was just about to upgrade to vbulletin 3.5.3... but since i have these hacks installed, should i not do it now?

                        Comment

                        • hdtvoice
                          Member
                          • Jun 2003
                          • 60

                          #42
                          any devs help me?

                          i have these mods installed to show the banners... but im running 3.0.8

                          can i upgrade t 3.5 without any issues?

                          Comment

                          • Jose Amaral Rego
                            Senior Member
                            • Feb 2005
                            • 11058
                            • 1.1.x

                            #43
                            Do a check to see what you have and compare to see if your custom coding has been updated to vb3.5.3 and check www.vbulletin.org if you have hacks.

                            Comment

                            • h2ojunkie
                              New Member
                              • Jul 2004
                              • 21

                              #44
                              Ok, I've got one.

                              I'd like to show a banner between the last, and 2nd to last post on every page of a thread, no matter how long the thread is, or what the user has selected in their options for max posts.

                              For example.

                              Forum default setting for max posts is 10

                              User A has set their options to display max of 40 posts.

                              Thread A is 6 posts long - the ad should show between post 5 and 6

                              Thread B is 1 post long - the ad should show directly after the 1st post since there is only one post in this thread

                              Thread C is 50 posts long - For a guest, the add would show on page one between post 9 and 10, on page 2 between posts 19 and 20 (which would be the 9th and 10th posts shown on that page), and so on.
                              For User A that has max posts set to 40, the ad would show between posts 39 and 40 on page one, and between posts 49 and 50 on page 2 (which would be the 9th and 10th posts shown on that page)

                              Basically, I'm looking for a way to show an add as the 2nd to last post no matter what page they are on, what their max post options are set to, and if the thread is only 1 post long, the ad would still show right after the 1st post until more posts are made in that thread.

                              Comment

                              • toolmanwill
                                New Member
                                • Feb 2005
                                • 8
                                • 3.0.6

                                #45
                                Ok i made the edit to have this show every 1st post and to array of users but its still showing for everyone, i need it to show for only usergroup ids 2, 5 and 6 abd coded it accordingly but it still shows for everyone.

                                Thanks in advance.

                                Comment

                                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                                Working...