Announcement

Collapse
No announcement yet.

[HowTo] Tweaking the $postbit template

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

  • [HowTo] Tweaking the $postbit template

    [HowTo] Tweaking the $postbit template

    What does this one do?
    When you view a thread, each post might have an attachment, a signature, the report/ip links and could hold 'edited by' line. But they aren't sticky to the bottom of the table cell, and they are not in their right place (that is what I think).
    This tweak will put the content of the postbit into its own table which makes it possible to align them properly, give those elements their own place in the postbit template and lets you set the height to 100%, so it can stick to the bottom of the cell. The result is a cleaned up version of the default postbit template, a tweak.

    Why did you make it?
    Personally, I was hoping vBulletin was default by this, but unfortn. not, and I guess they have their reasons for it. But still, I wanted this, and I had a lot of users requesting me if I could make it. After a few horrible failures, here it is. So I hope it is good enough. And maybe in time, it gets better! I just thought it was smart to share my first successful attempt.

    (note: this is not working 100% in all browsers, so consider it beta until I tag it otherwise) (22-05-2002 @ 14:00)
    (update 1: 22-05-2002 @ 23:45)
    (update 2: 21-07-2002 @ 22:45)

    So far I have been able to get this to work in Internet Explorer 6.0 and Mozilla 1.x for 100% - I did not find any incorrect alignments and placing of the cells.
    I have not been able to get this to work in Opera 6.02 - 0% - stupid browser!
    I won't even bother checking in Netscrape. Since they use same engine etc as Mozilla.

    I will also clean up this post in the future. But for now, let's just share this as I have it working on my site.

    The support for this is going as far as I can get it to work. So be sure you have a backup of a working template for your board (Don't just trust that [revert to original], otherwise I wouldn't be getting those damn PM's every day by users asking for it)

    Ok, here goes.

    Installation steps:

    1- postbit template > [change original] (or [edit]) and find:
    Code:
    <td bgcolor="$post[backcolor]" width="100%" valign="top">
    	<smallfont>$post[icon] <b>$post[title]</b></smallfont>
    	<p><normalfont>$post[message]</normalfont></p>
    	$post[attachment]
    	<p>$post[signature]</p>
    	<p>$post[editedby]</p>
    	<p align="right"><smallfont><a href="report.php?s=$session[sessionhash]&postid=$post[postid]">Report this post to a moderator</a> | $post[iplogged]</smallfont></p>
    </td>

    2- replace that part with:
    Code:
    <td bgcolor="$post[backcolor]" width="100%" height="100%" valign="top">
    <table width="100%" border="0" cellpadding="0" align="left" height="100%">
      <tr> 
        <td bgcolor="$post[backcolor]" colspan="2" align="left" valign="top" height="20"><smallfont>$post[icon] <b>$post[title]</b></smallfont></td>
      </tr>
      <tr> 
        <td bgcolor="$post[backcolor]" colspan="2" align="left" valign="top"><p><normalfont>$post[message]</normalfont></p></td>
      </tr>
      <tr> 
      <td bgcolor="$post[backcolor]" colspan="2" align="left" valign="bottom" >$post[attachment]$post[signature]</td>
      </tr>
      <tr>
        <td bgcolor="$post[backcolor]" align="left" valign="bottom" height="8"><br>$post[editedby]</td>
        <td bgcolor="$post[backcolor]" align="right" valign="bottom" height="8"><br><smallfont><a href="report.php?s=$session[sessionhash]&postid=$post[postid]">Report this post to a moderator</a> | $post[iplogged]</smallfont></td>
      </tr>
    </table>
    </td>

    3- Save the template

    Done!


    Version?
    Tested with vBulletin 2.2.6 and works just great! - on default test board (localhost) and on my public board (which is a little bit more modded).

    The Result
    Check the next two posts.


    Feel free to post improvements (as long as they are clear and don't require code-hacking (for that, goto vBulletin.org please) ok)
    Last edited by Floris; Sun 21st Jul '02, 1:48pm.

  • #2
    Original $postbit template

    The original $postbit template will make a post look like this

    Comment


    • #3
      Tweaked $postbit template

      This tweak to the $postbit template will make a post show up like this

      Comment


      • #4
        xiphoid... u are god in every sense lol...

        ive wanted this done for a long time now... works like magic...

        thankyou so much
        Dean Clatworthy - Web Developer/Designer

        Comment


        • #5
          Originally posted by Mist
          xiphoid... u are god in every sense lol...

          ive wanted this done for a long time now... works like magic...

          thankyou so much
          I am not a god, and I bet someone else has done this before already.

          I am happy to read that it worked like magic on your board. I would be happy to see an example (screenshot/url?) of that.

          So far, I only had one question, asked by a few users: But ... and the awnser is: Break the row up in two columns, then you can use the Multiple Quotes hack and/or the PostID link in post hack. Altering the html is simple, since it is just plain html. Ok!

          Oh and mist, did you find any troubles with aligning etc on other browsers and/or solutions for that?
          Last edited by Floris; Mon 28th Oct '02, 5:08am.

          Comment


          • #6
            hey great job xiph, like always kicking ass, i couldnt stand that gap

            now help me out for some reason all the image attachments i have on auto show and all of them are to the right of the post, help = ]

            Comment


            • #7
              Works good but i had a few minor issues, fixed em tho and thanks

              Comment


              • #8
                Vertex try doing

                PHP Code:
                <td bgcolor="$post[backcolor]width="100%" height="100%" valign="top">
                <
                table width="100%" border="0" cellpadding="0" align="left" height="100%">
                  <
                tr
                    <
                td bgcolor="$post[backcolor]colspan="2" align="left" valign="top" height="20"><smallfont>$post[icon] <b>$post[title]</b></smallfont></td>
                  </
                tr>
                  <
                tr
                    <
                td bgcolor="$post[backcolor]colspan="2" align="left" valign="top"><p><normalfont>$post[message]</normalfont></p></td></tr><br>
                    <
                td bgcolor="$post[backcolor]colspan="2" align="left" valign="bottom">  $post[attachment]</td>
                  <
                tr
                    <
                td bgcolor="$post[backcolor]colspan="2" align="left" valign="bottom" height="25">$post[signature]</td>
                  </
                tr>
                  <
                tr
                    <
                td bgcolor="$post[backcolor]align="left" valign="top" height="8">$post[editedby]</td>
                    <
                td bgcolor="$post[backcolor]align="right" valign="top" height="8"><smallfont><a href="report.php?s=$session[sessionhash]&postid=$post[postid]">Report this post to a moderator</a> | $post[iplogged]</smallfont></td>
                  </
                tr>
                </
                table>
                </
                td
                I had the same problem but i fixed it, i think that was the way. I also had some issues with my signatures being squished, tell me if your geting the same cuz i think i can help you out there too.

                Comment


                • #9
                  Originally posted by VeRTeX
                  hey great job xiph, like always kicking ass, i couldnt stand that gap

                  now help me out for some reason all the image attachments i have on auto show and all of them are to the right of the post, help = ]
                  Screenshot?
                  The td says align="left", so I wonder why they show up right!

                  Originally posted by Xanthine
                  Works good but i had a few minor issues, fixed em tho and thanks
                  Nice to hear that you like it and that it works.

                  Which issues did you run into, and how did you sort them?
                  Maybe your fixed version of what is between the <td>..</td> tags improves for most. Share!

                  By the way, I don't see any changes in the code you pasted xant. but the <br> between the </tr><tr> tags.. I am not sure if that is correct html.. but if it works in all browsers (who cares!)
                  Last edited by Floris; Mon 28th Oct '02, 5:08am.

                  Comment


                  • #10
                    Ok im not sure then heres my entire postbit see if you can figure it out:

                    PHP Code:
                    <table bgcolor="{pagebgcolor}" width="{tablewidth}" cellpadding="0" cellspacing="0" border="0"><tr><td width="10"><img width="10" height="1" src="{imagesfolder}/space.gif" alt=""></td><td width="100%"><!-- spacer -->

                    <
                    table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextrawidth="{contenttablewidth}" align="center"><tr><td>
                    <
                    table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextrawidth="100%">
                    <
                    tr>
                        <
                    td bgcolor="$post[backcolor]width="175" valign="top" nowrap>
                        <
                    a name="post$post[postid]"></a>
                        
                    $post[firstnewinsert]
                        <
                    normalfont><b>$post[username]</b$onlinestatus</normalfont><br>
                        <
                    smallfont>$post[usertitle]</smallfont><br>
                        
                    $post[avatar]<br>
                        <
                    smallfont>Registered$post[joindate]<br>
                        
                    Location$post[field2]<br>
                        
                    Posts$post[posts]</smallfont></td>
                        <
                    td bgcolor="$post[backcolor]width="100%" height="100%" valign="top">
                    <
                    table width="100%" border="0" cellpadding="0" align="left" height="100%">
                      <
                    tr
                        <
                    td bgcolor="$post[backcolor]colspan="2" align="left" valign="top">$post[icon] <smallfont><b>$post[title]</b></smallfont></td>
                      </
                    tr>
                      <
                    tr
                        <
                    td bgcolor="$post[backcolor]colspan="2" align="left" valign="top"><p><normalfont>$post[message]</normalfont></p></td></tr><br>
                        <
                    td bgcolor="$post[backcolor]colspan="2" align="left" valign=bottom>$post[attachment]</td>
                      
                      <
                    tr
                        <
                    td bgcolor="$post[backcolor]colspan="2" align="left">$post[signature]</td>
                      </
                    tr>
                      <
                    tr
                        <
                    td bgcolor="$post[backcolor]align="left" valign="top" height="8">$post[editedby]</td>
                        <
                    td bgcolor="$post[backcolor]align="right" valign="top" height="8"></td>
                      </
                    tr>
                    </
                    table>
                    </
                    td>
                    </
                    tr>
                    <
                    tr>
                        <
                    td bgcolor="$post[backcolor]width="175" height="16" nowrap><smallfont>$post[foldericon]
                        
                    $post[postdate] <font color="{timecolor}">$post[posttime]</font></smallfont></td>
                        
                        <
                    td bgcolor="$post[backcolor]width="100%" valign="middle" height="16">
                            <
                    table width="100%" border="0" cellpadding="0" cellspacing="0">
                            <
                    tr valign="bottom">
                                <
                    td><smallfont>
                                
                    $post[profile$post[pmlink$post[useremail$post[homepage$post[search$post[buddy]
                                <!-- $ 
                    post[icqicon] --> <!-- $ post[aimicon] --> <!-- $ post[yahooicon] --> 
                                </
                    smallfont></td>
                                <
                    td align="right" nowrap><smallfont>
                    <
                    a href="report.php?s=$session[sessionhash]&postid=$post[postid]"><img src="{imagesfolder}/report.gif" border="0" alt="Report this Post"></a>
                                <
                    a href="editpost.php?s=$session[sessionhash]&action=editpost&postid=$post[postid]"><img src="{imagesfolder}/edit.gif" border="0" alt="Edit/Delete Message"></a>
                                <
                    a href="newreply.php?s=$session[sessionhash]&action=newreply&postid=$post[postid]"><img src="{imagesfolder}/quote.gif" border="0" alt="Reply w/Quote"></a>
                                </
                    smallfont></td>
                            </
                    tr>
                            </
                    table>
                        </
                    td>
                    </
                    tr>
                    </
                    table>
                    </
                    td></tr></table>

                    <!-- 
                    spacer --></td><td width="10"><img width="10" height="1" src="{imagesfolder}/space.gif" alt=""></td></tr></table

                    Comment


                    • #11
                      damn great template edit, gonna be a ***** for me... I have a custom postbit, and it keeps ****ing up the postbit... I hope I can figure it out.

                      Comment


                      • #12
                        Awesome hack...was thinking of doing this but was too lazy!

                        Comment


                        • #13
                          my postbit is custom (just barely) and when i made an attachement it messed up pretty good.. i removed it, but just wanted you to know it jacked up the tables

                          Comment


                          • #14
                            Great template edit man, just a slight problem. When i attatch a file to my post it appears to the right. You know what the problem is ? Here is my postbit templte:

                            PHP Code:
                            <table bgcolor="#FFFFFF" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td width="10"><img width="10" height="1" src="images/space.gif" alt=""></td><td width="100%"><!-- spacer -->

                            <
                            table cellpadding="0" cellspacing="0" border="0" bgcolor="#555576"  width="100%" align="center"><tr><td>
                            <
                            table cellpadding="4" cellspacing="1" border="0"  width="100%">
                            <
                            tr>
                                <
                            td bgcolor="$post[backcolor]width="175" valign="top" nowrap>
                                <
                            a name="post$post[postid]"></a>
                                
                            $post[firstnewinsert]
                                <
                            normalfont><b>$post[username]</b></normalfont><br>
                                <
                            smallfont>$post[usertitle]</smallfont><br>
                                
                            $post[avatar]<p>
                                <
                            smallfont>Registered$post[joindate]<br>
                                
                            Location$post[field2]<br>
                                
                            Posts$post[posts]<br><br>Threads :  $usertherdcoun <br>
                            Replies $userpostdcoun<br></smallfont></td>
                                
                            <
                            td bgcolor="$post[backcolor]width="100%" height="100%" valign="top">
                            <
                            table width="100%" border="0" cellpadding="0" align="left" height="100%">
                              <
                            tr
                                <
                            td bgcolor="$post[backcolor]colspan="2" align="left" valign="top" height="20"><smallfont>$post[icon] <b>$post[title]</b></smallfont></td>
                              </
                            tr>
                              <
                            tr
                                <
                            td bgcolor="$post[backcolor]colspan="2" align="left" valign="top"><p><normalfont>$post[message]</normalfont></p></td>
                                <
                            td bgcolor="$post[backcolor]colspan="2" align="left" valign="bottom" height="20">  $post[attachment]</td>
                              </
                            tr>
                              <
                            tr
                                <
                            td bgcolor="$post[backcolor]colspan="2" align="left" valign="bottom" >$post[signature]</td>
                              </
                            tr>
                              <
                            tr
                                <
                            td bgcolor="$post[backcolor]align="left" valign="top" height="8">$post[editedby]</td>
                                <
                            td bgcolor="$post[backcolor]align="right" valign="top" height="8"><smallfont><a href="report.php?s=$session[sessionhash]&postid=$post[postid]">Report this post to a moderator</a> | $post[iplogged]</smallfont></td>
                              </
                            tr>
                            </
                            table>
                            </
                            td>
                            </
                            tr>
                            <
                            tr>
                                <
                            td bgcolor="$post[backcolor]width="175" height="16" nowrap><smallfont>$post[foldericon]
                                
                            $post[postdate] <font color="#666686">$post[posttime]</font></smallfont></td>
                                
                                <
                            td bgcolor="$post[backcolor]width="100%" valign="middle" height="16">
                                    <
                            table width="100%" border="0" cellpadding="0" cellspacing="0">
                                    <
                            tr valign="bottom">
                                        <
                            td><smallfont>$onlinestatus
                                        $post
                            [profile$post[pmlink$post[useremail$post[homepage$post[search$post[buddy]
                                        <!-- $ 
                            post[icqicon] --> <!-- $ post[aimicon] --> <!-- $ post[yahooicon] --> 
                                        </
                            smallfont></td>
                                        <
                            td align="right" nowrap><smallfont>
                                        <
                            a href="editpost.php?s=$session[sessionhash]&action=editpost&postid=$post[postid]"><img src="images/edit.gif" border="0" alt="Edit/Delete Message"></a>
                                        <
                            a href="newreply.php?s=$session[sessionhash]&action=newreply&postid=$post[postid]"><img src="images/quote.gif" border="0" alt="Reply w/Quote"></a>
                                        </
                            smallfont></td>
                                    </
                            tr>
                                    </
                            table>
                                </
                            td>
                            </
                            tr>
                            </
                            table>
                            </
                            td></tr></table>

                            <!-- 
                            spacer --></td><td width="10"><img width="10" height="1" src="images/space.gif" alt=""></td></tr></table
                            Last edited by Majestic3d; Sun 26th May '02, 12:57am.

                            Comment


                            • #15
                              Majestic3d: Use the code I have provided below

                              PHP Code:
                              <td bgcolor="$post[backcolor]width="100%" height="100%" valign="top">
                                <
                              table width="100%" border="0" cellpadding="0" align="left" height="100%">
                                  <
                              tr
                                    <
                              td bgcolor="$post[backcolor]colspan="2" align="left" valign="top" height="20"><smallfont>$post[icon
                                      <
                              b>$post[title]</b></smallfont></td>
                                  </
                              tr>
                                  <
                              tr
                                    <
                              td bgcolor="$post[backcolor]colspan="2" align="left" valign="top">
                                      <
                              p><normalfont>$post[message]</normalfont></p>
                                    </
                              td>
                                  </
                              tr>
                                  <
                              tr
                                    <
                              td bgcolor="$post[backcolor]colspan="2" align="left" valign="bottom" >$post[signature]</td>
                                  </
                              tr>
                                  <
                              tr
                                    <
                              td bgcolor="$post[backcolor]colspan="2" align="left" valign="bottom" height="20">
                                      
                              $post[attachment]</td>
                                  </
                              tr>
                                  <
                              tr
                                    <
                              td bgcolor="$post[backcolor]align="left" valign="top" height="8" width="73%">$post[editedby]</td>
                                    <
                              td bgcolor="$post[backcolor]align="right" valign="top" height="8" width="27%"
                                      <
                              div align="right"><smallfont><a href="report.php?s=$session[sessionhash]&postid=$post[postid]">Report 
                                        this post to a moderator
                              </a> | $post[iplogged]</smallfont></div>
                                    </
                              td>      
                                  </
                              tr>
                                </
                              table>
                              </
                              td
                              The problem you were getting is caused cuz of this bit of code:

                              PHP Code:
                                <tr
                                  <
                              td bgcolor="$post[backcolor]colspan="2" align="left" valign="top"><p><normalfont>$post[message]</normalfont></p></td>
                                  <
                              td bgcolor="$post[backcolor]colspan="2" align="left" valign="bottom" height="20">  $post[attachment]</td>
                                </
                              tr
                              That code makes it so that the attachment goes to the right of the message

                              The difference in the code that I have provided is this part:

                              PHP Code:
                                  <tr
                                    <
                              td bgcolor="$post[backcolor]colspan="2" align="left" valign="bottom" height="20">
                                      
                              $post[attachment]</td>
                                  </
                              tr>
                                  <
                              tr
                                    <
                              td bgcolor="$post[backcolor]align="left" valign="top" height="8" width="73%">$post[editedby]</td>
                                    <
                              td bgcolor="$post[backcolor]align="right" valign="top" height="8" width="27%"
                                      <
                              div align="right"><smallfont><a href="report.php?s=$session[sessionhash]&postid=$post[postid]">Report 
                                        this post to a moderator
                              </a> | $post[iplogged]</smallfont></div>
                                    </
                              td>      
                                  </
                              tr
                              What that does is create a new <tr> tag below the signature box, which will house the attachment. Then a new <tr> is created for the "edited by" part and the report thread/ip links. It used a 73% and 27% box width, so that way it will be placed the very right...

                              I have applied this to my board and it looks great!

                              Comment

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