+ Reply to Thread
Results 1 to 1 of 1

Thread: How To Show A Banner After The First Post In A Thread

  1. #1
    vBulletin Team Jake Bunce has a spectacular aura about Jake Bunce has a spectacular aura about Jake Bunce's Avatar
    Join Date
    Dec 2000
    Location
    Land of the In-N-Out Burger
    Age
    29
    Posts
    46,580

    How To Show A Banner After The First Post In A Thread

    I tested the old instructions on version 3.5 and they appear to work exactly the same. No changes are needed. Here are the same instructions rewritten with some improvements:

    Admin CP -> Styles & Templates -> Style Manager -> « » -> Postbit Templates -> postbit or postbit_legacy (depending on which layout you are using)

    Add the blue code to the very bottom of the template:

    Code:
    </div>
    <!-- / post $post[postid] popup menu -->
    
    <if condition="$show['spacer']">
    	</div>
    	$spacer_close
    </if>
    <!-- / post #$post[postid] -->
    
    <if condition="$post[postcount] == 1">
    
    $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>
    Replace the red code with your own banner / ad code.

    The end result will look like this:

    Attachment 12473

    Here are several other conditions you can use in the above code to show the banner in different places. Simply replace the first "if" statement.

    ...after the first post on every page (instead of just the first page):

    Code:
    <if condition="$post[postcount] % $vboptions[maxposts] == 1">
    ...after the first post, but only for guests:

    Code:
    <if condition="$post[postcount] == 1 AND !$bbuserinfo[userid]">
    ...after the first post, but only if the thread has at least 2 replies (so you never see a banner and only 1 post):

    Code:
    <if condition="$post[postcount] == 1 AND $GLOBALS[threadinfo][replycount] >= 2">
    ...after the first post, but only in specific forums (where X,Y,Z is a comma list of forumids):

    Code:
    <if condition="$post[postcount] == 1 AND in_array($GLOBALS[forumid], array(X,Y,Z))">
    ...after every X posts (replace X with a number):

    Code:
    <if condition="$post[postcount] % X == 0">
    ...after the last post on every page:

    Code:
    <if condition="$post['islastshown']">
    ...between the last and second to last post on every page (need to move the above code to the very top of the template instead of the bottom, then use the same condition as above):

    Code:
    <if condition="$post['islastshown']">
    You can use pieces of these conditions to do different combinations. For example, this condition will show the banner after the first post on every page (instead of just the first page), but only for guests, and only in certain forums (where X,Y,Z is a comma list of forumids):

    Code:
    <if condition="$post[postcount] % $vboptions[maxposts] == 1 AND !$bbuserinfo[userid] AND in_array($GLOBALS[forumid], array(X,Y,Z))">
    edit on 10-28-05 - added alternate condition to check how many posts are in the thread
    Last edited by Jake Bunce; Fri 28th Oct '05 at 1:23pm.

+ Reply to Thread

Similar Threads

  1. How To Show A Banner After The LAST Post?
    By Chad F. in forum vBulletin 3.5 'How Do I' Questions and Troubleshooting
    Replies: 5
    Last Post: Fri 30th Sep '05, 12:26pm
  2. How To Show A Banner After The First Post In A Thread ?
    By sensimilla in forum vBulletin 3.5 'How Do I' Questions and Troubleshooting
    Replies: 1
    Last Post: Thu 29th Sep '05, 11:29am
  3. show banner after post.. usergroup
    By indie in forum vBulletin 3.0 How Do I and Troubleshooting Forum
    Replies: 3
    Last Post: Fri 15th Jul '05, 1:50am
  4. How To Show A Banner After The First Post In A Thread
    By Jake Bunce in forum vBulletin 3.0 Quick Tips and Customizations
    Replies: 5
    Last Post: Fri 13th May '05, 1:02pm
  5. Question on tip: How To Show A Banner After The First Post In A Thread
    By Paul_w in forum vBulletin 3.0 How Do I and Troubleshooting Forum
    Replies: 3
    Last Post: Tue 1st Feb '05, 5:50pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts