Derek Jones
President/CTO, EllisLab, Inc.

I Wanted My Site to be a Lumberjack!

You’ve seen Paul and I encourage the creation of and use of Extensions.  Encourage, perhaps, is not a strong enough word.  From the top of a mountain, wearing lederhosen, and with the booming, echoing voice we shout, not “Ricola!” but “Extensions!”  Certainly you noticed that ExpressionEngine Version 1.5.2 and version 1.3.2 of the Discussion Forum module added a number of new extension hooks.  Many of these were in direct correlation to developers’ requests, but here’s the secret: sometimes Extension hooks are added because we want them.  So what do the pMachine Dev Team use Extensions for?

Take our upcoming Job Board, for instance.  Many have been asking that we supply a place where people can essentially place ads looking for developers or designers for their projects.  We decided that we will, and we’re using an extension to do it so it can have a nice entry form and provide consistent display of people’s project information.  What’s it do behind the scenes?  A few simple things.  Replace some button text, modify the entry form, run some database checks for listing credits, and auto-pruning of threads after so many days so we do not have to manually handle that task.  What it boils down to in the simplest form is that we intercept the form data, and prep it into a nicely formatted entry.  The work is all still done by the Forum Module, which keeps the code lean, and essentially maintenance free across updates, but the appearance is that there is some significant modification going on.  You’ll see this within the next couple of days, and it might give you some ideas for different ways to use the forum hooks.

But the new forum extension hooks are being utilized for some other modifications right now that are not visible to regular members.  Our Technical Support Staff has all manner of additional information at their disposal thanks to an extension, both visual and informational. It helps them identify support threads that have not received assistance from a team member, as well as what team members are currently working on an issue, among other things.  These new extension hooks allow us to program behavior that is very specific to our site’s needs without krufting up the application with code that would be useless to 99% of sites powered by ExpressionEngine.  So you can see why we encourage taking advantage of them.

It wouldn’t be fair if I finished this parade of “look what we can do!” without giving you something to use.  We’ll call it “Advanced CAPTCHA”, which Paul coded quickly a few months ago just to demonstrate how a site was not locked into ExpressionEngine’s style of CAPTCHA images if they didn’t want to be.  I had been using it on my personal site ever since, and I dusted it off this week and added some additional character transformation to add random rotation to each letter, as well as the ability to rotate between TrueType fonts within the word.  Just load your /system/fonts/ folder up with TrueType font files, and each letter will be formed randomly from one of those fonts.

image

So sing along with me:

I never wanted to hack in the first place..
I wanted to use…an Extension!

I utilized a hook, and I’m okay!
I got what I need, in a perfect way!

I modified a string
sent out a ping
and changed functionality!

I always use Extensions,
and my clients smile at me!

Ohh….he utilized a hook and he’s okay,
he got what he needed, in a perfect way!

::ducks rotten vegetables and jumps out the window::