Limit Signature height *without* a plugin!
#1
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.
-Paul H.

Cogisne lingua latina?
Reply
#2
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.
[Image: 350x19.jpg][Image: tstargermany.png]
Reply
#3
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
Reply
#4
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
Reply
#5
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.
Reply
#6
http://community.mybb.com/thread-69601.html

Smile
No longer involved in the MyBB project.
Reply
#7
(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)
Reply
#8
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.
Reply
#9
(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
Lost interest, sold my sites, will browse here once in a while. It's been fun.
Reply
#10
(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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)