Back to vBulletin 3.5 Add-ons

Image resize on non hosted images
Mod Version: 1.00, by vtx1800

This modification is in the archives.
vB Version: 3.5.3 Rating: (1 vote - 3.00 average) Installs: 1
Released: 22 Jan 2006 Last Update: Never Downloads: 0
Not Supported Code Changes  

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="" />';
Replace with: (Note this must be enclosed with the {} to work.)
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" />';
			}
You must change the "allowedDomain" text to be the site you want to allow. So, if you want to allow http://www.putfile.com, do not include the 'http' or 'www'.

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.


vblts.ru supports vBulletin®, 2022-2025