Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Now Available => Topic started by: TokyoBanana on October 20, 2004, 10:07:39 PM

Title: Limiting signature size
Post by: TokyoBanana on October 20, 2004, 10:07:39 PM
Mod Available Signature Settings Mod (http://custom.simplemachines.org/mods/index.php?mod=528)

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! :)
Title: Re: Limiting signature size
Post by: Anguz on October 20, 2004, 10:32:48 PM
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.
Title: Re: Limiting signature size
Post by: Anguz on October 20, 2004, 10:41:04 PM
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
Title: Re: Limiting signature size
Post by: TokyoBanana on October 22, 2004, 06:36:48 PM
All right!

Thanks a lot! ;)

Yo spiffy, don't forget to have a look. XD
Title: Re: Limiting signature size
Post by: Elijah Bliss on November 17, 2004, 09:34:39 PM
I still can't get the CSS signature resize to work.
Title: Re: Limiting signature size
Post by: 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 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;
}
Title: Re: Limiting signature size
Post by: Elijah Bliss on December 19, 2004, 04:52:34 PM
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!
Title: Re: Limiting signature size
Post by: 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.
Title: Re: Limiting signature size
Post by: Anguz on December 20, 2004, 11:31:31 AM
NP. I'm glad you got it working. :)
Title: Re: Limiting signature size
Post by: Elijah Bliss on December 21, 2004, 06:32:40 PM
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.
Title: Re: Limiting signature size
Post by: 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.
Title: Re: Limiting signature size
Post by: Elijah Bliss on December 21, 2004, 09:44:34 PM
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.
Title: Re: Limiting signature size
Post by: ExistenZ on January 01, 2006, 02:43:39 PM
Does this work with RC1.1? I dont think it does...so...can anyone fix it to work with it...
Title: Re: Limiting signature size
Post by: Sheepy on January 01, 2006, 05:34:14 PM
Why not? It's only CSS, not PHP code or something...
Title: Re: Limiting signature size
Post by: Sverre on January 03, 2006, 02:00:59 AM
I've used this method without problem on both 1.1 RC1 and RC2 :)
Title: Re: Limiting signature size
Post by: ExistenZ on January 04, 2006, 04:20:01 PM
But the process isn't very clear, is it? I still dont get what to do...

Can someone explain it a bit better....
Title: Re: Limiting signature size
Post by: Elijah Bliss on January 04, 2006, 06:49:45 PM
This should be mod and function the same as the avatar settings.
Title: Re: Limiting signature size
Post by: ExistenZ on January 05, 2006, 01:47:19 PM
I agree.
Title: Re: Limiting signature size
Post by: perplexed on February 08, 2006, 01:05:12 PM
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 ?
Title: Re: Limiting signature size
Post by: Anguz on February 08, 2006, 01:20:30 PM
You can't control the filesize with CSS. At least not that I know.
Title: Re: Limiting signature size
Post by: perplexed on February 08, 2006, 02:37:06 PM
thanks for your reply, any other ideas if this can be done?

And also about the height and width limits, all I have to is add that to the .css code?

~thanks
Title: Re: Limiting signature size
Post by: Anguz on February 08, 2006, 04:07:17 PM
Re. size, yes. To limit file size, then you'd have to write some code to control that, but it's not very practical, cause unless you do the check in every display, which is insane, anyone can use a small image and then change it for a larger one in the same URL.
Title: Re: Limiting signature size
Post by: perplexed on February 08, 2006, 04:55:56 PM
ok thanks that makes sense, its in the rules we have but no way of stopping them without checking every one lol
Title: Re: Limiting signature size
Post by: 5cakids on February 19, 2007, 12:05:25 PM
Is this going to be available for 1.1.2 soon?
Title: Re: Limiting signature size
Post by: perplexed on February 19, 2007, 12:24:01 PM
it doesnt say 1.1.2 on the mod list but I am running 1.1.2 and it works on mine after I upgraded, if that is any help to you :)
Title: Re: Limiting signature size
Post by: 5cakids on February 19, 2007, 01:53:32 PM
Shoot I already upgraded and it is not working, thanks
Title: Re: Limiting signature size
Post by: perplexed on February 20, 2007, 07:27:46 AM
I upgraded using the patch so, I uninstalled the patch, added the mods, and then installed the patch again, and it worked ok
Title: Re: Limiting signature size
Post by: chep on March 23, 2007, 07:29:30 PM
perfect!

Quote from: Elijah Bliss on December 21, 2004, 06:32:40 PM
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.
Title: Re: Limiting signature size
Post by: Mr_JimWest on November 25, 2008, 11:38:19 PM
I am having a big problem with this mod – it's not working on my forums! I worked with the manual install, but it didn't work either... Will there ever be a downloadable package for all versions of forums?  :(

I currently have 1.1.7 – I guess this mod would be extremely beneficial – but I can't seem to get it to work... :-[

http://rangers-clan.com
Title: Re: Limiting signature size
Post by: aevina on September 26, 2010, 03:11:30 AM
thank you for sharing this with us