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” [...]

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 [...]

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 [...]

Variable Variables and Template Lite
There is one programing concept that always hurts my head, and that is the variable variables or dynamic variables. What dynamic let you do is access data from the value of the a variable you are viewing. (See I told you it would hurt your head)
$b =20; // set the [...]

Template Lite Modifiers
One of the greatest tools I have in my library set is Template Lite . Template lite is a light-weight version of another template engine known as Smarty. Once you start using template lite you will be pleasantly surprised by how powerful yet modular it is.
My whole point of this blog is [...]