Adapting code back to Drupal 6