Duck’s Timestamp Inserter

October 22nd, 2008

When writing up the Countdown Timer in Flash article yesterday, I stumbled across a need for a fairly simple plugin - one that would output the current Unix Timestamp into a Post's content. While I could use a plugin such as 'Exec-PHP' to accomplish this, that seemed to fall into the 'breaking eggs with a sledgehammer' brand of overkill.

As such, I whipped up a quick Wordpress plugin (as I often do for these tiny problems), and decided to make this one available to the public. So without further ado, I give you...

Duck's Timestamp Inserter! Ok, it could use a more creative title. Using some pretty simple markup, it allows me to insert the current timestamp, or offsets thereof, into my post content.

<!--ducktime--> becomes 1231292294, while <!--ducktime+5000--> becomes 1231297294 and <!--ducktime-1200--> becomes 1231291094. If you refresh the page, you'll see these all change.

UPDATE: This Plugin is now listed on the WordPress Plugin Repository! You can download Duck's Timestamp Inserter from there - and of course, Ratings are appreciated. I've released it under GPL3. If you find it useful, please consider Donating.

 
 

Countdown Timer in Flash

October 21st, 2008

Recently at work, I was asked to add a Countdown Timer to a few of our pages giving the time remaining until a Sale kicked in. While I could have whipped this up pretty quickly in Javascript, I decided to use the opportunity to expand my Flash knowledge a little.

One of my key considerations was using the Server's time, rather than the time of the User's system clock. This meant passing two Timestamps from PHP to Flash, which luckily is very easy to do. I'll walk you through the entire design process here. I'll be using Flash CS3, and ActionScript 2.0.

Read the rest of this entry »

 

Musings on Coding, Gaming, and Life in General
Loading...