
June 20th, 2009
Hacking together a wordpress plugin / widget has been pretty simple and a lot of fun. I hit a sticking point for a little bit with Jason’s plugin template as it was put together for the WP 2.7 style widget API. In WP 2.8 the widget API is very different to enable multi-instancing of widgets – which is a really cool feature I wanted to have for the BookMooch widget. But after searching around a little bit I found another widget template over at Justin Tadlock’s site. By taking the plugin control structure I’d already developed using Jason’s template and stitching it into Justin’s widget template, I was able to bring together a fully functioning multi-instance widget in an evening.
Now I need to stretch my php skills a bit more and add in some tight error handling and string manipulation of the BookMooch widget HTML stream to enable CSS styling of the results. This way my plugin doesn’t just encapsulate what John Buckman from BookMooch has done (which still has a value for novice WP users) but actually extends the functionality available to bloggers by building on the bones John built.
So thanks Jason, Justin, and John! It’s been a lot of fun extending what you’ve all put out in the community.
Posted in tech | Comments Off

June 15th, 2009
As I slowly get myself back into coding, I’m finding it much easier to make headway than when I first started some 20 odd years ago. Picking up a new programming language is now a matter of learning syntax, not learning how to think in a logical fashion to start with. However another difference is the number of excellent resources that are available. The most useful resources I’ve been using are the http://www.w3schools.com/ sites. The next best resource are all of the amazing templates and examples that people have released under the GPL.
Earlier this week I decided I would build a WordPress plugin to enable BookMooch users to configure the BookMooch widgets using a WordPress admin settings screen instead of having to copy and past code from the BookMooch site into a HTML widget. I took a look at the code base for several of my favorite templates, and started to get a little cross eyed. Then I ran across the plugin template on Pressography – and the excellent video tutorial that goes along with it. Confidence builds.
A few days later I set aside some time to deconstruct how the current BookMooch widget API works and plan out the options I would need for the plugin. Then tonight in about 2 hours of hacking from Jason’s template, I have a fully working admin page that saves and retrieves all the variables I’ll need for the widget. Next step, building the widget display code itself.
As I was closing down for the night, Jason’s note requesting a simple link to his site in exchange for use of the template caught my eye. And the ease in which I went from no code to a fully working admin screen really struck me – the magic of open source licensing put the operating system in my computer, WordPress on my servers, Firefox on my desktop, and now templates to help me code and give something back to the community as well. So thank you Jason – you have achieved the goal you stated in your post of saving someone else a rough time getting started with plugin programming. I owe you one – and I’ll pay one forward too.
Posted in tech | Comments Off