Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Prevent Oversized Images Breaking Message Tables & Sigs 2.1 Details »»
Prevent Oversized Images Breaking Message Tables & Sigs 2.1
Version: 2.1, by Freesteyelz Freesteyelz is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.5.3 Rating:
Released: 03-13-2006 Last Update: 03-14-2006 Installs: 125
Template Edits
 
No support by the author.

Description: Using the CSS "overflow" attribute you can prevent large images from breaking your message column. This helps extremely for the people who use fixed widths. Images that display larger than the message column width will show a horizontal bar.

But it has already been done: Yes, but the other (non) CSS methods affect the overall performance of the forum. The CSS method previously provided required editing a .php file. Plus, in Internet Explorer both the horizontal and vertical scrollbar displayed. This method eliminates the vertical scrollbar. The modification only requires editing the postbit and/or postbit_legacy template and Main CSS.

What else to expect: The horizontal scrollbar will affect the entire post of the oversized image. That's the nature of the modification. No biggie.

Targeted Layout Type: Fixed width layout

Browsers tested: Internet Explorer and Firefox

Compatible vB versions: 3.5.3, 3.5.4, 3.5.5 and 3.6+

Thank yous: CyberAlien (Correction on ID to Class); kennn (PM resize - conditional code below)



Optional Modifications Added (3.14.06)!:
A) Signature (Cuts off oversized signatures in message bits by width & height.)

B) vBadvanced Newsbit (Same like the original, just with vBadvanced.)

C) vBadvanced Newsbit Signatures (Same like the original signature mod, just with vBadvanced.)

D) Private Message conditional posted by kennn (click here to post)

-----------------

Finally, let's edit!
(Or you can download the .txt file for the installation instructions)

1. Back up your templates!

2. In your postbit or postbit_legacy template find this or something similar to:

Code:
  <!-- message -->
  <div id="post_message_$post[postid]">$post[message]</div>
  <!-- / message -->
Replace it with:

Code:
  <!-- message -->
  <div id="post_message_$post[postid]" class="hidemsg">$post[message]</div>
  <!-- / message -->
3. Click "Save".

4. In Main CSS go to the bottom at Additional CSS Definitions and add code bit:

Code:
.hidemsg  {
  width:700px;
  padding-bottom:20px;
  overflow:auto;
  overflow-x:auto;
  overflow-y:hidden;
  }
5. Change the width "700px" to whatever you want. All other settings keep.

6. Click "Save".

7. Click if you use it.

Finished!


*For those of you who use a fluid layout take a look at this post. Thanks 007 for sharing.


=====================

Optional Modifications (Below)!!!:

*The 3 (A, B & C) optional modifications below follow the same steps as above with the exception of #2, #4 and #5.

A) For Signatures (Hide Oversized Images width & height):

2. In your postbit or postbit_legacy template find this or something similar to:

Code:
  <!-- sig -->
   <div>
    __________________<br />
    $post[signature]
   </div>
  <!-- / sig -->
Replace it with:

Code:
  <!-- sig -->
   <div class="hidesig">
    __________________<br />
    $post[signature]
   </div>
  <!-- / sig -->
4. In Main CSS go to the bottom at Additional CSS Definitions and add code bit:

Code:
.hidesig  {
  width:700px;
  height:400px;
  overflow:hidden;
  }
5. Change the width "700px" and height "400px" to whatever you want. Signatures (text or image) that exceed either width or height limit will be cut off. This code does not affect the message Table. Keep the remaining codes the same.

*If the center tag doesn't work in the signature after implementing the code above see this post for the solution.

---------------------------------

B) For vBAdvanced Newsbits:

2. In your vBadvanced CMPS Templates --> adv_portal_newsbits template find this or something similar to:

Code:
  $news[message]
Replace it with:

Code:
  <!-- message -->
                <div class="hideadvnews">
  $news[message]
                </div>
  <!-- / message -->
4. In Main CSS go to the bottom at Additional CSS Definitions and add code bit:

Code:
.hideadvnews {
  width:700px;
  padding-bottom:20px;
  overflow:auto;
  overflow-x:auto;
  overflow-y:hidden;
  }
5. Change the width "700px" to whatever you want. All other settings keep.

---------------------------------

C) For vBAdvanced Newsbits (Signature):

2. In your vBadvanced CMPS Templates --> adv_portal_newsbits template find this or something similar to:

Code:
  <if condition="$show['signature']">
  <div>__________________<br />
  $news[signature]</div>
  </if>
Replace it with:

Code:
  <if condition="$show['signature']">
  <div class="hideadvsig">__________________<br />
  $news[signature]</div>
  </if>
4. In Main CSS go to the bottom at Additional CSS Definitions and add code bit:

Code:
.hideadvsig  {
  width:700px;
  height:400px;
  overflow:hidden;
  }
5. Change the width "700px" and height "400px" to whatever you want. Signatures (text or image) that exceed either width or height limit will be cut off. This code does not affect the vBadvanced message Table. Keep the remaining codes the same.

*If the center tag doesn't work in the signature after implementing the code above see this post for the solution.

Finished (Once More)!

7. Click if you use it.

Show Your Support

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

Comments
  #2  
Old 03-14-2006, 03:23 AM
GTAce GTAce is offline
 
Join Date: Nov 2005
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yaaayy!! I've been looking for a 3.5.4 compatible resizer lately and couldn't find one...and this one, with the scroll bar is very interesting

Will check it out now
Reply With Quote
  #3  
Old 03-14-2006, 04:03 AM
Zia's Avatar
Zia Zia is offline
 
Join Date: Dec 2005
Location: golpo.net
Posts: 931
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

simply a good idea for fixed width skin...
will that cut-off the image or re-size?
my bad luck...abt browser..hope it mite work on opera too
what will it do?
Reply With Quote
  #4  
Old 03-14-2006, 04:18 AM
RaZor Edge's Avatar
RaZor Edge RaZor Edge is offline
 
Join Date: Jan 2002
Location: Quebec city
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent!!! With vb 3.5 i don't like to edit php files... so your Template modification is perfect for me!!
Reply With Quote
  #5  
Old 03-14-2006, 04:52 AM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yup. I too don't like editing .php files.

Quote:
Originally Posted by Zia
simply a good idea for fixed width skin...
will that cut-off the image or re-size?
my bad luck...abt browser..hope it mite work on opera too
what will it do?
It does neither. Basically the code adds a horizontal bar in a post with oversized images using the "auto" value. If you want to simply cut off the image just replace "auto" with "hidden". As for Opera, I don't know. My guess is CSS strict compliant browsers will render the code properly.

An example is provided in my first post just in case you didn't see it.
Reply With Quote
  #6  
Old 03-14-2006, 10:34 AM
agiacosa agiacosa is offline
 
Join Date: Dec 2004
Posts: 208
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Be great if you could get this to work for vBA CMPS portal. Nice hack in any event.
Reply With Quote
  #7  
Old 03-14-2006, 11:03 AM
LBSources LBSources is offline
 
Join Date: Nov 2005
Location: New York
Posts: 329
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wow! this is great .. now i can set a larger size for images and it wont break the margins.. sweet!

/me clicks install
Reply With Quote
  #8  
Old 03-14-2006, 12:08 PM
FleaBag's Avatar
FleaBag FleaBag is offline
 
Join Date: Dec 2001
Posts: 1,674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installified!
Reply With Quote
  #9  
Old 03-14-2006, 03:48 PM
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Location: UK
Posts: 842
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed and works a treat, well done.

Laters
Reply With Quote
  #10  
Old 03-14-2006, 08:02 PM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you again for the feedback and support everyone!

Quote:
Originally Posted by agiacosa
Be great if you could get this to work for vBA CMPS portal. Nice hack in any event.
Ask and shall receive. Updated above are the optional codes. :banana:

Optional Modifications Added (3.14.06)!:

1. Signature (Cuts off oversized signatures in message bits by width & height.)

2. vBadvanced Newsbit (Same like the original, just with vBadvanced.)

3. vBadvanced Newsbit Signatures (Same like the original signature mod, just with vBadvanced.)
Reply With Quote
Reply


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 12:56 PM.


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.04928 seconds
  • Memory Usage 2,315KB
  • Queries Executed 23 (?)
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
  • (12)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
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete