Today on the Wiki4Games BBS I had to deal with a way too large user signature. Eventually, I came up with several ways to solve the problem:
At first I installed a plugin called Image signature Limit. I don’t know for sure if it works fine, as I didn’t test it specifically. The problem with this plugin is that it doesn’t fix signatures which have been created in the past, and also it only takes care about the pictures, not the text size. So I left it enabled to prevent further submissions of too huge sig pictures, and I looked after another solution: manual style edits.
In MyBB you can edit templates and styles from the admin panel. Of course this is very tedious if you use several templates, but luckily for me I use only one, so this solution is good for me.
- open the postbit_signature template. Its content should be:
<hr size="1" width="25%" align="left" />
{$post['signature']}
Replace it with
<div class="signature">
{$post['signature']}
</div> - open global.css and add:
.signature img {max-width:600px; max-height:150px; overflow:hidden;}
.signature {border-top: 1px solid #aaaaaa; width:100%; margin-top:1em; padding-top:0.2em; max-height:200px; overflow:hidden;}
That’s it. You can change the maximum height and width you want, of course. We also replaced the very ugly <hr> with a lighter 100% width border, of course this part is optional, it’s not needed to limit the signature size but very needed to give a decent look to the board IMO. The max-height and max-width attributes are, as far as I know, part of the CSS 2 specification, and work on Firefox, Opera, Safari, MSIE 7+.
This “tutorial” was tested using the Default theme on MyBB 1.4.7. At the time I’m writing you can view the result on http://bbs.wiki4games.com.
Thanks, I would’ve done it through CSS myself too, but this saved some minutes. 🙂
Yeah, most skin customizations are very simple yet when you add them up it becomes annoyingly time-consuming. The Signature image limit plugin is nicely complementary too, because it helps preventing large pictures in terms of bytes (with CSS you still allow big pictures, only you scale them down – plus AFAIK it doesn’t work with MSIE 6).