Resize forum linked images on the fly using phpThumb
Posted: 31 July 2008 03:35 PM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  180
Joined  05-04-2007

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.

File Attachments
ooc_phpThumb_img.zip  (File Size: 6KB - Downloads: 249)
 Signature 

Out of ControlĀ® - Keeping you in control
Find Mac Stuff - Your Mac product homepage finder

Profile
 
 
Posted: 16 December 2008 11:26 AM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  25612
Joined  05-20-2002

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.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 16 December 2008 12:46 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  180
Joined  05-04-2007

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.

 Signature 

Out of ControlĀ® - Keeping you in control
Find Mac Stuff - Your Mac product homepage finder

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120172 Total Logged-in Users: 75
Total Topics: 126303 Total Anonymous Users: 33
Total Replies: 664229 Total Guests: 343
Total Posts: 790532    
Members ( View Memberlist )