Digital Moss on a Digital Skull

Michael J. DeLuca

0 notes

Installing PHP/MySQL on OS X Lion

I found myself in need of a WordPress testing server on my local machine. Very incredibly useful when you need to run huge half-assedly slapped together ebookstore code in order to patch it up for production without enraging your current web hosts. Last time I had to do this (or last time I had the patience) was on my Powerbook G4, Funes, who is now dead though his memory will live forever. Things were a lot different then. This was cake by comparison.

Here are the instructions I used, with barely a bump, to get it all going on my Macbook Pro, Teknotitlan:

1. To install MySQL: http://www.djangoapp.com/blog/2011/07/24/installation-of-mysql-server-on-mac-os-x-lion/

2. To turn on PHP and useful libraries (XDebug and PEAR): http://akrabat.com/php/setting-up-php-mysql-on-os-x-10-7-lion/

3. PHPMyAdmin: http://www.coolestguyplanet.net/installing-phpmyadmin-on-mac-osx-10-7-lion/

0 notes

RT @Hal_Duncan: Beer beer beer beer! Stouty stouty lovely stout! Beer beer beer beer! Yummy scrummy stouty stout! I can’t hear. Shout it …

0 notes

WordPress: Perform an action when scheduled post goes live

I spent a long time looking for this and am incredibly relieved to have found it:

http://wordpress.org/support/topic/passing-post_id-to-wp_mail-please-help

I wanted to be able to perform an action (send an email to the site admin) when a certain type of post changed status from draft to published, or, when scheduled for a future date, reached that date and went live on the site. This is not an uncommon task—lots of Twitter crosspost plugins use it. But the internet was not being very forthcoming with the solution. Lots of articles suggest trying to repeatedly check the POST object for different combinations of $_POST[‘post_status’], $_POST[‘original_post_status’] and $_POST[‘prev_status’]. This method is unreliable. Don’t try it.

The much easier way to do it is to use a set of status change action hooks that were introduced as far back as WP 2.3, but have not been very well documented (as is sadly the case with too many obscure action hooks):

add_action('new_to_publish', 'email_notification', 10, 1);
add_action('draft_to_publish', 'email_notification', 10, 1);
add_action('pending_to_publish', 'email_notification', 10, 1);
add_action('future_to_publish', 'email_notification', 10, 1);

Where ‘email_notification’ is the name of the function to be called. Note that these actions pass a single parameter, the $post object.

Filed under wordpress action hooks

0 notes

hildebabble asked: Howdy! Did you just join up? Tumblr is kind of spastic and addictive.

Yeah. Spastic indeed! We’ll see if it’s addictive…. Before I fall in love, I clearly need to redesign my ugly ass theme. And that may take a while.

0 notes

I Got an iPod Touch

It’s been about two weeks. So far I have:

-dropped it out of my shirt pocket and been terrified I broke it

-learned to type ineptly with my thumbs

-been mocked by Notes’ absurd attempts to respell my ‘obscure’ vocabulary

-enjoyed a short story on its tiny screen

-geeked myself silly playing Warlords Classic

-got tired of Angry Birds

-been impressed with how easy it is to interconnect myself (Twitter, FB, PayPal, Google Voice, Dropbox, Dropbox, Dropbox, and I’m good)

-been shocked at how not easy it is to tweet a photo I just took

-been unsurprised at the poor photo quality

-gotten annoyed with the captive-audience-ness of the app store and been tempted to jailbreak

Yea, I have entered Modern Times.