vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   Prevent Oversized Images Breaking Message Tables & Sigs 2.1 (https://vborg.vbsupport.ru/showthread.php?t=110310)

Freesteyelz 03-13-2006 10:00 PM

Prevent Oversized Images Breaking Message Tables & Sigs 2.1
 
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 https://vborg.vbsupport.ru/ 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 https://vborg.vbsupport.ru/ if you use it. :)

GTAce 03-14-2006 03:23 AM

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

Zia 03-14-2006 04:03 AM

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?

RaZor Edge 03-14-2006 04:18 AM

Excellent!!! With vb 3.5 i don't like to edit php files... so your Template modification is perfect for me!!

Freesteyelz 03-14-2006 04:52 AM

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

agiacosa 03-14-2006 10:34 AM

Be great if you could get this to work for vBA CMPS portal. Nice hack in any event.

LBSources 03-14-2006 11:03 AM

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

/me clicks install

FleaBag 03-14-2006 12:08 PM

Installified!

The Realist 03-14-2006 03:48 PM

Installed and works a treat, well done.

Laters

Freesteyelz 03-14-2006 08:02 PM

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


All times are GMT. The time now is 09:49 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.01264 seconds
  • Memory Usage 1,761KB
  • 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
  • (12)bbcode_code_printable
  • (2)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
  • (10)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