STW API Class (v1.0 PHP5)

2 posts / 0 new
Last post
Anonymous

I worked on a site where we used the STW thumbnailing service and ported over the procedural code to a PHP5 class. Warning - this site was built around Invision Power Board software, so there are some IPB specific things in this class still. I haven't had a chance to go through it and abstract it further yet to make it more generic, but will try to when I get a chance (or anyone here is free to do so if they wish).

$ipsclass is an IPB object with all sorts of methods and properties. Most likely to further abstract this you'd remove that var definition, and change the constructor to accept an array of parameters, which you'd store as properties in the class. Things like max width, max height, location to cache thumbnails, etc.

Then the code would need to be updated to use the new vars instead of the calls to ipsclass vars.

Otherwise the class works pretty well right now. You can see it in use here under Recent Web Links.

Anyone is free to do what they wish with this class. Most of the code is just a port of the procedural example code, with a few minor changes here and there.

And lastly, this should get updated to support the new custom sizes feature. Might try that myself at some point.

https://shrinktheweb.com/uploads/libs.webimg.zip

puravida's picture
puravida
Jedi Warrior
Offline
Joined: 09/01/2007
Visit puravida's Website

Thanks, Brandon!

I'm sure this will be of use to many webmasters and it appears to be very well-written. As you said, it is specific to IPB, but that may also be something someone needs.

I have uploaded the code to our server (to avoid it becoming unavailable) and updated the link.

Best regards,

Brandon

ShrinkTheWeb® (About STW) is another innovation by Neosys Consulting
Contact Us | PagePix Benefits | Learn More | STW Forums | Our Partners | Privacy Policy | Terms of Use

Announcing Javvy, the best crypto exchange and wallet solution (coming soon!)

©2018 ShrinkTheWeb. All rights reserved. ShrinkTheWeb is a registered trademark of ShrinkTheWeb.