Budgets are moral documents.
 
April 20th, 2008

Apache, PHP Upgrades

PHP 4 is approaching EOL, and Birdhouse Hosting, like many hosts, has been in “pause” mode on the prospect of a PHP 5 upgrade for a while, cautious of the possibility of breaking customer scripts. We’ve also been running on Apache 1.3.x since forever. But after much research, finally decided it was safe to just go for it. Spent the afternoon and early evening compiling Apache 2.2.8 and PHP 5.2.5, all required modules, tweaking handlers, and taking care of a few post-upgrade burps. Everything seems to be running smoothly, with not a single customer complaint (let us know if you find anything not working!)

Stay tuned for a revamped hosting site and a new pricing structure in the coming months.

November 22nd, 2007

Future Post

One of WordPress’ little-used features is its ability to set a “drip date” – to set a post’s timestamp in the future so that it doesn’t go live on the site until that time comes around. Recently I was working on a site for a client who needed an Events section. For various reasons, I didn’t want to use any of the existing events plugins for WP – I just wanted to override the behavior for future-dated posts so that they’d go live on the site immediately, without waiting.

For the past year or so, I’ve virtually never found a case where anything I wanted to do with WP hadn’t already been solved by an existing plugin or tweak to template logic. But amazingly, I couldn’t find anything to override the default future post behavior. Posted on WP-Hackers about the problem and got a few solutions volunteered within a few hours (there’s nothing like a vibrant open source community). By far the most elegant was this one from the magical Ryan Boren (same guy who planted the semi-secret WordPress t-shirt geocache):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
function setup_future_hook() {
 // Replace native future_post function with replacement
 remove_action('future_post', '_future_post_hook');
 add_action('future_post', 'publish_future_post_now');
}
 
function publish_future_post_now($id) {
 // Set new post's post_status to "publish" rather than "future."
 wp_publish_post($id);
}
 
add_action('init', 'setup_future_hook');
?>

Stick this in a php document in your plugins folder (remember not to include any whitespace after the closing php tag!), activate it, and create a post with a future timestamp. The post’s status field in wp_posts will be set to “publish” rather than “future” and it’ll go live on the site immediately.

You can also download this as a ready-to-go plugin.

Ryan’s too busy to host this trivial but super-useful plugin himself, but invited me to. I’ve submitted it to WP-Plugins and am awaiting a response – should be available there as well before long.

Music: Daniel Mille :: Les Minots
July 2nd, 2005

Avoiding CMS Data Lock-in

ORA blog: Avoiding CMS Data Lock-in, on how I decided to use Smarty Templates rather than a full content management system for the coming J-School site rebuild.

Music: 13th Floor Elevators :: Reverberation