Hello all,
This is my first ever attempt at writing an extension, so I hope I am posting this in the right place. In a forum on a site I am working on, people like to use the tag to place images in their posts. A lot of times the images are very large, and break the forum layout somewhat, or at the very least, make the forum less than attractive.
After a bit of searching I could not find a simple plugin or extension that would alter how the core tag worked, and I did not want to alter the core code, so I took to learning how to write an EE extension.
Simply put, this extension uses phpthumb to resize the images into a cache folder on the fly. The end user will be none the wiser, as the extension simply prefixes the link to the image in the [img] tag with the phpthumb script.
I would really love to get some feedback on this little extension, and hopefully someone finds it useful.
This could prove handy. I did have it throw an error on me in php- might just drop __construct() and tweak a la:
function ooc_phpthumb_img($settings='')
{
$this->settings = $settings;
}
That got it pulling up fine for me. phpThumb itself takes a bit of tweaking and I’ll likely play with it more. Might be nice to add support for html coded images as well. But very handy idea for what I was looking for.
Hi Robin,
Thanks! It was a bit of hack for our oceanrodeo.com site we did awhile back. When time avails (might be awhile), I will take another look to clean it up a bit.
phpThumb, yes, it requires some configuring and reading through the config file is recommended. It is probably a good idea if I put a little how-to together for that side of it too.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.