5:06:22 pm

This is a feature that is found in SMF, and a lot of MyBB users I know have asked about a similar feature. While this is not a simple preference pane value, it is easy to set up, and anyone should be able to do so.

This is a simple process, and all it requires is editing a bit of your postbit, as well as adding a few lines to your global.css file. I will provide everything you need to add, so there should not be any difficulty.

  1. Log into your forums Admin area, and go to the Templates and Style page
  2. Switch to the Templates page
  3. Expand your theme’s templates
  4. Expand the post bit templates
  5. Edit the postbit_signature template, and add the following code to the beginning and end of the block ((Don’t overwrite any of the code there, that is perfectly fine. Just add it to the beginning and end.

Beginning:

1
<div class="signature">

End:

1
</div>
  1. Save the template, and switch to the Themes page.
  2. Click on your theme’s link to edit it, and then click on the top stylesheet entry.
  3. Enter Advanced edit mode by clicking the link near the top of the page
  4. At the end of the file, add the following code
1
2
3
4
.signature img {
max-width: 100px;
max-height: 100px;
}
    • You can replace the width an height values with whatever you like.
  1. Save this setting

And you are now done. Now, any image a user puts in their signature will not break your layout. The image, however, will still load in its entirety, so a large image will take a long time. Unfortunately, there is no way to stop this outside a plugin.

Share:
  • NewsVine
  • Reddit
  • Digg
  • Slashdot
  • Sphinn
  • Ma.gnolia
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Technorati
  • StumbleUpon
  • Spurl
412 views


5 Responses to “Limiting signature image width/height in MyBB”


  1. 1 kicker10BOG

    I took your code and modified it a little. … works great!

    Here’s what I have

    postbit_signature Wrote:


    <div class="signature">
    {$post['signature']}
    </div>

    global.css Wrote:
    .signature {
    max-width: 950px;
    max-height: 150px;
    overflow: auto;
    }

    So, I didn’t change much on it, but it adds a scrollbar to the sig area if the sig is oversized. example: http://thewordkeeper.com/forum … The overflow feature is what does it. And I took off "img" from class CSS.

    United Stateskicker10BOGS wrote this Using Safari Safari 525.19 on Mac OS Mac OS X
     Add karmaSubtract karma  +0
  2. 2 kicker10BOG

    The DIV tags didn’t show up in my comment. But they’re the same as what’s in the original post.

    United Stateskicker10BOGS wrote this Using Safari Safari 525.19 on Mac OS Mac OS X
     Add karmaSubtract karma  +0
  3. 3 Paradox

    I added them.

    Use &lt; and &gt;

    As in &lt;div&gt;

    United StatesParadox wrote this Using Safari Safari 525.19 on Mac OS Mac OS X
     Add karmaSubtract karma  +0
  4. 4 kicker10BOG

    kicker10BOG@December 22, 2008 5:57 pm said:

    http://paradoxdgn.com/archives/371#comment-“>

    I added them.

    Use &lt; and &gt;

    As in &lt;div&gt;

    cool.
    Thanks.

    United Stateskicker10BOGS wrote this Using Safari Safari 525.19 on Mac OS Mac OS X
     Add karmaSubtract karma  +0
  5. 5 Paradox

    Heh, no problem.

    United StatesParadox wrote this Using Safari Safari 525.19 on Mac OS Mac OS X
     Add karmaSubtract karma  +0

Leave a Reply

Quote selected text

Note: This post is over 2 months old. You may want to check later in this blog to see if there is new information relevant to your comment.

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/web site in attribution.