PDA

View Full Version : CSS Signature Size Enforcer


sinaluna
15 Mar 2006, 01:22
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
15 Mar 2006, 01:23
very nice

< will likely install >

sinaluna
15 Mar 2006, 01:24
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
15 Mar 2006, 10:21
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
15 Mar 2006, 10:33
:) 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
15 Mar 2006, 11:41
Nice one, i had this already manually in my style editted, but the less edits the better!

OverMindpt
15 Mar 2006, 12:30
Perfect ...

COBRAws
15 Mar 2006, 14:21
Very Handy. Thank you.

MentaL
15 Mar 2006, 14:38
whos a good boy then :P

FleaBag
15 Mar 2006, 14:51
Awesome stuff. Cheers!

Doc Great
15 Mar 2006, 14:58
Great! I like it

* click install

Snake
15 Mar 2006, 20:22
Awesome!

Megareus Rex
15 Mar 2006, 21:05
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
15 Mar 2006, 23:49
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
16 Mar 2006, 01:47
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
16 Mar 2006, 02:06
:) 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 (http://www.vbulletin.org/forum/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
16 Mar 2006, 03:08
Great mod!

Any way this could limit width as well?

sinaluna
16 Mar 2006, 03:34
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
16 Mar 2006, 05:06
Opera have always given me the most problems when CSS is concerned. Props to you sinaluna on a great mod and support. :)

rwoelich
16 Mar 2006, 06:32
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
16 Mar 2006, 18:55
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
16 Mar 2006, 22:57
not bad idea but i dont like the idea of that bar being in the signature.

NR Fatal
17 Mar 2006, 00:14
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
17 Mar 2006, 00:59
To simply cut it off just replace "auto" with "hidden".

sinaluna
17 Mar 2006, 01:25
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
17 Mar 2006, 01:29
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
20 Mar 2006, 07:12
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
20 Mar 2006, 10:13
Can this be modified to do Height / Width?

sinaluna
22 Mar 2006, 01:37
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
26 Mar 2006, 00:53
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):



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



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

antialiasis
26 Mar 2006, 02:16
Installed. Thanks for this.

sinaluna
26 Mar 2006, 03:49
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):



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



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
19 Apr 2006, 16:34
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
19 Apr 2006, 23:55
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
20 Apr 2006, 04:12
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
23 Apr 2006, 22:11
Do you mean where to modify them? Those are accessable from your admincp under vBulletin options -> Signature Sizing

Kungfu
13 May 2006, 00:51
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
13 May 2006, 05:58
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
16 May 2006, 23:46
Just got this running. Lush!! Thanks a lot, feels really nice!

nervous
17 May 2006, 20:10
http://img210.imageshack.us/img210/3383/adsz4ow.jpg

where is the signature????

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

KubisForce
22 May 2006, 16:32
Good plugin. Thanks :)

arindra
26 May 2006, 12:03
very pretty and simple mod :)

bada_bing
28 Jun 2006, 18:34
Any updates on adding support for width?

noj75
03 Jul 2006, 21:29
Hi,

/me Clicks Install

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



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



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



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



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
12 Jul 2006, 01:10
Thanks for this nice plugin! Works perfectly.

The Notorious
10 Aug 2006, 18:46
This works for 3.6?

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

The Notorious
11 Aug 2006, 17:06
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
18 Aug 2006, 00:32
This works like a charm on 3.6!
Thanks!

NeitherSparky
20 Sep 2006, 02:45
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
26 Sep 2006, 21:30
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
14 Oct 2006, 18:00
Is There A Way To Have This Done For Width? Cuz It Just Cuts The Side Off... Instead Of A Side Scroll...

pcxmedia
16 Oct 2006, 22:29
works awesome on 3.6.2

Mysticales
17 Oct 2006, 10:31
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
22 Oct 2006, 01:44
It works great! Thanks!

ShadowOne
31 Oct 2006, 16:28
No more Support?

El Orans
05 Nov 2006, 11:29
* Clicks Install *

bulbasnore
07 Jan 2007, 15:28
Functions on 3.6.4

dc pringle
08 Jan 2007, 06:49
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
19 Jan 2007, 13:25
Great product, but please update & allow us to specify "MAXHEIGHT" and "MAXWIDTH"

Yvgeniy
22 Jan 2007, 03:43
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
22 Jan 2007, 16:25
Running 3.6.4

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

Thanks much! Clicked Install :)

bada_bing
22 Jan 2007, 16:53
vb 3.6.4 has this built in correct?

tobybird
22 Jan 2007, 19:26
vb 3.6.4 has this built in correct?

Not for external signature images.

Sol_Invictus
29 Jan 2007, 08:00
This works fantastic with 3.6.4. I've got it installed on my forums.

Abe Babe
06 May 2007, 11:20
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
26 May 2007, 05:04
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
31 Jul 2007, 01:39
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
09 Aug 2007, 13:18
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
13 Aug 2007, 11:18
This is EXACTLY what I was looking for! Thx!

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

Traxdata
08 Jan 2008, 16:40
does it work on vb3.7?

Polo
01 Apr 2008, 02:36
Awesome Hack! Thanks :) works perfectly on 3.7.0

Forgott3n
16 Jul 2008, 08:44
Working on 3.7.2 PL1

kiwivc
24 Jul 2008, 03:03
Works perfectly on 3.6.8 Patch Level 2

ViViD
26 Apr 2009, 08:45
Hello
This good hack works for 3.8.2

denman75
09 Jun 2009, 19:32
can u make for width also please :)

HG-ILUSION
10 Jul 2009, 12:48
Works fine in vBulletin 3.8.3

Thanks.

gonedigital
14 Dec 2009, 06:18
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
31 Jan 2010, 22:02
Thanks! Is there an option for letting certain usergroups have other settings?

Tettinntil
12 Feb 2010, 17:26
Thanks! Is there an option for letting certain usergroups have other settings?Anyone?