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.
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.
So in addition to work, school and home life, I’ve also been spending some time in the Open Source community in the last few months. I’m quite happy to say that I haven’t had Windows on my personal computer since last September, and while there were a few bumps along the way, I’m very happy with my shiny Kubuntu 6.10 Linux operating system and all free software applications. I’ve been doing all of my school work using free software, and submitting all my assignments in Microsoft compatible document formats for months and haven’t had a problem with it from any instructors.
On the school side, I’m holding straight A’s so far, and have almost reached the half-way mark towards my associates degree. Unless I take an extended leave in the next year, I should be graduating with my first degree in June of 2008. It’s a good amount of work to keep up with, but I feel I’m learning quite a bit. It’s also changed my attitudes and behaviors a bit. It was during my second class that I wrote a paper on open source software, which piqued my interest so much that I decided to try it out myself. I also find myself reading local, national, and international news on a daily basis, and participating a lot more in government by writing letters and actually voting for the second time since high school.
I certainly didn’t expect this from school – I started this just to get the paper on the wall to open up career options. Turns out this education stuff is actually useful. Who would have thunk it?












