Announcement

Collapse
No announcement yet.

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

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

  • Jake Bunce
    replied
    (in postbit)

    To show the banner between the last post and second to last post, make the change in blue:

    Code:
    <if condition="$post[postcount] % $vboptions[maxposts] == $vboptions[maxposts] - 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>

    Leave a comment:


  • Jake Bunce
    replied
    (in postbit)

    If you only want banners to show in specific forums, add the red code to the condition:

    Code:
    <if condition="$post[postcount] == 1 AND in_array($GLOBALS[forumid], array(X,Y,Z))">
    
    $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>
    Where X,Y,Z is a comma-separated list of forumids in which you want the banner to show.

    Leave a comment:


  • Jake Bunce
    replied
    (in postbit)

    If you only want guests to see the banners, then add the red code to the condition:

    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>
    Last edited by Jake Bunce; Tue 10 May '05, 9:42am.

    Leave a comment:


  • Jake Bunce
    replied
    If you want the banner to show only after the last post on every page of a thread, then don't modify the postbit. Edit this template instead:

    Admin CP -> Styles & Templates -> Style Manager -> « » -> Show Thread Templates -> SHOWTHREAD

    Add the red code:

    Code:
    </table>
    <!-- / toolbar -->
    
    <!-- end content table -->
    $spacer_close
    <!-- / end content table -->
    
    <if condition="$show['threadedmode'] OR $show['hybridmode']">
    <!-- thread posts list -->
    $threadlist
    <!-- /thread posts list -->
    </if>
    
    <div id="posts">$postbits</div>
    
    $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
    
    <!-- start content table -->
    $spacer_open
    <!-- / start content table -->
    
    <!-- controls below postbits -->
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
    <tr valign="top">
    Depending on the postbit style you are using, you might need to make the change in blue to properly space out the banner from the last post:

    Code:
    </table>
    <!-- / toolbar -->
    
    <!-- end content table -->
    $spacer_close
    <!-- / end content table -->
    
    <if condition="$show['threadedmode'] OR $show['hybridmode']">
    <!-- thread posts list -->
    $threadlist
    <!-- /thread posts list -->
    </if>
    
    <div id="posts">$postbits</div>
    
    $spacer_open
    <div style="padding:$stylevar[cellpadding]px 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
    
    <!-- start content table -->
    $spacer_open
    <!-- / start content table -->
    
    <!-- controls below postbits -->
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
    <tr valign="top">

    Leave a comment:


  • Jake Bunce
    replied
    You can show the banner every X posts by using this code instead (changes are marked in blue):

    Code:
    <if condition="$post[postcount] % X == 0">
    
    $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>
    For example, if you want the banner to show every 3 posts, then you would change X to 3.

    Leave a comment:


  • Jake Bunce
    started a topic How To Show A Banner After The First Post In A Thread

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

    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:

    Code:
    <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 the attached picture.
    Attached Files
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X