Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Automatic image resizing to keep forums uniform
Of then when I stroll around my regular forums, there is a thread that has images, not everytime when someone posts an image is it resized, so it breaks the width of the forum template, and everything is just well, hard to read because lines contonue, the buttons to jump to next page run to the far right side so the vertical scrollbar appears and so on, it's just a mess.
My suggestion is automatical resizing, I have few different ideas on how to make this, one is ofcourse the thumbnailer, if you post an image the image is automatically made as thumbnail and linked, but not always users post images, sometimes they link them from other sites, which makes this bit more tricky, without having the original image you can't resize it, so maybe an option to block linking to images, which would piss some users I'm sure.
But I'm ready to accept that there is nothing to be done about the linking to images, but posted images are easier. I'd like to see options to resize the image on the fly, when you post an image, you could define it's height and width and the script automatically resizes the image, or the thumbnailing where the posted image is stored somewhere and the thumbnails are linked to the image, which is typical option on many forum softwares.
Ideas?
0
This discussion has been closed.
Comments
There's a couple of PHPBB plugins that do this as well as the previously mentioned Mike Lothar themes.
They all do it different ways I think. Not being a coder I can't help.
Maybe checking out the source code on those would help though?
.CommentBody img { max-width: 200px; }
That probably wont work in all browsers, as IE ignores max-width, but you could do a one size fits all approach, making all images a specific size, though you seem to only want to resize large images (though this is all relative, to people with a 30 inch monitor this isn't an issue)
Then via the various text formatters, you would add an enclosing link to open the image full size, which you can say in the title tag.
Look in the index.php file for the image resizing js. the filebrowser one finds the width of the window. It is a little harder to do with vanilla, unless js can find the width of a div, or if it is manually fed the width of the post div.
If you get the js, the extension is EASY! see below.
<?php /* Extension Name: Automatic Image Resizing Extension Url: http://your-url-dot-com Description: Automaticically resizes images to keep forums uniform. Version: 0.1 Author: You Name Author Url: http://your-url-dom-com */ if(in_array($Context->SelfUrl, array("post.php"))){ $Head->AddScript("./js/ImageResize.js"); } ?>
I only incude the js on the post pages as these are the only ones we are concerned with.
i hope that provides a good starting point.