Monthly Archives: June 2009

A noob’s guide to PHP Doctrine

This week I am a newbie to PHP Doctrine. So I thought I’d share some of the experiences I’ve had with it, not so much in a coding sense but in a “this is the cool stuff you can do with it” sense. Doctrine is an ‘object relational mapper’ or ORM for short, letting you [...]

Object Oriented Hook Management in PHP5

One of the nice features of WordPress is the plugin system, where ‘hooks’ allow custom functionality to be added without monkeying around with the core functionality. I haven’t played around with this myself yet, but from what I could gather from the documentation, it does this using functions which are all defined in the global [...]

JQuery AJAX using XML in Internet Explorer

I spent a while this morning trying to figure out why an JQuery AJAX call wasn’t working in Internet Explorer 8. The call was being made to a PHP script which was outputting XML. I had checked the XML was valid and (no surprises) it was all working fine in Firefox. Eventually I found this [...]

Loading XML with JQuery – an XCAL feed

XCAL is an XML implementation of the iCal format, and as such it can be easily read with JQuery. So, if you’re implementing some kind of calendaring system online, one way to accomplish it could be to read the events from your database, output them in XCAL format, and display them online using our old [...]

Mosso Cloud Files API with Windows

I spent a while tearing my hair out today trying to connect to the Mosso Cloud Files API with PHP. It seemed to be authenticating OK, but I couldn’t create a container. The error I got was “Failed to obtain http response”. It appears as though this has to do with CURL and SSL on [...]

Loading XML with JQuery

Thankfully JQuery makes it really easy to load a variety of data formats with AJAX: Text HTML JSON (JavaScript Object Notation) XML Within applications I generally use JSON, as it is less verbose and easier to process than XML. Check out the native PHP5 function or the PEAR JSON package for a way to easily [...]

JQuery Search Suggester Plugin

While writing a simple knowledgebase application for my web company I wanted to create the facility to automatically suggest articles as the user typed in a question. So I came up with the following ‘suggester’ plugin. To get it working, you need to: Attach it to an input field Pass in the backend URL to [...]

Simplifying HTML Form CSS with JQuery

Thanks to CSS, it’s possible to make nicely styled web forms without a table in site. Often we wish to add CSS styling to our input fields – but there’s a snag which is any checkbox or radio field ends up with the same styling. We end up with ugly borders and wierd gaps everywhere [...]

A JPEG to PNG Processor in PHP

So for our new CMS project I needed a way to turn a logo as a JPEG on a white background, into a transparent PNG. This didn’t turn out to be particularly straightforward, as due the JPEG compression, the white part of the image is noisy. So it was quite tricky to cut out the [...]

5 Awesome JQuery Plugins

A bit like the film “High Fidelity”, I thought I’d do a top 5 of awesome JQuery plugins! So here goes: JQuery UI – all sorts of goodies here – make items on pages draggable, droppable, sortable and more. There’s also handy widgets such as a great date picker, accordion lists, tabs and more – [...]