MyBB Community Forums

Full Version: Limit Signature height *without* a plugin!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Ok, here's how you limit a signature height without a plugin, thereby adding speed and decreasing CPU usage.

Open up your postbit and postbit_classic templates and find:

{$post['signature']}

Replace it with:

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

Open up global.css or showthread.css and add:

.signature {
	height:100px;
	overflow:scroll;
}

You can customize it like so:
height:100px;
Change 100px top however large you want it to be.

overflow:scroll;

"scroll" will add a scroll-bar to the side so you can see the rest of the sig. You can change "scroll" to "hidden" to just cut the signature off.

Hope you find this tutorial useful.
yep and that's pretty much all you need. I wouldn't really know a "real cool way" to limit somone's signature height, so this is as good as it gets.
Thank you going to use this now!
Edit: Not sure if this is supposed to reduce images or nto but its not doing it for me:

http://soviet.scdiplo.com/showthread.php?tid=10204
Instead editing direct postbit and postbit_classic templates, I would recommend to just edit "postbit_signature" template, In this template: find;
{$post['signature']}
and Change it into;
<div style="overflow: auto; max-height: 100px;">
{$post['signature']}
</div>

This will also not include the "signature separator line" in the overflow Toungue
While using max-height is a good idea, inline-styling is not. It's a lazy man's solution. CSS belong in stylesheets, not in your markup.
(2011-11-17, 07:45 AM)Yaldaram Wrote: [ -> ]Instead editing direct postbit and postbit_classic templates, I would recommend to just edit "postbit_signature" template, In this template: find;
{$post['signature']}
and Change it into;
<div style="overflow: auto; max-height: 100px;">
{$post['signature']}
</div>

This will also not include the "signature separator line" in the overflow Toungue


I think he was more suggesting that as what template to edit, not the html to use Toungue

I think a better idea would be to wrap the image in a div with the name "signature"

then in the stylesheet have:

.signature img{
     max-height: 100px;
     overflow: hidden;
}

Not 100% sure that it would work, just an idea. that way the image is limited but not the rest of the signature Toungue (so it wont cut off text below the image)
If you edit postbit and postbit_classic templates then sig separator line will also include in the overflow, that wouldn't be nice IMO, sig separator should be there to let users know that sig. starts below that line.
(2011-11-17, 01:33 PM)Yaldaram Wrote: [ -> ]If you edit postbit and postbit_classic templates then sig separator line will also include in the overflow, that wouldn't be nice IMO, sig separator should be there to let users know that sig. starts below that line.

I hate the basic separator most themes use. I wrapped the sig template in fieldset tags to box the sig
(2011-11-17, 12:00 PM)faviouz Wrote: [ -> ]While using max-height is a good idea, inline-styling is not. It's a lazy man's solution. CSS belong in stylesheets, not in your markup.

And IIRC it is deprecated in css3 or something.
Pages: 1 2