The Kelly admin on 13 Feb 2003 12:20 am
Mad Skillz
Amazing but true! I’ve replaced the (terribly out of date) Buffy-O-Meter in the side-bar with a PHP countdown timer, cleverly titled the “Kelly-O-Meter,” for reasons which should be readily apparent.
I almost had to learn some PHP for that but instead I lifted code from someone else — in keeping with the true spirit of the internet.
I did have to make one modification to the script though. In addition to plugging in the *release date o’ the moment for Kelly’s CD, I had to fix the coding atrocity, which was a giant block of “if’s,” like this:
if ($month == 1) $month_name= "January";
if ($month == 2) $month_name= "February";
...
if ($month == 12) $month_name= "December";
For the love of Pete! What the hell is that all about!! Twelve lines of code to set the freaking month name. Twelve. Twelve. What the f*ck is wrong with these people? Ever heard of a little thing called an “array?”
$names = array ("Jan", "Feb", "Mar", ..., "Dec");
$month_name = $names[$month-1];
See, look, two lines.
Ironically I’ve taken out the bit that actually prints the month name, (but I may put that back in)… point is that I don’t have eleven extra lines of pure crap that get evaluated every time. If the computer could talk (well, mine can) it would say “Listen punk! I told you eight lines ago that $month_name is “April”, what the hell is wrong with you?”
* observant readers will note that the countdown goes until April 15th but Amazon says April 1st. Amazon is behind the times and hasn’t been updated with today’s release date. I think this is the 5th new release date for the CD. The movie, filming now, is still scheduled for April 25th.