News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Limiting signature size

Started by TokyoBanana, October 20, 2004, 10:07:39 PM

Previous topic - Next topic

TokyoBanana

Mod Available Signature Settings Mod

Original Post


I would be really happy if this feature was included sometime soon in one of the next updates to SMF. Meanwhile, does anyone know a mod for this? I found a similar one but that's for disabling images.
Just a clarification: I don't want to limit the size of images posted in the threads, except for signatures.


Thanks a lot! :)

Anguz

#1
You could do something as simple as adding this to your CSS file:


.signature
{
width: 468;
height: 60;
overflow: hidden;
}


That'll set the signature space to that and whatever exceeding it will be hidden.

The width and height you can change to what you want, but then remember that every sig, even if they don't need that much, will be that much. So don't make it too big either. I used those measures in the past and have found them pretty good, but it's your preference.
Cristián Lávaque http://cristianlavaque.com

Anguz

Hmm... looks like besides the class, there's inline styling for the signature. You may need to edit it in Display.template.php.


<div style="overflow: auto; width: 100%; padding-bottom: 3px;" class="signature">


I think that now that there's a class for the signature, you can safely take style property out of that div and just add the padding-bottom: 3px; to my previous post.

Remember that when you edit themes, you make a copy of the file in the default one, don't modify the originals. Here's good info on that topic:

http://www.simplemachines.org/community/index.php?topic=16843.0
Cristián Lávaque http://cristianlavaque.com

TokyoBanana

All right!

Thanks a lot! ;)

Yo spiffy, don't forget to have a look. XD

Elijah Bliss

I still can't get the CSS signature resize to work.

Anguz

#5
Quote from: Elijah Bliss on November 17, 2004, 09:34:39 PM
I still can't get the CSS signature resize to work.

My mistake. It's because the width and height are missing the px after the values. Also, the hidden doesn't work cause the inline auto for overflow weights more. Remove the style attribute from the signature div and in style.css add this:


.signature
{
width: 468px;
height: 60px;
overflow: hidden;
padding: 3px;
}
Cristián Lávaque http://cristianlavaque.com

Elijah Bliss

Quote from: Anguz on December 19, 2004, 12:54:54 PM
Quote from: Elijah Bliss on November 17, 2004, 09:34:39 PM
I still can't get the CSS signature resize to work.

My mistake. It's because the width and height are missing the px after the values. Also, the hidden doesn't work cause the inline auto for overflow weigths more. Remove the style attribute from the signature div and in style.css add this:


.signature
{
width: 468px;
height: 60px;
overflow: hidden;
padding: 3px;
}


Thanks, works like a charm!

inthe80s

agrreed... I've used CSS before, and didn't even notice the missing px on each one (boy am I embarassed).  thanks for the help.
Running SMF since May '04.  Started with YaBB on Oct 2001.

Anguz

NP. I'm glad you got it working. :)
Cristián Lávaque http://cristianlavaque.com

Elijah Bliss

Quote from: inthe80s on December 20, 2004, 09:13:39 AM
agrreed... I've used CSS before, and didn't even notice the missing px on each one (boy am I embarassed).  thanks for the help.

on a side note, is you append img to .signature:

.signature img
{
     width: 468px;
       height: 60px;
       overflow: hidden;
       padding: 3px;
}


it wll only resize the images in the signature, which I find super cool.

Anguz

But you need to modify the styles then, cause what you wrote will make any image, even smilies, 480px wide and 60px tall... not exactly what you want, is it? If max-width and max-height worked properly in IE, then could be happy and use that without a problem. You could use it, actually, and only those with decent browsers will enjoy the better display of signature images.
Cristián Lávaque http://cristianlavaque.com

Elijah Bliss

Quote from: Anguz on December 21, 2004, 06:36:48 PM
But you need to modify the styles then, cause what you wrote will make any image, even smilies, 480px wide and 60px tall... not exactly what you want, is it? If max-width and max-height worked properly in IE, then could be happy and use that without a problem. You could use it, actually, and only those with decent browsers will enjoy the better display of signature images.

You have a point, i guess it's a small sacrifice since I have members who love to post 2 page magazine spreads in their signatures. Unfortunately most people do not use Safari or Firefox.

ExistenZ

Does this work with RC1.1? I dont think it does...so...can anyone fix it to work with it...
Regards,
Andre

Sheepy

Why not? It's only CSS, not PHP code or something...

Sverre

I've used this method without problem on both 1.1 RC1 and RC2 :)

ExistenZ

But the process isn't very clear, is it? I still dont get what to do...

Can someone explain it a bit better....
Regards,
Andre

Elijah Bliss

This should be mod and function the same as the avatar settings.

ExistenZ

Regards,
Andre

perplexed

#18
I wonder if anyone could also tell me how to limit the file size of the signature images used?

All members use siggie banners loaded in photobucket accounts and load them to signature using [img ]http://[/img] tags

But some are making animated banners now and the file sizes can be huge compared to standard banners

So in addition to a width and height restriction is it also possible to have a kb restriction  ie upper limit of say 200kb?

that would be brilliant :)



also can someone confirm that all we are changing is the .css ?

Anguz

You can't control the filesize with CSS. At least not that I know.
Cristián Lávaque http://cristianlavaque.com

Advertisement: