View Full Version : Large pictures in posts breaks non-liquid layout
When users post images from URLS that are bigger than our fixed layout, the pictures break out of the layout. Any creative ways to prevent this?
This page, on the vbulletin.org site, is an example of what I'd like to find a solution for...
https://vborg.vbsupport.ru/showthread.php?t=248534
There are mods for resizing images, they use attributes in the img tags to set a maximum width and height. I don't know of a specific one offhand but it shouldn't be too hard to find if you search.
So far I'm not much of a fan of mods since they don't generally seem very well supported or documented.
I'll try and figure out what, if any, tags or css are getting applied to images. Maybe the key is there somewhere.
Any ideas on doing fixing this without a mod?
Check out this mod: https://vborg.vbsupport.ru/showthread.php?t=214600&highlight=image
if you don't want to install the mod, open up the file and look at the code, it's just a 2-line plugin.
...and if you don't even want to do that, what it does is basically
str_replace('<img', '<img style="max-width: ' . $maxwidth . 'px "');
plus some other stuff that looks like it lets you click on the image to see it full size in a popup window.
I tried creating my own plugin and got a php error as soon as I activated it, so I disabled it. After several permutations, I ultimatley tried installing the Image Resizer plugin and also got a php error as soon as it was activated, so too deactivated that...
If you can help with exact syntax that I'd want to use for just creating a plugin that would be hugely helpful.
I'll give this another try in few days when more time frees up, at which point I'll also be able to post the code I'm attempting to use for the plugin as well as any error being generated.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.