|
Image resize on non hosted images
This modification is in the archives.
This is my first attempt on vB code changes, so I hope this works. I also believe this should be a vB ACP feature in the near future.
Credit: I was reading this thread and decided to make this hack. I used it as a place to start and make my version. What this does: What this will do is restrict images that a user posts that are not hosted on a user defined server. 1. All images not hosted on a defined server will be set to 100x100. 2. User can set the host domain to allow normal image sizes. Reason for this: I wanted this code to prevent a user from posting a huge image and cause the forum layout to get destroyed. I hated it when a image size of 1024x768 gets posted and my forums width is only 700px. To install: I don't know how to make a plugin, so it's all via editing the "class_bbcode.php" file in the /includes folder. Find: (Line 1828) Code:
return '<img src="' . $link . '" border="0" alt="" />'; Code:
{if (preg_match("/allowedDomain.com/i", $link))
{
return '<img src="' . $link . '" border="1" />';
} else {
return '<img src="' . $link . '" border="1" height="100" width="100" />';
}
Hope this is useful to all of you, I know it's something I was looking for, but never found. If it is on the site, sorry, I can't seem to find much with the search feature. If you like it, please click INSTALL if you use it. All comments are welcome, as this was my first attempt and would like to make more. Download No files for download. |
|||||||||