Alternating Row Colours

30th October 2008

Tags : Javascript, DOM, Code Examples

I like to use alternating row columns in tables. If the tables in question are static HTML then updating the row colours, (when adding/removing/shifting rows), can become a real chore.

Using some of the wonderful W3C DOM Methods within Javascript I came up with a simple function to do all the work for me.

Continue reading "Alternating Row Colours"

Array Looping in PHP

2nd September 2008

Tags : PHP, Code Examples, Basics

I remember back when I as learning PHP I had to write a directory "spider" function to list the contents of a directory. (Including sub-directories).

The approach I took involved reading the initial contents of the base directory into an array. The plan was then to loop through the array adding any sub-directories, (and their files), recursively.

Continue reading "Array Looping in PHP"

Picasa

14th August 2008

Tags : PHP, Code Examples, Open Source, Personal Projects, Picasa, API Integrations

A while back, I decided to use the Picasa system as a way of managing my photographs on my home PC and publishing the photos to the web.

I was planning on using the API for the system as provided by google, but I am limited to using PHP4 by my web host. (The PHP API classes rely on PHP5). So, I decided to create a PHP4 class for reading my Picasa web albums, ready to be dropped onto my website.

The class is basically a custom XML paser - quite a fun little project for a boring weekend!

Continue reading "Picasa"