Resize forum linked images on the fly using phpThumb
Posted: 31 July 2008 02: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: 236)
 Signature 

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

Profile
 
 
Posted: 16 December 2008 10:26 AM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  25420
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 11:46 AM   [ 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 02:47 PM
Total Registered Members: 115027 Total Logged-in Users: 124
Total Topics: 122462 Total Anonymous Users: 55
Total Replies: 647374 Total Guests: 476
Total Posts: 769836    
Members ( View Memberlist )
Active Members:    .jb3000a38dAdam DorseyadamwiggalladluraestheticaAndrew MacphersonartsengineAt the GatesAtenuaatiosisBennobobluedreamerbouchburkeb03cc000001Chris ClarkeCompass360CrucialDaniel HdavidandlilaDavide BonettadesignerhandbagsDoug EdstechroomdubsakdxagencyDylan Smith/ContextDesigneefalconewnexpocomfccinterfensterbabyForestParkFrank SpilkerfusioeeGeorgi VeznevgesturestudiogomacroGreg Akergrrrampsguru24GwarriorhearsayHosting ConceptsiamnickimpdesignsITWYJacob FentressJason FerrellJay FJörg Gudehusjducka1jeffkonczjmorinJohn MortonJohnDkalwebKevin EvansKomra MorikoKurt DeutscherlebisollifetreecreativelincolnpixelLinksharklog cabinLyle Andersonmagicmirror3Mario RodríguezMark BowenMark CroxtonMarker MakerMatthew EllisMH_JezMichael Byströmmjfr226neostructuralistNevin LynenevsieNico SmitNoah KuhnOliver Nielsenpab514PanchescoParisJCPascal KrietePipSprattPoP.LifeqbrandsregistryRenmanResponse1ripperojrunning with scissorsrussliptonRyan FaubionSean McDevittseansciarroneshinkaslapshotwsmartpillsmidoidspacewalksseremethsstokerstef25stephenslaterSteven GrantTactile Design GrouptimprintTomaz B.tsigertvruwinkvobtoaviX-Team