If you find you need to sort an returned object this snippet will save your life.
/** * Sort array of objects by field.
*
* @param array $objects Array of objects to sort.
* @param string $on Name of field.
* @param string $order (ASC|DESC)
*/
function sort_on_field(&$objects, $on, $order = ‘ASC’) {
[...]

PHP Snippet of the day – Sort Object by field name

Drupal custom form with autocomplete drop down
I had been putting off doing an custom autocomplete programmatically in drupal for a long time. I finally sat down and decided to work it out for a project i was doing. It was surprisingly very easy. My project consisted of pulling an autocomplete text field from a taxonomy list.
The first step is to build [...]

Creating an Alpha Pager with Views 2 and Drupal 6
This is a reprint of an article I found here:
http://tedserbinski.com/tags/drupal/creating-alpha-pager-with-views-2-and-drupal-6
This is article that saved me tons of hours while I was chasing my tail trying to find an easy way to do this, reprinted so I can remember it later:
From reading all of the docs and quietly watching development commits, I knew Views 2 was [...]

Drupal node templates based on node id
Code Snippet to allow you to override and specify node templates based on node id.
Put the code in your template.php file
/**
* Override or insert variables into the node templates.
*
* @param $vars
* An array of variables to pass to the theme template.
* @param $hook
* The name of the template being rendered (“node” [...]

Display dhtml menu over the top of a flash movie
One of my bigest complaints about flash is that I had thought you couldn’t layer over the top of it. By default a flash object is placed as the topmost layer of your web page. No matter what type of z-index you would place it would still be on top.
Recently I was researching via google [...]

Drupal, a pleasant surprise
I’ve spent the last number of years developing my own CMS (content management system) as well as using many others. Several years ago I looked at Drupal for about 10 mins then moved on. I didn’t give it a respectful look, or the time it would take to give it a fair review. The only [...]

javascript change input box type to password
Well its been quite a while since I blogged last. I have loads of new stuff to write but will get to that later.
How to change input text field to a password type
My most recent challenge was a client did not want to use labels for his login boxes on his website. He wanted to [...]

sql file splitter to the rescue
My Adventures in sql dumping and database migration
My latest problem project presented itself as a phpbb conversion. The client was having some issues with the old versions of phpbb so we elected to move them to the new version. While this is a great idea on the surface I did not realize how big the [...]

Palm Centro, my new phone
WOOT!! I got a new phone! Only reason I did, was I broke my Treo 650 a second time. Same issue, I managed to short out the headphone jack. I don’t know why they bother to put them on, if they don’t give them more industrial strength. [...]

PHP day count and date comparison
Dealing with date based data can be a mind numbing experience. Calculation date differences, doing date comparisons can really stretch you to the limits at times. There is a variety of ways to deal with date based data but the first step usually is to convert it into a standard format that [...]