Forcing maximum signature dimensions for your users
Many people like myself are annoyed by massive signatures and the character limit settings do little to prevent people from posting large images so here is an easy way to ensure your users signature aren't bigger than whats allowed by limiting the dimensions of the signature div.

First go ACP > Templates & Styles > Templates > Select Template > Post Bit templates > postbit and find the following code:
then simply put a div tag with a limited height and hidden overflow like this:
<div style="height: 150px; overflow: hidden;">

Next go back to the template list and open the postbit_classic template and do the same, finding {$post['signature']} and enclosing it in a div just like the code above.

Thats it, your done! Anything bigger than 150px will simply be cut off and hidden!

To change the height limit you can simply change 150px to your own value, you can also change the width by adding width: 500px; after overflow: hidden;

The height property will always make the signature div that size so if you would prefer to allow any height up to the limit then you can substitute height with max-height, though I think some browsers have issues with this.

You can also put the CSS in the style sheet rather than inline by using this code instead:
<div class="sigdiv">
and adding the following to global.css:
height: 150px;
overflow: hidden;

Here is a print screen of the result:
Thank you very much Toungue
I'm not here often, shoot a PM or whatever if you want my discord.
Oooh very nice, Tim! Thanks for it. Smile
Will this cut text too?
Directly, I am using this on postbit_signature template
<div style="align:right; max-height: 100px; overflow:hidden">{$post['signature']}</div>

Confuse with max-height or height? Wink
Hello, Welcome to MyBB Indonesia to get local support
My 'Simple' Unique Plugin here Smile
(2010-05-14, 07:49 PM)faviouz Wrote: Will this cut text too?

Yes, it will essentially cut off everything beyond the specified height.

(2010-05-14, 11:29 PM)FBI Wrote: Confuse with max-height or height? Wink
I said in the variations section that you can use max-height but I'm pretty sure the max and min properties are not handled very well by some IE versions.
Nice, but personally I prefer resizing. Thanks anyway, might come in handy!
Thanks Tim.

It is not disgraceful to ask, it is disgraceful no to ask.

sory for my english .
Thanks Tim, you are having some real great tips Smile
This will be very useful, Thanks for the tutorial. Smile
[Image: mygfxforumsadvertbanner.png]

Forum Jump:

Users browsing this thread: 1 Guest(s)