Version: 1.00, by Locutus2999
Developer Last Online: Jan 2011
Version: 2.3.x
Rating:
Released: 05-26-2003
Last Update: Never
Installs: 3
Is in Beta Stage
No support by the author.
I hate it when users link to images that are really large and cause the layout of the site to become all distorted. It's also annoying to see the image placeholder and the red "X" whenever the site hosting an image is unavailable.
This check will check the width of a linked image and if it's wider than the size you would like to allow, it will add a width attribute to the <img> tag so it will be resized. If the image is not available on the linked site, then it will display a message saying the linked image is currenty unavailable.
Using getimagesize WILL increase server load as the image needs to be downloaded, then MySQL needs to check the image size, and resize it on the fly if it's too big, and then display it... just so you know.
I was actually thinking about making a hack like this with that exact method, what you should do is make postings.php and edit.php check for images, <img> and the bb tag form, 1st check if the image using any dynamic tags if it does then leave it be, then with the images that are not you make both scripts change the tags so something like "/postimage.php?postid=1234&imageid=2" then download them and resize them with gd or otherwise, you can look at my hack https://vborg.vbsupport.ru/showthread.php?t=59410 as an example how to, then you store both the original and the resized copy over to a new table that looks somewhat like the ones used for attachments, and reason being you'd want to store the original is to allow the admins if they want to disable this hack to have regular sized images put back in their place and also incase the image becomes a dead link in the future your board will still keep a copy of it, but also what you can do is just store the url of the original if you dont want to do that or both if you really want to give more options to admins. Oh and by the way on the posting data make sure that you somehow marker the dynamic images so later on when your doing the on the fly check for these your script wont also check the ones you created for the resized copies. Now as for editing, when a post is submitted you delete any and all entries that previously was there using something like "DELETE FROM imagestable WHERE postid='$post[id]'" That was on the posting side of the processing now for the showthread.php end, now Just check for the images with your special markers and force them with i dont know javascript or something I actually dont have the slightest clue on how to do checking and resizing on the fly that wont kill the performance aside from actually attaching the image a " NAME='postid1234imageid5' " and having an OnLoad="" javascript right in the image to resize it accourdingly. Well thats my idea on how to go about it, its not perfect but its a better method than going about it on the fly.
Thanks a lot CVNMagic , but i'm not an expert coder .. I look for an hack that resize on-the-fly linked images not images as attachmate , anyone know that a hack working already exist ??