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

  • 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

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

    Comment


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

      Comment


      • #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 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 10th May '05, 9:42am.

        Comment


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

          Comment


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

            Comment

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