Calendar

From Organic Design wiki
Revision as of 02:28, 7 March 2006 by Nad (talk | contribs) (Starting a calender to see how it goes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<?

function month( $m, $y ) { $c = ' align=center'; if ( !$day = date( 'w', $ts = mktime( 0, 0, 0, $m, 1, $y) ) ) $day = 7; $month = date( 'F', $ts );

$article = "

'.str_repeat( '"; $day = $d < 10 ? "0$d" : $d; $article .= "<td$c>$d"; } $article .= "\n
$month"; $article .= "\n<td$c>M<td$c>T<td$c>W<td$c>T<td$c>F<td$c>S<td$c>S\n"; if ( $d > 1 ) $article .= '
', $d-1 );

for ( $i = $d; $i < 32; $i++ ) if ( checkdate( $m, $i, $y ) ) {

if ( $i%7 == 1 ) $article .= "\n

";

return $article; }

$article = "

"; for ( $cols = 0; $cols < 3; $cols++ ) $article .= "\n
\n";

$m = 1; $y = date( 'Y' ); for ( $rows = 0; $rows < 3; $rows++ ) {

$article .= "\n
".month( $m++, $y );
      }
$article .= '

';

?>