Adding content to the FIRST post only?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MacMorag
    Senior Member
    • Oct 2001
    • 126
    • 3.0.0 'Gold'

    Adding content to the FIRST post only?

    Is it possible, via a template mod, to change the way the FIRST post in a thread is displayed? I can see how to change all posts (via the postbit template) but I only want to change the first post in every thread.

    Is this possible via template modification - or does it actually require that the source file (showthread.php?) is hacked ?

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

    #2
    You can use a template conditional to check the post number of the post in a thread. Use this code in one of the postbit templates to display content for the first post only:

    Code:
    <if condition="$post[postcount] == 1">
    	// CONTENT FOR FIRST POST ONLY
    </if>

    Comment

    • MacMorag
      Senior Member
      • Oct 2001
      • 126
      • 3.0.0 'Gold'

      #3
      Excellent Jake.

      Thanks.

      Comment

      • plan_b
        Senior Member
        • Jul 2003
        • 186
        • 3.0.3

        #4
        but how to you get it to stay inline with the above post... want to add my adsense like the attached. What is all needed to make this happen

        Comment

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

          #5
          Attached image?

          Comment

          • plan_b
            Senior Member
            • Jul 2003
            • 186
            • 3.0.3

            #6
            ooops, sorry.... see http://www.vbulletin.com/forum/showthread.php?t=117036

            Comment

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

              #7
              Add this code to the bottom of the template. I made this up to look like the picture:

              Code:
              <if condition="$post[postcount] == 1">
              
              $spacer_open
              
              <div style="padding:0px 0px $stylevar[cellpadding]px 0px">
              
              <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center">
              <tr>
              	<td class="thead" align="left">
              		Sponsors
              	</td>
              </tr>
              <tr>
              	<td class="alt1" align="center">
              		BANNER CODE HERE
              	</td>
              </tr>
              </table>
              
              </div>
              
              $spacer_close
              
              </if>

              Comment

              • plan_b
                Senior Member
                • Jul 2003
                • 186
                • 3.0.3

                #8
                Thanks Jake.... that is exactly what I was looking for


                YOU ROCK!!!!

                Comment

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