![]() |
User-set signature size limit
I hate big signatures. I hate them with a passion: I use a laptop for half of my forumwork, and it's an old beasty with an 800x600 resolution cap. Big signatures turn a simple thread into a massive scrollfest. Therefore, I put signature size limits on my forum... just a simple overflow pane on the signature that forced scrollbars onto sigs over the size limit of 150x550 pixels. It worked well enough, but users were complaining that 1) it messed with sig centering, as they center inside the 550px division instead of the entire postbit, and 2) some lazy scrollwheel users got caught inside the vertical scrollbar and it made their scrolling jerky (aww, muffin).
I was initially going to just ignore the complaints because I know I am always right, but then someone pointed out I could just make the sig size limit end-user defined. It took a bit of work, but here it is... my first real vBulletin plugin that isn't a complete and utter bit of hack-work. ADMIN NOTES: This allows users to specify how large they want signatures to display as on their page. Any larger than the specified values, and the signature will get scrollbars to contain it. If the users leave the signatures size limit fields blank, then to them signatures will appear totally normal, as if this plugin hadn't been added. Whatever the user has his settings at will not affect the way other users view his or other signatures. STEP ONE: Set up two custom user fields (single-line text entry) called something like "Sig Height Limit" and "Sig Width Limit". Set them to private and unsearchable, and give them descriptions for the users. Here is my description for "Signature Horizontal Limit" on my forum: Quote:
STEP TWO: I work only in Legacy format, so if you use the new-fangled postbit this might be a bit different. Anyway, in postbit_legacy look for: Code:
<if condition="$post['signature']"> Code:
<!-- sig --> A quick hack I suggested to members of my forum: Quote:
Simply notify your users where to find the sig restriction settings, and remind them to include the "px" after the value they enter (although if you wanted to code this out you easily could. I wanted to leave my technically-inclined users the option to enter %, *, or other values there should they choose). This system has been tested in FireFox, IE, and Netscape. Please post any problems with it; I am an artist, not a programmer, so I have no idea if I've made any dire mistakes. UNINSTALLING: To uninstall, simple revert the changed code back to vBulletin default, and delete your custom user groups. A txt file is attached that includes the changed code; just store it in your records if you don't care to try to find this topic again. |
Please post a text file with the instructions so users will have it if they ever need to re-install it. ;)
This would be great to have for the new postbit, too. ;) |
also can you provide a screenshot of before and after
|
I added a .txt file as requested. Here are two screens:
1) A large signature with no size restrictions, including a centered emoticon and a non-centered 640x480 image. 2) The exact same signature with a 150x550 pixel restriction placed on it using this hack. Note that the centered emoticon is now centered to the 550px wide panel, not to the entire postbit. |
/me installs
|
Excellent *installs*
I left out the option to adjust width, it didn't seem to be working properly, but height adjustment was all I wanted. |
Anyone know if it's possible to use this to let users block signatures over a certain size? Be it dimensions or file size?
|
All times are GMT. The time now is 10:42 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|