Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Prevent Oversized Images Breaking Message Tables & Sigs 2.1 Details »
Prevent Oversized Images Breaking Message Tables & Sigs 2.1
Mod Version: 2.1, by Freesteyelz (Member) Freesteyelz is offline
Developer Last Online: Apr 2010 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.5.3 Rating: (0 vote - 0 average) Installs: 125
Released: 14 Mar 2006 Last Update: 15 Mar 2006 Downloads: 65
Not Supported Template Edits  

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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Replace it with:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

3. Click "Save".

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


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Replace it with:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Replace it with:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Replace it with:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
  #61  
Old 14 Apr 2006, 00:40
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
The "700px" needs to be adjusted accordingly. I only used that number as an example.

I had in mind fixed width layouts when I did this mod but I'll run some tests with fluid layouts.
__________________


Reply With Quote
  #62  
Old 23 Apr 2006, 13:19
Hemanth's Avatar
Hemanth Hemanth is offline
 
Join Date: Nov 2005
Hi,

What is this "MAin CSS". Which file?
Reply With Quote
  #63  
Old 23 Apr 2006, 22:57
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
In your Admin CP go to:

Styles & Templates --> Style Manager --> All Style Options (select the style you're using) --> Main CSS
__________________


Reply With Quote
  #64  
Old 24 Apr 2006, 07:48
Hemanth's Avatar
Hemanth Hemanth is offline
 
Join Date: Nov 2005
In your Admin CP go to:

Styles & Templates --> Style Manager --> All Style Options (select the style you're using) --> Main CSS
Oh.. Tha k you.. I think it was a file in the clientscripts folder
Reply With Quote
  #65  
Old 25 Apr 2006, 01:53
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Nah. If that were the case I wouldn't be able to place this as a template mod. :classic:
__________________


Reply With Quote
  #66  
Old 30 Apr 2006, 16:20
SHOBizzy SHOBizzy is offline
 
Join Date: Apr 2004
Nice job! Thank you!

But I do have a little issue with the sig area stretching. (screenshot below) The in-post part works flawlessly.

Right now my "additional CSS" for signatures reads:

.hidesig {
width:700px;
height:310px;
overflow:auto;
}

And what happens is the sig area seems to be extended to the set size whether or not there is enough characters to actually fill it. On some people's sigs this is ok, but others it's quite obvious and ever so slightly annoying.



Maybe I missed something in my code that made it mess up. Thanks for any help you can give me.
Reply With Quote
  #67  
Old 01 May 2006, 00:55
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
You didn't miss anything, actually. By defining the height the affected area automatically adjusts to the size, which in your case is 310px. That's just the natural behavior for the value set. The width value was the primary focus for this mod; I added the height upon request.

CSS Conditionals and hacks won't work across browsers so it's better to avoid them as I did for the mod. I'm constantly experimenting so if (or when) I come across something of value I'll update this mod or possibly release a new one.
__________________


Reply With Quote
  #68  
Old 01 May 2006, 10:54
SHOBizzy SHOBizzy is offline
 
Join Date: Apr 2004
I didn't miss anything. It's a first, mark your calendars.

Thanks for the info and the hack.
Reply With Quote
  #69  
Old 02 May 2006, 00:14
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Hehe. Not a problem and thank you for clicking "Install".
__________________


Reply With Quote
  #70  
Old 03 May 2006, 03:33
kennn kennn is offline
 
Join Date: Mar 2006
I realize I'm a little late to the party on this but I wanted to point out that what was said in a post a couple pages back (and quoted below) is only half correct. You can have multiple classes on an element - it is perfectly legal to do this. The first example in the quote is incorrect as Freesteyelz points out. The second example is okay but adds an unnecessary DIV and extra code. The solution is this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Both classes will be used and this is completely acceptable CSS.

Originally Posted by Freesteyelz
You cannot place 2 "class" attributes in a a single div tag. This is what you currently have:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


If anything replace it with:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
Reply With Quote
  #71  
Old 03 May 2006, 04:37
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
You're correct Kenn in that multiple classes can be done by placing a space between them. The problem, however, is that not all browsers will render it the same way (one reference is with IE 6 and IE 7); I'm referring to cross-variables and inheritance. Since I did not know what was contained in "satellite_postbit" the safer route was to use two <div> tags.

My statement was a bit misleading so I thank you for the clarification. Ohh and thank your for clicking "Install".
__________________


Reply With Quote
  #72  
Old 03 May 2006, 05:41
kennn kennn is offline
 
Join Date: Mar 2006
Originally Posted by Freesteyelz
You're correct Kenn in that multiple classes can be done by placing a space between them. The problem, however, is that not all browsers will render it the same way (one reference is with IE 6 and IE 7); I'm referring to cross-variables and inheritance. Since I did not know what was contained in "satellite_postbit" the safer route was to use two <div> tags. My statement was a bit misleading so I thank you for the clarification.
Good point. I just thought I'd bring up that FYI as a lot of people don't realize you can list multiple classes like that. I know I was using CSS for a couple years before I discovered that "trick." I have three vbStyle skins myself (Element, Satellite and Aria) and they each use an additional class to set off the post text for formatting (which is a good idea and something I routinely add to my other skins). When I installed your hack, I just added your hidemsg class to the one that was already in there and it works like a charm.

Originally Posted by Freesteyelz
Ohh and thank your for clicking "Install".
You're most welcome!
Reply With Quote
  #73  
Old 03 May 2006, 06:54
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Yup. I need to be careful with my choice of wording (and spelling).

There's a powerful quality with CSS and like yourself I'm constantly finding new ways of implementing it. I'm glad to see another user who appreciates CSS and customizes it to suit his/her needs. :classic:
__________________


Reply With Quote
  #74  
Old 08 May 2006, 18:02
JaniU JaniU is offline
 
Join Date: Mar 2006
Hey, this works just great in normal posts but it messes up the private messages. I have only modded the postpit legacy and added the css. It streches all private messages even though there is no pictures in them. First I didn't believe it was because of this, but after removing the CSS all pm's showed fine again... and put it back and again they streched, probably to the width set in the css.

Any ideas??
Reply With Quote
  #75  
Old 08 May 2006, 18:16
kennn kennn is offline
 
Join Date: Mar 2006
I ran into this, too. My first thought was to change width to auto, which seemed to work fine for any skin no matter how wide or narrow the post area and also for PMs but then I tried it in IE and discovered that, without a specific pixel width declared, IE does not display a scrollbar and merely pushes the post area wider.

What I then did was go back to using an actual pixel width (which I also discovered needs to be figured out individually per skin or things like CENTER tags do not look centered) and then added the conditional around class shown below...


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Note, that I already had a class in there so I wrapped the second hidemsg class in the if conditional to add it in only if not in a "private" area. I cannot take credit for that conditional, btw. I found that on the joindays hack because it also does not work properly in the PM area.

If you do not already have a class in there, it would look like this...


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I'm not sure if this is the best way to do it but it works.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 10:13.

Layout Options | Width: Wide Color: