Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

    http://www.dvdtalk.com/forum/showthread.php?t=399620

  • #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


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

      Comment


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

        Comment


        • #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 AND !$bbuserinfo[userid]">
          
          $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">
          		BANNER CODE HERE
          	</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] == 1 AND !$bbuserinfo[userid]">
          
          $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">
          		BANNER CODE HERE
          	</td>
          </tr>
          </table>
          
          </div>
          $spacer_close
          
          </if>

          Comment


          • #6
            Thanks!..

            one more thing..

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

            Comment


            • #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


              • #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] == 1 AND !in_array($bbuserinfo[usergroupid], array(X,Y,Z))">
                If some are secondary groups, then use this expanded blue code:

                Code:
                <if condition="$post[postcount] == 1 AND !is_member_of($bbuserinfo, X) AND !is_member_of($bbuserinfo, Y) AND !is_member_of($bbuserinfo, Z)">
                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="$post[postcount] == 1 AND !in_array($bbuserinfo[usergroupid], array(X,Y,Z))">
                ...with the new red code:

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

                Comment


                • #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 15th 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


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

                    Comment


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

                      Comment


                      • #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="$post[postcount] % $vboptions[maxposts] == 1 AND !in_array($bbuserinfo[usergroupid], array(X,Y,Z))">
                        That should work.

                        Comment


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

                          Comment


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

                            Code:
                            <if condition="$post[postcount] % $vboptions[maxposts] == 1 AND !in_array($bbuserinfo[usergroupid], array(X,Y,Z))">
                            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


                            • #15
                              Try using this conditional instead:

                              Code:
                              <if condition="$post['postid'] == $GLOBALS['FIRSTPOSTID'] 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...
                              X