Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
User-set signature size limit Details »»
User-set signature size limit
Version: 1.00, by MimeSong Erk MimeSong Erk is offline
Developer Last Online: Nov 2007 Show Printable Version Email this Page

Version: 3.5.4 Rating:
Released: 04-25-2006 Last Update: Never Installs: 6
 
No support by the author.

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:
Signature horizontal limit:
The maximum number of pixels you want signatures to display as before scrollbars are added. Enter as [number]px, eg 580px. Leave blank to allow unrestricted signature sizes.
Please note, for me the width limit field is field15 and the height limit field is field16. Your field names will probably be different, so take note of what they are and replace "field15" and "field16" with the appropriate values.

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']">
		<!-- sig -->
			<div>
				__________________<br />
				$post[signature]
			</div>
		<!-- / sig -->
		</if>
Replace that with this:

Code:
  <!-- sig -->
<if condition="$post['signature'] AND $bbuserinfo[field16] AND $bbuserinfo[field15]">
    <div>
       __________________
       <div style="overflow: auto; height: $bbuserinfo[field16]; width: &bbuserinfo[field15]">$post[signature]</div> 
    </div>
  <else />
    <if condition="$post['signature'] AND $bbuserinfo[field16]">
      <div>
         __________________
         <div style="overflow: auto; height: $bbuserinfo[field16]">$post[signature]</div> 
      </div>
     <else />
      <if condition="$post['signature'] AND $bbuserinfo[field15]">
        <div>
           __________________
           <div style="overflow: auto; width: $bbuserinfo[field15]">$post[signature]</div> 
        </div>
       <else />
        <if condition="$post['signature']">
          <div>
             __________________
             <div>$post[signature]</div> 
          </div>
        </if>
      </if>
    </if>
</if>
  <!-- / sig -->
Voila. If your users leave their sig restriction values blank, their vB will appear as if you'd changed nothing. If they put in restrictions, they could limit other users' sigs to appearing as any size they like.

A quick hack I suggested to members of my forum:
Quote:
OPTIONAL: Non-IE users can take advantage of a simple "cheat code" to get smoother signature restrictions. If you use FireFox, Mozilla, or anything but IE, try entering the following into the signature height field:
Code:
150px; max-width: 550px;
the first number (150px) is the height variable, the second the width variable. Leave the "signature horizontal limit" option totally blank. This won't screw anything up in IE, it simply won't do anything at all. The effect is very similar to setting a max width using the Horizontal Limit option, but it won't force your page to stretch to the width you've specified, if your window is smaller than the max-width.
STEP THREE:
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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 04-26-2006, 04:47 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 04-26-2006, 11:00 AM
puertoblack2003's Avatar
puertoblack2003 puertoblack2003 is offline
 
Join Date: Aug 2005
Location: Philadelphia
Posts: 1,073
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

also can you provide a screenshot of before and after
Reply With Quote
  #4  
Old 04-26-2006, 05:40 PM
MimeSong Erk MimeSong Erk is offline
 
Join Date: Apr 2006
Location: Japan
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 04-26-2006, 05:57 PM
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Posts: 3,832
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

/me installs
Reply With Quote
  #6  
Old 05-06-2006, 03:26 PM
MiccyNarc MiccyNarc is offline
 
Join Date: Dec 2005
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 10-10-2007, 05:26 PM
Deimos Deimos is offline
 
Join Date: Oct 2002
Posts: 529
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone know if it's possible to use this to let users block signatures over a certain size? Be it dimensions or file size?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:06 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04141 seconds
  • Memory Usage 2,264KB
  • Queries Executed 22 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete