How to create and maintain your own cache table in Drupal

Published on Tue, 2009-08-11 - 09:41

There's a lot of good documentation for how to use the caching system already set up, in particular a very nice write up by Jeff Eaton that, even though it is written for Drupal 5, I find myself looking at rather often.

If you want to set up your own caching table, however, documentation is kinda scarce – I haven't been able to find anything that covered it, but that may be due to my lack of Google skills.



Drupal debugging tip – use the logging console

Published on Wed, 2009-08-05 - 22:55

I recently ran across a feature of Drupal's devel.module that might not be all that well known, namely that it has a facility for debug logging as well as the dpm() I've advocated to my fellow developers for a long time.

That is the dd()-command which instead of logging to screen simply outputs a print_r() to a file called drupal-debug.txt in your temporary files folder (where that is depends on your site configuration, but /tmp might be a…


Introducing the Stack Overflow module for Drupal

Published on Sat, 2009-06-20 - 12:21

As an avid user of Stack Overflow (and Server Fault, to some degree), I am well pleased to announce the stackoverflow.module for Drupal.

Why do we need a module for that?

Well, the Stack Overflow team recently introduced a new feature called “flair”. This is basically a badge you can put on your blog to show your level of awesomeness on Stack Overflow (or its related site, Server Fault).

My beef with that (and the reason…


Things that should be objects in Drupal #1: Content types

Published on Mon, 2009-06-15 - 11:23

Currently, defining the simplest content type in Drupal requires ~54 lines of 100% standard boilerplate code.

The reason Object Orientation would be good here is the simple concept of inheritance.

Very simply, my 54 lines of code could be replaced by something like:

class CampaignContentType extends NodeContentType {
  // Custom functionality here.

I think I'll go see if I can help Crell with his objective somehow :)


The new spam

Published on Tue, 2009-03-31 - 14:11

I just came across a new kind of spam, very cleverly made:

Screenshot of the new kind of spam I got

It's a clever ploy, posting praise with hidden images. Only it was a bit off in my case, but if I hadn't checked the source, I'd never have known that I was in fact in the advertising business.

This particular post actually slipped through Mollom, so beware, my Mollom using friends – I've submitted this one to Mollom as spam, but beware what might have gotten through the…


Installing FreeBSD 7.1 via eLOM on a Sun Fire X2100

Published on Fri, 2009-02-20 - 20:42

I've just finished my migration of my two servers to FreeBSD 7.1, and I thought I'd take the time to write a short walkthrough for one of the more difficult steps in the process, so others won't have as much trouble figuring it out as I did.

My web server is a rented Sun Fire X2100 from EasySpeedy. I don't have physical access, so if you want to install an operating system not supported by their automatic installation procedure,…

Lightning fast...

Published on Mon, 2009-02-16 - 21:47

I remember my first Internet connection, all 33.6 Kbps of it. The warbling sound, the seemingly endless wait for a connection. And even when you would finally managed to connect, there were still the several seconds of load you had to endure for most sites. The past millennium, it feels like ages ago.

And in many ways, it is. A lot of things have changed since then, but one particular thing that hasn't is the branding of Internet connections as…

Typogrify under new maintainership...

Published on Wed, 2009-01-14 - 00:06

So, I've finally taken the step up (in responsibility, that is) to become a module maintainer. I've been wanting to contribute more back to Drupal for a long while, so here's my chance...

Actually, it started with my upgrade process for this very blog. I've been using Typogrify on Drupal 5 practically ever since it came out, so I had to find an upgrade for Drupal 6, and after messing a bit around in the issue queue, I saw that…


Snippet: node type specific CSS files

Published on Fri, 2009-01-02 - 21:45

I just wrote a fun little bit of code for answering a question on our Danish Drupal community site.

The user in question wanted to add different CSS-files, depending on the type of the node used as the main page content, and I just wanted to share a little bit of code demonstrating how much can be a achieved very easily with Drupal's very flexible theming system.

So with no further ado, here it is:

  * Override or insert…