Web design, programming, graphics, and pretty much anything else I care about.

Install taxonomy, with terms and hierarchy, on module installation

Getting a module to install a vocabulary, and even import terms, is not terribly difficult; however, getting it to accept an existing hierarchy can be tricky.

(I was working with a taxonomy for academic departments and schools.)

Create an include file. I name them module name.taxonomy.def.inc. In the file create an array that will define the vocabulary, and one that will include the terms.

Configure CCK fields on module installation

You can have a module installation automatically add and configure CCK field. First, setup the CCK fields on a development site exactly as you want them. Then, export the fields from /admin/content/types/export.

You will end up with the code for a php array that looks something like ...

Update email send time always incremented by one cron run

I enabled the update feature that emails me whenever the site has an update available. I noticed that the time the email gets sent is always incremented by one cron run. For example, I have cron running hourly, so if there are updates needed it will email me at 8am, the next day at 9am, the next day at 10am, etc. But, based on the math, whatever interval cron runs at the email will likely always be one run later.

In hook_cron, the if statement requires the current time to be greater than interval (in my case, 24hrs). If it is exactly 24hrs, it will not pass.

Drupal update status email

I hate when I configure a site to notify me of available updates and all I get is this generic email.

There are updates available for your version of Drupal. To ensure the proper functioning of your site, you should update as soon as possible.

There are updates available for one or more of your modules or themes. To ensure the proper functioning of your site, you should update as soon as possible.

As and admin, I would like something more specific than this. It is like an error message that says "ERROR".

Drupal.org handbook content audit

lisarex has started a content audit for drupal.org. The plan is to start with handbook pages, like the Theming Guide. http://groups.drupal.org/node/139814 . There are some 1200 pages to audit. That's just the handbooks! I've been helping by assisting Lisa with the development server. Getting various views setup to organize what needs auditing, and also setting up flags. (and fixing the broken site) I've also already audited several sections. Please lend a hand, if you have time to spare! you can contact me directly, or lisarex.

DOPL

My friend Brian took over maintenance of the DOPL module. http://drupal.org/project/dopl We are experimenting with using it for the support.drupal.org project. It is great for linking directly to drupal.or nodes. See more here - http://drupal.org/node/1122198

Drupal docs admin

I'm now a drupal.org documentation admin. http://drupal.org/node/1114036 . What shall I destroy first! But, seriously, the drupal.org Documentation Team could use a lot of help. If you are interested, sign up. http://drupal.org/contribute/documentation

support.drupal.org

I'm helping spearhead the effort to create a support.drupal.org site. Something that will help remove support requests from the drupal.org forums and issue queues, and hopefully better serve those with support needs. Susan (HedgeMage), created a sandbox project to get it started. http://drupal.org/sandbox/HedgeMage/1088372 A groups.drupal.org group and an IRC channel were also created. http://groups.drupal.org/support-infrastructure If anyone is interested in helping, contact me. We already have a dev server setup on drupal.org, but are still in the research and planning phase.

Show block only for specific user or role

A quick and dirty way to control the visibility of a block is to add a php snippet. Set the visibility in the block administration to "Show if the following PHP code returns TRUE", and use something like this:

<?php
global $user;
if (
in_array('authenticated user', $user->roles)) {
  return
TRUE;
} else {
  return
FALSE;
}
?>

I know what you're thinking. There is a setting for making a block visible by role. Yes, but there is no setting for making a block NOT appear for a role. Take the same code and return FALSE for a specific role, or return TRUE for a specific user, etc.

Barcode PHP class

I've been working on an event management system for IAS and have learned more about barcodes and barcode scanners than I ever would have imagined. Anyway, I've come to learn that there are no good resources for generating barcodes with PHP.