vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   CSS Signature Size Enforcer (https://vborg.vbsupport.ru/showthread.php?t=110401)

sinaluna 03-14-2006 10:00 PM

CSS Signature Size Enforcer
 
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

Quote:

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

Quote:

Originally Posted by sinaluna
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

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

Quote:

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.

Quote:

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:

Quote:

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

Quote:

.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

Quote:

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.

Quote:

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

Quote:

Originally Posted by Lineman28645
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

Quote:

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):

Code:

<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

Quote:

Originally Posted by Sim9
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:

<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. 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

Quote:

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????


All times are GMT. The time now is 05:26 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01375 seconds
  • Memory Usage 1,829KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete