OK, so something is obviously wrong RIGHT with my date/time stamps on my blog. I’ve converted to the Zork calendar. Why? Because Zork rocks! On the following page is my the quickie Zork date mod. I know this is supposed to be done in the themes pannel… but have you looked at this theme in detail? It is put together with Voodoo and monkey parts. My code follows.
<?php
/*
This was updated for the new WordPress version & new template!
add to index
require_once( 'wp-content/themes/carrington-blog/functions/drPunchDate.php' );
Converting the date to Zork dates
edit "wp_includes/general-template.php"
near line: 1424
function the_time( $d = '' ) {
echo drDate( apply_filters('the_time', get_the_time( $d ), $d) );
}
Archive: near line 820
translators: 1: month name, 2: 4-digit year
//$text = sprintf(__('%1$s %2$d'), $wp_locale->get_month($arcresult->month), $arcresult->year);
$text = dr_Month ( $arcresult->month ) ." ". $arcresult->year;
plugin calendar near line 1943
$output .= '<li>'. drDate( date(get_option('date_format'),mktime($day_count*24,0,0,date("m"),date("d"),date("Y"))) ).'<ul>';
*/
function drDate( $the_date_arr )
{
// n w jS Y
echo "<!-- DATE ". $the_date_arr ." -->";
$_drdate = explode( " ", $the_date_arr );
// month
$drMonth = dr_Month( $_drdate[ 0 ] );
// day
$drDay = dr_Day( $_drdate[ 1 ] );
// date
$drDate = $_drdate[ 2 ];
// year
$drYear = $_drdate[ 3 ];
$myNewDate = $drDay ." the ". $drDate ." of ". $drMonth .", of the year ". $drYear;
return( $myNewDate );
}
function drDateJr( $the_date_arr )
{
$_drdate = explode( " ", $the_date_arr );
// month
$drMonth = dr_Month( $_drdate[ 0 ] );
// day
$drDay = dr_Day( $_drdate[ 1 ] );
// date
$drDate = $_drdate[ 2 ];
// year
$drYear = $_drdate[ 3 ];
$myNewDate = $drDate ." of ". $drMonth .", in ". $drYear;
return( $myNewDate );
}
// day --------------
function dr_Day( $ddd )
{
switch( $ddd )
{
case( '0' ):
$drDay = "Sand Day";
break;
case( '1' ):
$drDay = "Mud Day";
break;
case( '2' ):
$drDay = "Grues Day";
break;
case( '3' ):
$drDay = "Wands Day";
break;
case( '4' ):
$drDay = "Birthday";
break;
case( '5' ):
$drDay = "Frob Day";
break;
case( '6' ):
$drDay = "Star Day";
break;
}
return( $drDay );
}
// month --------------
function dr_MonthName ( $mmm, $boo = false )
{
switch( substr( strtolower( $mmm ), 0, 3 ) )
{
case( 'jan' ):
$drMonth = "Estuary";
break;
case( 'feb' ):
$drMonth = "Fidooshiary";
break;
case( 'mar' ):
$drMonth = "Arch";
break;
case( 'apr' ):
$drMonth = "Oracle";
break;
case( 'may' ):
$drMonth = "Mage";
break;
case( 'jun' ):
$drMonth = "Jam";
break;
case( 'jul' ):
$drMonth = "Jelly";
break;
case( 'aug' ):
$drMonth = "Augur";
break;
case( 'sep' ):
$drMonth = "Suspendur";
break;
case( 'oct' ):
$drMonth = "Ottobur";
break;
case( 'nov' ):
$drMonth = "Mumberbur";
break;
case( 'dec' ):
$drMonth = "Dismembur";
break;
}
if( $boo ) $drMonth = substr( $drMonth, 0, 3 );
return( $drMonth );
}
function dr_Month ( $mmm, $boo = false )
{
switch( $mmm )
{
case( '1' ):
$drMonth = "Estuary";
break;
case( '2' ):
$drMonth = "Fidooshiary";
break;
case( '3' ):
$drMonth = "Arch";
break;
case( '4' ):
$drMonth = "Oracle";
break;
case( '5' ):
$drMonth = "Mage";
break;
case( '6' ):
$drMonth = "Jam";
break;
case( '7' ):
$drMonth = "Jelly";
break;
case( '8' ):
$drMonth = "Augur";
break;
case( '9' ):
$drMonth = "Suspendur";
break;
case( '10' ):
$drMonth = "Ottobur";
break;
case( '11' ):
$drMonth = "Mumberbur";
break;
case( '12' ):
$drMonth = "Dismembur";
break;
}
if( $boo ) $drMonth = substr( $drMonth, 0, 3 );
return( $drMonth );
}
?>
I want to point out 2 things:
- This is close but NOT a wholy faithful conversion to the Zork Calendar [ read more here ] (Not the most accurate Zork Calendar I have found, just the best one I found tonight)
- Zork is awesome. You can play it here: http://thcnet.net/zork/
Fixes for new WordPress update!
Fixes were made to the “general-template.php” file.
/* translators: Calendar caption: 1: month name, 2: 4-digit year */
$calendar_caption = _x('%1$s %2$s', 'calendar caption');
$calendar_output = '<table id="wp-calendar" summary="' . esc_attr__('Calendar') . '">
<caption>' . sprintf($calendar_caption, dr_MonthName( $wp_locale->get_month($thismonth) ), date('Y', $unixmonth)) . '</caption>
<thead>
<tr>';
$myweek = array();
for ( $wdcount=0; $wdcount<=6; $wdcount++ ) {
$myweek[] = $wp_locale->get_weekday(($wdcount+$week_begins)%7);
}
foreach ( $myweek as $wd ) {
$day_name = (true == $initial) ? $wp_locale->get_weekday_initial($wd) : $wp_locale->get_weekday_abbrev($wd);
$wd = esc_attr($wd);
$calendar_output .= "\n\t\t<th scope=\"col\" title=\"$wd\">$day_name</th>";
}
$calendar_output .= '
</tr>
</thead>
<tfoot>
<tr>';
if ( $previous ) {
$calendar_output .= "\n\t\t".'<td colspan="3" id="prev"><a href="' . get_month_link($previous->year, $previous->month) . '" title="' . sprintf(__('Probe %1$s %2$s'), dr_MonthName( $wp_locale->get_month($previous->month) ), date('Y', mktime(0, 0 , 0, $previous->month, 1, $previous->year))) . '">« ' . dr_MonthName( $wp_locale->get_month_abbrev($wp_locale->get_month($previous->month)), true ) . '</a></td>';
} else {
$calendar_output .= "\n\t\t".'<td colspan="3" id="prev" class="pad"> </td>';
}
$calendar_output .= "\n\t\t".'<td class="pad"> </td>';
if ( $next ) {
$calendar_output .= "\n\t\t".'<td colspan="3" id="next"><a href="' . get_month_link($next->year, $next->month) . '" title="' . esc_attr( sprintf(__('Probe %1$s %2$s'), dr_MonthName( $wp_locale->get_month($next->month) ), date('Y', mktime(0, 0 , 0, $next->month, 1, $next->year))) ) . '">' . dr_MonthName( $wp_locale->get_month_abbrev($wp_locale->get_month($next->month)), true) . ' »</a></td>';
} else {
$calendar_output .= "\n\t\t".'<td colspan="3" id="next" class="pad"> </td>';
}
$calendar_output .= '
</tr>
</tfoot>
<tbody>
<tr>';

One Comment
PHP worthy of being sold by FrobozzCo International. Sweet work.
Post a Comment