PDA

View Full Version : Some forums have this, can we?


Louis
04-28-2014, 07:38 PM
Auto-resize, so when someone posts a massive image it doesn't mess up everything on the thread.

Edit: I should say on that page. It won't mess up the entire thread, just the page on which the large image appears.

(I'm pretty sure I've seen it on other fora that also run on vBulletin - is it just a switch that can be flipped on for us?)

thwart
04-28-2014, 08:06 PM
http://www.a-okpressurewashinginc.com/attachments/Image/Yellow_smiley.jpg

shovelhd
04-28-2014, 08:18 PM
:hello:

CunegoFan
04-28-2014, 08:26 PM
http://upload.wikimedia.org/wikipedia/commons/0/09/Operation_Crossroads_Baker_Edit.jpg

Louis
04-28-2014, 08:30 PM
yeah - just like THAT

oliver1850
04-28-2014, 08:39 PM
Thanks Louis, that would be nice in my opinion.

jimoots
04-28-2014, 08:40 PM
Not quite the flip of a switch... but on any other website this would usually be a super simple CSS tweak. Because the forum is quite an old design... it's a simple but very obscure tweak. It doesn't surprise me nobody has done it yet.... It took me a good half hour to work out why I couldn't get images to resize down to less than 100% of their parent's container.

Emptied out my knowledge banks and then started hassling Google for some help. It came, but not after half a dozen different searches.

An admin should be able to add this to the CSS:


table.tborder {
table-layout: fixed;
}

#posts .tborder .alt1 img, #posts .tborder .alt2 img {
max-width: 98%;
width: auto;
height: auto;
}


That will fix it. It doesn't change the size of the image you are downloading (i.e. it still downloads at full size) but it does change the size of the image displayed to 98% of the available space.

No charge :P but if anyone needs any web design work give me a yell :)

(For anyone playing along at home it is setting the desired table to 'table-layout:fixed' that lets max-width do it's magic.)

Louis
04-28-2014, 08:43 PM
That will fix it. It doesn't change the size of the image you are downloading (i.e. it still downloads at full size) but it does change the size of the image displayed to 98% of the available space.

What about smaller low-res images, will that enlarge them to 98% of the space? If the resolution is really low they might not look good.

gasman
04-28-2014, 08:46 PM
Keith should be able to handle this I believe but he will be off line for a while.

jimoots
04-28-2014, 08:48 PM
What about smaller low-res images, will that enlarge them to 98% of the space? If the resolution is really low they might not look good.

Smaller images will not be affected. The code I've proposed will only resize down images that are bigger than the parent container.

In my testing, I found that the "max-width:98%" declaration was not working without the "table-layout:fixed" declaration on the parent table.

This was pretty puzzling - until I spent a bit of time with Google I had never heard of declaring a value for table-layout. Tables are pretty old school in web design and I haven't really had to mess with them for quite a while now!

I suspect someone may have tried the max width declaration previously as they were unaware (as was I) that fixing the table layout was required for this to work.

I will post an example of the changes. Gimme a sec.

jimoots
04-28-2014, 08:53 PM
This is how it will look:

http://test.jamesw.com.au/etc/forum-change-example.html

Please disregard the broken image links for reply, quote, etc etc etc. I didn't want to download the entire asset library to my server for such a trivial test :)

bobswire
04-28-2014, 08:54 PM
No, don't mess with it. It's great having the ability to control your pixels to show off a frame or bike build. Most of us control our posting,don't screw it up because of one or two screw ups. Though jimmy-moots post above mine looks good but how would it affect smaller jpg.?

Louis
04-28-2014, 08:58 PM
It's great having the ability to control your pixels to show off a frame or bike build.

I don't think the total number of pixels will change.

Edit: but I agree, it doesn't happen that often.

jimoots
04-28-2014, 09:03 PM
No, don't mess with it. It's great having the ability to control your pixels to show off a frame or bike build. Most of us control our posting,don't screw it up because of one or two screw ups. Though jimmy-moots post above mine looks good but how would it affect smaller jpg.?

Louis is right. The code won't mess with your pixels. What it will do is allow people viewing on a different size screen to your own to see the full picture... or see it bigger than you can view it.

Really it's a good thing, there is no drawback to it. You still have control. It just allows better viewing if someone's using a different screen/device to yours.

And as I said a little bit above, it won't affect smaller images. It only affects images that are larger than the parent container.

E.g. here is how the current page will look when viewed full screen on my screen (it's pretty big) with the code addition I have proposed... the image is unaffected.

http://i62.tinypic.com/23kxhyt.png

The test link above should give you a pretty good idea of what happens.

Elefantino
04-28-2014, 09:24 PM
Good idea.

thirdgenbird
04-28-2014, 10:00 PM
It would be a welcome change for those of us who only access via a mobile device.

One forum I was on auto resized to a very standard size but you could click on the picture and open it in a new window to see it full size.

Vientomas
04-28-2014, 10:23 PM
Please make it so.