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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    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">
    		[color=red]BANNER CODE HERE[/color]
    	</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
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    You can show the banner every X posts by using this code instead (changes are marked in blue):

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

    Comment

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

      #3
      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>
      
      [color=red]$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[/color]
      
      <!-- 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>
      
      [color=red]$spacer_open
      <div style="padding:[color=blue]$stylevar[cellpadding][/color]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">
      		[color=red]BANNER CODE HERE[/color]
      	</td>
      </tr>
      </table>
      
      </div>
      $spacer_close[/color]
      
      <!-- start content table -->
      $spacer_open
      <!-- / start content table -->
      
      <!-- controls below postbits -->
      <table cellpadding="0" cellspacing="0" border="0" width="100%">
      <tr valign="top">

      Comment

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

        #4
        (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 [color=red]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>
        Last edited by Jake Bunce; Tue 10 May '05, 8:42am.

        Comment

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

          #5
          (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 [color=red]AND in_array($GLOBALS[forumid], array(X,Y,Z))[/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>
          Where X,Y,Z is a comma-separated list of forumids in which you want the banner to show.

          Comment

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

            #6
            (in postbit)

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

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

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