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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hdtvoice
    Member
    • Jun 2003
    • 60

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

    sort of like they have at dvdtalk after the first post in the thread..

    they have sponsored goodle links, but I want my own random banners...

    example

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

    #2
    I just created this thread that explains how to do this.

    As for displaying your own random banners... you will probably find some banner rotation systems on www.vbulletin.org, the official vB hacking site.

    Comment

    • hdtvoice
      Member
      • Jun 2003
      • 60

      #3
      any way you can have this only shown to unregistered members?

      Comment

      • hdtvoice
        Member
        • Jun 2003
        • 60

        #4
        and anyway you can make this shown after the 3rd or so reply to the message?

        Comment

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

          #5
          Originally posted by hdtvoice
          any way you can have this only shown to unregistered members?
          Add the blue code:

          Code:
          <if condition="$post[postcount] == 1 [color=blue]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>
          Originally posted by hdtvoice
          and anyway you can make this shown after the 3rd or so reply to the message?
          Change the number in green:

          Code:
          <if condition="$post[postcount] == [color=green]1[/color] [color=blue]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

          • hdtvoice
            Member
            • Jun 2003
            • 60

            #6
            Thanks!..

            one more thing..

            what is the code to only show these ads to everyone but 3 specific groups (mods, admin, donators)?

            Comment

            • hdtvoice
              Member
              • Jun 2003
              • 60

              #7
              one last thing...

              how would i go about adding more than one of these per thread? say I currently have it showing the banner after the third post, and I wanted it to load the banner code again after the 6th post as well..... basically, every three posts to a thread would show a new banner.... can this be done?

              Comment

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

                #8
                Originally posted by hdtvoice
                what is the code to only show these ads to everyone but 3 specific groups (mods, admin, donators)?
                If the 3 groups are all primary groups, then use this blue code instead:

                Code:
                <if condition="$post[postcount] == [color=green]1[/color] [color=blue]AND !in_array($bbuserinfo[usergroupid], array(X,Y,Z))[/color]">
                If some are secondary groups, then use this expanded blue code:

                Code:
                <if condition="$post[postcount] == [color=green]1[/color] [color=blue]AND !is_member_of($bbuserinfo, X) AND !is_member_of($bbuserinfo, Y) AND !is_member_of($bbuserinfo, Z)[/color]">
                Where X, Y, and Z are the usergroupids of the 3 groups.

                Originally posted by hdtvoice
                how would i go about adding more than one of these per thread? say I currently have it showing the banner after the third post, and I wanted it to load the banner code again after the 6th post as well..... basically, every three posts to a thread would show a new banner.... can this be done?
                Replace the first part of the condition (shown in red):

                Code:
                <if condition="[color=red]$post[postcount] == 1[/color] [color=blue]AND !in_array($bbuserinfo[usergroupid], array(X,Y,Z))[/color]">
                ...with the new red code:

                Code:
                <if condition="[color=red]$post[postcount] % 3 == 0[/color] [color=blue]AND !in_array($bbuserinfo[usergroupid], array(X,Y,Z))[/color]">

                Comment

                • bchawla
                  Senior Member
                  • Jul 2004
                  • 176
                  • 3.8.x

                  #9
                  If a thread has 4 pages, does this show the advertisements after each 1st post on each thread

                  or the first post of the whole thread.
                  Last edited by bchawla; Wed 15 Dec '04, 6:11pm.
                  Done with vB3 and Internet Brands...Moved on to xenForo. PM me if u want to buy my VB License

                  Comment

                  • Roxie
                    Member
                    • May 2002
                    • 70
                    • 3.6.x

                    #10
                    It shows only on the first page. I have it and it works great. Cheers.

                    Comment

                    • Ramiro S
                      Member
                      • Apr 2003
                      • 48
                      • 3.6.x

                      #11
                      How can I make it work after the first post in every thread page?

                      Comment

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

                        #12
                        Originally posted by Ramiro S
                        How can I make it work after the first post in every thread page?
                        Use something like the previous code I posted, except change the red section to this:

                        Code:
                        <if condition="[color=red]$post[postcount] % $vboptions[maxposts] == 1[/color] [color=blue]AND !in_array($bbuserinfo[usergroupid], array(X,Y,Z))[/color]">
                        That should work.

                        Comment

                        • Ramiro S
                          Member
                          • Apr 2003
                          • 48
                          • 3.6.x

                          #13
                          Thank you very much... I was hacking the showthread.php to add a line but this is better.

                          Comment

                          • AlexanderT
                            Senior Member
                            • Mar 2003
                            • 992

                            #14
                            Originally posted by Jake Bunce
                            Use something like the previous code I posted, except change the red section to this:

                            Code:
                            <if condition="[color=red]$post[postcount] % $vboptions[maxposts] == 1[/color] [color=blue]AND !in_array($bbuserinfo[usergroupid], array(X,Y,Z))[/color]">
                            That should work.
                            It is not working correctly. For instance, if a user chooses 40 posts / page, the ad will be placed fine on the first page, but it will be misplaced on the following pages (i.e. does not appear after the 1st post of each page).

                            Comment

                            • daemon
                              Senior Member
                              • Jun 2003
                              • 2351
                              • 3.5.x

                              #15
                              Try using this conditional instead:

                              Code:
                              <if condition="[color=red]$post['postid'] == $GLOBALS['FIRSTPOSTID'][/color] AND !in_array($bbuserinfo[usergroupid], array(X,Y,Z))">
                              I added the red code. That should work .
                              Bugdar: PHP bug tracking software that is beautiful, fast, and robust.

                              Comment

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