Posts Categorized: drupal

Static Drupal Sites for High Traffic

We recently created the Stand Up To Cancer website for Channel 4. I’m going to talk about the technical challenges involved in creating a site to support a high profile, one-off broadcast like this. Unlike a TV series where problems can be ironed out as the weeks pass, there was only one chance to get… Read more »

Posted

Useful New Bits & Pieces in Drupal 7

Everyone knows about the big changes in Drupal 7 but the details matter too, especially when they’re the kind of details that make life simpler and save time every day. Here’s some nice ones in Drupal 7. db_query No need to mess about with fetching rows any more, db_query() returns a Traversable object which can… Read more »

Posted

Drupal – number of registrations by month

Useful query – shows how many users registered on a Drupal site each month: select count(uid), month(from_unixtime(created)) as bmonth, year(from_unixtime(created)) as byear from users group by bmonth, byear order by byear, bmonth; SELECT count(uid), MONTH(FROM_UNIXTIME(created)) as bmonth, YEAR(FROM_UNIXTIME(created)) as byear FROM users GROUP BY bmonth, byear ORDER BY byear, bmonth;

Posted

Specifying the admin theme for pages in Drupal

Sometimes you want to tell Drupal to use the admin theme on pages other than the ones it decides should be under the admin theme. All you need to do is check the URL in an implementation of hook_init() e.g. function modulename_init(){ if(arg(0) == “whateverpage”){ global $custom_theme; $custom_theme = variable_get(‘admin_theme’, ’0′); } } This is… Read more »

Posted