We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Resize forum linked images on the fly using phpThumb

Development and Programming

OutofControl's avatar
OutofControl
164 posts
about 17 years ago
OutofControl's avatar OutofControl

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.

       
Robin Sowell's avatar
Robin Sowell
13,160 posts
16 years ago
Robin Sowell's avatar Robin Sowell

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.

       
OutofControl's avatar
OutofControl
164 posts
16 years ago
OutofControl's avatar OutofControl

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.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.