PDA

View Full Version : CSS Signature Size Enforcer


sinaluna
03-14-2006, 10:00 PM
Product Name:
Signature Size Enforcer

Product Description:
Ever get tired of problem users with half-page long signatures and of policing signature size rules by hand? This mod might be just what you are looking for.

This product wraps signatures in a <div> and forces the sig to a maximum height (in pixels) with CSS. If their sig goes over the maximum height, the sig area is limited to the specified height. Optionally, you can choose to have a vertical scroll bar displayed for the overflowing signature.

This product requires no template changes or file modifications at all. It is all done automagically in the plugin.

Contents:
This package includes:
2 Plugin:
"Add CSS code to vBulletin": Adds CSS code to the global CSS header.
"Put Signature in a <div>": Wraps the signature inside a <div> with the CSS class defined above.

1 Phrase:
sigsizecss: holds the CSS code to be added. In this product, it creates a class called "sizedsig" that will be used for the sig <div>

2 Option/Setting:
maxsigsize: (group "Signature Sizing"): This is the maximum size, in pixels, a signature is allowed to grow.

sigsizescroll: (group "Signature Sizing"): [yesno] Option to add scroll bars to the oversized signatures, or to just clip the signature.

Installation Instructions:

Step 1: Import the product .xml file (attached here)

Step 2: Change the "maxsigsize" option to your desired maximum signature size. This number is in pixels. The default is "150".

Step 3: Change the "sigsizescroll" option to yes to add scroll bars to oversized signatures, or no to just clip the region with no scroll bars.

Step 4: Enjoy.

Version History:
version 0.9 - Initial release]
version 0.91]
Added option to choose scroll bars.

hiiped
03-14-2006, 11:23 PM
very nice

< will likely install >

sinaluna
03-14-2006, 11:24 PM
Please let me know if there are any problems with this modification. The CSS has been tested on most major browsers and is "hacked" to work with quirky and standard DOMs.

Please post here if you have any problems with the CSS on a specific Browswer. The Browser AND VERSION will be needed to try to debug if any problems arise.

Thanks and enjoy.

AlchemyX
03-15-2006, 08:21 AM
ha, I just started working on this exact thing about 10 minutes ago, but decidewd to check and see if it was already done first.

Nice job :-)

sinaluna
03-15-2006, 08:33 AM
:) Thanks.

Wrote a bunch of little hacks in the last few months. Have some time this week so Im trying to "productize" them and release them before I get busy again.

Freezerator
03-15-2006, 09:41 AM
Nice one, i had this already manually in my style editted, but the less edits the better!

OverMindpt
03-15-2006, 10:30 AM
Perfect ...

COBRAws
03-15-2006, 12:21 PM
Very Handy. Thank you.

MentaL
03-15-2006, 12:38 PM
whos a good boy then :P

FleaBag
03-15-2006, 12:51 PM
Awesome stuff. Cheers!

Doc Great
03-15-2006, 12:58 PM
Great! I like it

* click install

Snake
03-15-2006, 06:22 PM
Awesome!

Megareus Rex
03-15-2006, 07:05 PM
Just one question. Is there a way to prevent users from going over the pixel height limit altogether? Like, preventing them from saving the sig if it exceeds that limit.

sinaluna
03-15-2006, 09:49 PM
Is there a way to prevent users from going over the pixel height limit altogether? Like, preventing them from saving the sig if it exceeds that limit.

Short Answer: not really.

Problem is that the sig height can display different in different browsers, various default text sizes, etc. The actual height is determined when the sig is rendered in the browser. Even if you could get that information back from the browser to the server, or limit it with a client-side script, it is not guaranteed to be the same height in other's browsers.

For instance, a user could shrink their default text size to the smallest setting and save their really long sig under those settings. Everyone with normal text size would have a much larger sig displayed. Hope that makes sense.

Megareus Rex
03-15-2006, 11:47 PM
Short Answer: not really.

Problem is that the sig height can display different in different browsers, various default text sizes, etc. The actual height is determined when the sig is rendered in the browser. Even if you could get that information back from the browser to the server, or limit it with a client-side script, it is not guaranteed to be the same height in other's browsers.

For instance, a user could shrink their default text size to the smallest setting and save their really long sig under those settings. Everyone with normal text size would have a much larger sig displayed. Hope that makes sense.
Dang. Well then, its not exactly what I want, but its the closest thing I've seen yet!

*clicks install*

Freesteyelz
03-16-2006, 12:06 AM
:) This is similar to the modification I released a couple of days ago but have been doing for years on my forum:

Prevent Oversized Images Breaking Message Tables (https://vborg.vbsupport.ru/showthread.php?t=110310)

With yours, however, it comes equipt with a nice plugin. Cool to know that many of us want similar features. :)

lordofgun
03-16-2006, 01:08 AM
Great mod!

Any way this could limit width as well?

sinaluna
03-16-2006, 01:34 AM
This is similar to the modification I released a couple of days ago but have been doing for years on my forum:Hey, very cool. I had a heck of a time getting IE, Opera and Firefox all to play well with the overflow settings. Ill have to take a look at how you did it and see if I missed anything.

Any way this could limit width as well?Sure, you could make it work. The reason I didn't add it here is that setting it to an absolute max is a problem in some styles. The flow of the thread is vertical so it was not a big deal to limit it in that direction. People run their browsers in many different widths, so you could introduce some strangeness.

On first thought, maybe by adding a "max-width:" setting in the phrase holding the CSS. Maybe something like:

.sizedsig {
max-height:{1}px;
height:expression(this.scrollHeight > {1}? "{1}px" : "auto" );
overflow:auto;
overflow-x:hidden;
}

changed to:

.sizedsig {
max-height:{1}px;
max-width:600px;
height:expression(this.scrollHeight > {1}? "{1}px" : "auto" );
overflow:auto;
overflow-x:hidden;
}

You might have to play with an "overflow-y:" setting as well. Make sure if you play with these that you check the results with at least IE6, firefox and opera. The all deal with overflow differently.

Good luck and let me know how it goes.

Freesteyelz
03-16-2006, 03:06 AM
Opera have always given me the most problems when CSS is concerned. Props to you sinaluna on a great mod and support. :)

rwoelich
03-16-2006, 04:32 AM
Coolest. Hack. Ever. :p

Well, maybe not coolest, but definitely up there.

If you use this in combination with the "Extended Signature Limits" hack, you can control almost all aspects of the signatures... if they find a way to break your line limit, tada!

Nice work.

sinaluna
03-16-2006, 04:55 PM
Opera have always given me the most problems when CSS is concerned.Same here. Kept throwing up grayed out horizontal scroll bars until I got the order of things just right. IE does not have max-height: and the work arounds for that confused opera. Early versions of Firefox were also flakey.

If you use this in combination with the "Extended Signature Limits" hack, you can control almost all aspects of the signatures... if they find a way to break your line limit, tada!Oh, good idea...

Lineman28645
03-16-2006, 08:57 PM
not bad idea but i dont like the idea of that bar being in the signature.

NR Fatal
03-16-2006, 10:14 PM
not bad idea but i dont like the idea of that bar being in the signature.

same here, anyway to just Cut off their sig or give them an error when they add a sig too big?

Freesteyelz
03-16-2006, 10:59 PM
To simply cut it off just replace "auto" with "hidden".

sinaluna
03-16-2006, 11:25 PM
Hmmm, I can make this an vBulletin option to either add scrolls or just cut it off. Let me think about it. Would anyone use this if I added it?

Freesteyelz
03-16-2006, 11:29 PM
I think it'll be a good idea. With my mod, by default the oversized signature area is cut off. To add a scrollbar users have to edit the template. Since your version is via plugin and Admin CP intergrated people could really benefit from it as it gives them options.

sinaluna
03-20-2006, 05:12 AM
Just uploaded version 0.91 which adds an option to choose whether or not to display scroll bars on oversized signatures. Thanks to Freesteyelz and others for the suggestion.

As always, please let me know if there are any problems or suggestions on this product. Hope you enjoy it.

ThePimp
03-20-2006, 08:13 AM
Can this be modified to do Height / Width?

sinaluna
03-21-2006, 11:37 PM
Can this be modified to do Height / Width?
Discussed this above in this thread here Im not planning on adding width to the standard hack unless there a huge demand for it. A set width would not work well with many styles, so I can see it making the hack incompatible. If there is enough interest, however, I can add some more conditional stuff and add width.

Sim9
03-25-2006, 10:53 PM
Good plugin!

I'd like to add my vote for width support. I added it in myself using this code for sizedsig (width limited to 500 pixels):

<style>
<!--
.sizedsig {
max-height:{1}px;
max-width:500px;
height:expression(this.scrollHeight > {1}? "{1}px" : "{2}" );
width:expression(this.scrollWidth > 500? "500px": "auto" );
overflow:{2};
overflow-x:hidden;
}
// -->
</style>

This seems to be compatable with IE and FireFox (untested in Opera).

antialiasis
03-26-2006, 12:16 AM
Installed. Thanks for this.

sinaluna
03-26-2006, 01:49 AM
Good plugin!

I'd like to add my vote for width support. I added it in myself using this code for sizedsig (width limited to 500 pixels):

<style>
<!--
.sizedsig {
max-height:{1}px;
max-width:500px;
height:expression(this.scrollHeight > {1}? "{1}px" : "{2}" );
width:expression(this.scrollWidth > 500? "500px": "auto" );
overflow:{2};
overflow-x:hidden;
}
// -->
</style>

This seems to be compatable with IE and FireFox (untested in Opera).
OK...Ill take a look early this week and add the width thing.

SHalliday
04-19-2006, 02:34 PM
Clicked Install with a huge smile on my face! Worked perfect right out of the box. Thank you very much for such a useful and timesaving plugin.

This takes care of having to manage member signature size. Awesome plugin and very easy to install.

Sim9
04-19-2006, 09:55 PM
Uh oh. I found out recently that the expression tag causes some versions of IE to crash (http://www.ghidinelli.com/blog/permalink/?id=20040923112702). Some of my users have experienced this behavior. Removing the expression tags fixes the crash, but leaves the sig-size as unlimited. Any suggestions?

almqdad
04-20-2006, 02:12 AM
hi

maxsigsize: (group "Signature Sizing"): This is the maximum size, in pixels, a signature is allowed to grow.

sigsizescroll: (group "Signature Sizing"): [yesno] Option to add scroll bars to the oversized signatures, or to just clip the signature

where is this option can some one tell me
thanks

Sim9
04-23-2006, 08:11 PM
Do you mean where to modify them? Those are accessable from your admincp under vBulletin options -> Signature Sizing

Kungfu
05-12-2006, 10:51 PM
Ok i tried to do it myself but i dont know how.

I want to add it so that at least a usergroup is excluded from the signature being resized.

I tried to add in the postbit_complete one and parse_templates.

$ignore_groups = split(',', $vbulletin->options['siggroupexception']);

if(!is_member_of($vbulletin->userinfo, $ignore_groups) )
{
sigcode here
}

Anyone know what how i would go about doing this.

siggroupexception is a new option

<setting varname="siggroupexception" displayorder="30">
<datatype>free</datatype>
<defaultvalue>5,6,7</defaultvalue>
</setting>

I put that in.

If anyone could help that be great. Thanks.

mano1.com
05-13-2006, 03:58 AM
Great thanks!

I had done something similar on my old version of vB and lost all mu custom stuff when I finally upgraded to the latest version this week.

This saves me time as I don't have to do it again, and the "product" format is nice and clean.

FleaBag
05-16-2006, 09:46 PM
Just got this running. Lush!! Thanks a lot, feels really nice!

nervous
05-17-2006, 06:10 PM
http://img210.imageshack.us/img210/3383/adsz4ow.jpg

where is the signature????

nervous
05-17-2006, 06:22 PM
i solved the problem.If you use this (vBSEO :: Conditional Signatures ) plugin signature are not seen. sory my bad english :)

KubisForce
05-22-2006, 02:32 PM
Good plugin. Thanks :)

arindra
05-26-2006, 10:03 AM
very pretty and simple mod :)

bada_bing
06-28-2006, 04:34 PM
Any updates on adding support for width?

noj75
07-03-2006, 07:29 PM
Hi,

* noj75 Clicks Install

Just one thing. You may want to edit the product file:

<phrasetype name="GLOBAL" fieldname="global">
<phrase name="sigsizecss"><![CDATA[<style>
<!--
.sizedsig {
max-height:{1}px;
height:expression(this.scrollHeight > {1}? "{1}px" : "{2}" );
overflow:{2};
overflow-x:hidden;
}
// -->
</style>]]></phrase>


The style needs a "type" attribute for xhtml validation:

<phrasetype name="GLOBAL" fieldname="global">
<phrase name="sigsizecss"><![CDATA[<style type="text/css">
<!--
.sizedsig {
max-height:{1}px;
height:expression(this.scrollHeight > {1}? "{1}px" : "{2}" );
overflow:{2};
overflow-x:hidden;
}
// -->
</style>]]></phrase>


Took me ages to find what was breaking my xhtml validation. I eventually found it in your product file. Made the edit and re-uploaded and all is now xhtnl valid.
Hope that helps you. Thanks for a great hack.

Kindest regards.

sinn3d
07-11-2006, 11:10 PM
Thanks for this nice plugin! Works perfectly.

The Notorious
08-10-2006, 04:46 PM
This works for 3.6?

sinaluna
08-10-2006, 10:19 PM
Checking on my test forum now. Ill get back to you in a day or so, but I think it should work.

The Notorious
08-11-2006, 03:06 PM
Checking on my test forum now. Ill get back to you in a day or so, but I think it should work.
Thanks, will be waiting.

DimensionZero
08-17-2006, 10:32 PM
This works like a charm on 3.6!
Thanks!

NeitherSparky
09-20-2006, 12:45 AM
This is the greatest feature in the history of the universe. -_- I have had a hell of time policing sigs on my forum; I HATE huge sigs and my "no sig image over 100 pix high" and "only one image per sig" rules were making a few users grumble. THIS IS AWESOME. Thanks!!!

(Btw, using 3.6 and no problems.)

bada_bing
09-26-2006, 07:30 PM
sinaluna

Did you add the Width size limit yet? This would be awesome of you can do this please ... Update us with a status as several posts ago you said you would take a look?

ShadowOne
10-14-2006, 04:00 PM
Is There A Way To Have This Done For Width? Cuz It Just Cuts The Side Off... Instead Of A Side Scroll...

pcxmedia
10-16-2006, 08:29 PM
works awesome on 3.6.2

Mysticales
10-17-2006, 08:31 AM
Anyway to add usergroup support? Like I have a couple usergroups that are allowed larger sigs, I use the sig limit plugin, then paid subs get a larger size allowance, and then a buyable usergroup gets a bigger one yet.

How can I make it enforce based on the users usergroup?

GlitterKill
10-21-2006, 11:44 PM
It works great! Thanks!

ShadowOne
10-31-2006, 02:28 PM
No more Support?

El Orans
11-05-2006, 09:29 AM
* Clicks Install *

bulbasnore
01-07-2007, 01:28 PM
Functions on 3.6.4

dc pringle
01-08-2007, 04:49 AM
does this plugin have a feature to allow members of certain usergroups to be an exception?

For example, is their a function on this plugin with which i can allow moderators to be exempt from the signature restrictions?

ximcix
01-19-2007, 11:25 AM
Great product, but please update & allow us to specify "MAXHEIGHT" and "MAXWIDTH"

Yvgeniy
01-22-2007, 01:43 AM
Great hack! Now my mods and I don't have to spend so much time modding sig violations. It would be nice if you added a width option as well, however, because believe it or not but some people abuse that.

tobybird
01-22-2007, 02:25 PM
Running 3.6.4

Works perfectly. Would absolutely love this functionality with width as well.

Thanks much! Clicked Install :)

bada_bing
01-22-2007, 02:53 PM
vb 3.6.4 has this built in correct?

tobybird
01-22-2007, 05:26 PM
vb 3.6.4 has this built in correct?

Not for external signature images.

Sol_Invictus
01-29-2007, 06:00 AM
This works fantastic with 3.6.4. I've got it installed on my forums.

Abe Babe
05-06-2007, 09:20 AM
I've been looking for something like this that actually works for around 4 years now. We have a rule for the maximum area that a sig can take up, and it's the biggest pain to enforce.

As my forum is a fixed with, I have already used a div with CSS overflow to restrict the width myself, but height was always an issue. I've found so many hacks in the past which claimed to do as yours does, but the problem was that they either didn't work, or they forced a specified height to be displayed, even if the user only had a small one line sig, leaving a gap below smaller sigs. Yours is the first one I've found which actually doesn't do that.

So I thank you so much for this hack ... this will save a lot of headaches. :D

Abe Babe...

ssandgirls
05-26-2007, 03:04 AM
Hello, this will be the 1st mod Ive installed, I transferred over from phpBB only 5 days ago.

I have imported the XML file, and am wondering where I change the following:


Step 2: Change the "maxsigsize" option to your desired maximum signature size. This number is in pixels. The default is "150".

Step 3: Change the "sigsizescroll" option to yes to add scroll bars to oversized signatures, or no to just clip the region with no scroll bars.



Where are those options found ?

Thankyou in advance, Im not sure where to change that and the instructions dont say.

Terrie

sinaluna
07-30-2007, 11:39 PM
Great product, but please update & allow us to specify "MAXHEIGHT" and "MAXWIDTH"I have not discovered a way to make maxwidth work with fluid forums.

Hello, this will be the 1st mod Ive installed, I transferred over from phpBB only 5 days ago.

I have imported the XML file, and am wondering where I change the following:



Where are those options found ?

Thankyou in advance, Im not sure where to change that and the instructions dont say.

TerrieYou can find those options under vBulletin Options / Signature Sizing

tobybird
08-09-2007, 11:18 AM
I have not discovered a way to make maxwidth work with fluid forums.
To anyone looking for a quick fix... I just added the CSS property max-width directly to the plugin and it's working great. :)

TalkBolts
08-13-2007, 09:18 AM
This is EXACTLY what I was looking for! Thx!

Forgott3n
01-05-2008, 11:09 PM
A perfect mod for what I need. Some people just don't get the concept of easy reading.

Traxdata
01-08-2008, 02:40 PM
does it work on vb3.7?

Polo
04-01-2008, 12:36 AM
Awesome Hack! Thanks :) works perfectly on 3.7.0

Forgott3n
07-16-2008, 06:44 AM
Working on 3.7.2 PL1

kiwivc
07-24-2008, 01:03 AM
Works perfectly on 3.6.8 Patch Level 2

ViViD
04-26-2009, 06:45 AM
Hello
This good hack works for 3.8.2

denman75
06-09-2009, 05:32 PM
can u make for width also please :)

HG-ILUSION
07-10-2009, 10:48 AM
Works fine in vBulletin 3.8.3

Thanks.

gonedigital
12-14-2009, 04:18 AM
works in 3.8.4

my only complaint is I wish it didn't cut their sigs off, i wished it automatically re-sized the sig to the defined sizes (i.e 550x150 or whatever the parameters are set at).

Tettinntil
01-31-2010, 08:02 PM
Thanks! Is there an option for letting certain usergroups have other settings?

Tettinntil
02-12-2010, 03:26 PM
Thanks! Is there an option for letting certain usergroups have other settings?Anyone?

SRobbins1977
02-06-2013, 03:23 AM
Installed your mod. It did this to my forums:
https://vborg.vbsupport.ru/external/2013/02/26.jpg

So I had to uninstall it.:mad:

Digital Jedi
02-06-2013, 03:31 AM
Installed your mod. It did this to my forums:
https://vborg.vbsupport.ru/external/2013/02/26.jpg

So I had to uninstall it.:mad:
That suggests that your skin is missing a closing tag somewhere.

SRobbins1977
02-09-2013, 09:48 PM
That suggests that your skin is missing a closing tag somewhere.Thank Digital, I figured it out on how to do it manually for vB 4 and posted instructions if you want to take a look.
thank you.