<th class="weeks">Wednesday</th> <th class="weeks">Thursday</th> <th class="weeks">Friday</th> <th class="weeks">Saturday</th> </tr> <?php # For each week... $thisdate = $startdate; for ($week = 1; $week <= $numweeks; $week++) { # start a row print " <tr valign=top>\n"; # generate all 7 days of the row for ($dayofweek = 0; $dayofweek < 7; $dayofweek++, $thisdate += 86400) { print " <td id=\"cal" . date("j", $thisdate) . "\">"; print " <a href=\"#" . date("Fj", $thisdate) . "\" title=\"" . date("M j, Y", $thisdate) . "\" style=\"font-size: larger; text-decoration: none;\">" . date("j", $thisdate) . "</a>\n"; tinyentries(date("Y-m-d", $thisdate)); print " </td>\n"; } # end the row print " </tr>\n"; } ?> </table> </center> <?php # for each week... $thisdate = $startdate; for ($week = 1; $week <= $numweeks; $week++) { # for each day within the week... for ($dayofweek = 0; $dayofweek < 7; $dayofweek++, $thisdate += 86400) {
<tr> <?php # If month doesn't start on Sunday, then skip earlier days $weekday = getdate($startdate); $weekday = $weekday["wday"]; if ($weekday != 0) { skipdays($weekday); } # For each day... $timet["mday"] = 0; for ($thisdate = $startdate; $timet["mday"] != 1;) { $thisyyyymmdd = date("Y-m-d", $thisdate); $class = date("Y-m-d") == $thisyyyymmdd ? "today" : "weeks"; print " <td class=\"{$class}\" id=\"cal" . date("j", $thisdate) . "\">\n"; print " <a href=\"#" . date("Fj", $thisdate) . "\" title=\"" . date("M j, Y", $thisdate) . "\" style=\"font-size: larger; text-decoration: none;\">" . date("j", $thisdate) . "</a>\n"; tinyentries($thisyyyymmdd); print " </td>\n"; # increment the date $thisdate += 86400 + 3600; $timet = getdate($thisdate); $thisdate -= 3600 * $timet["hours"]; # If next day is a Sunday and isn't the start of the following # month, then end that row and start another. if ($timet["wday"] == 0 && $timet["mday"] != 1) { print " </tr><tr>\n"; } } # If following month doesn't start on a Sunday, then skip days if ($timet["wday"] != 0) { skipdays(7 - $timet["wday"]); }
case "23": #print "<a href=\"http://en.wikipedia.org/wiki/Joss_Whedon\" title=\"Joss Wheden's Birthday\"><img align=right border=0 src=\"".IMAGES."/birthday.gif\" alt=\"Joss Wheden's birthday\"></a>\n"; break; case "24": print "<a href=\"http://en.wikipedia.org/wiki/Kenneth_Arnold_UFO_sighting\" title=\"First "UFO" sighting, 1947\"><img align=right border=0 src=\"" . IMAGES . "/ufo.gif\" alt=\"First 'UFO' sighting, 1947\"></a>\n"; break; case "26": print "<a href=\"http://americanhistory.si.edu/onthemove/themes/story_69_2.html\" title=\"First US bicycle patent, 1819\"><img align=right border=0 src=\"" . IMAGES . "/bike.gif\" alt=\"First US bicycle patent, 1819\"></a>\n"; break; case "28": #print "<a href=\"http://www.paulbunyantrail.com/talltale.html\" title=\"Paul Bunyan Day\"><img align=right border=0 src=\"".IMAGES."/axe.gif\" alt=\"Paul Bunyan Day\"></a>\n"; break; } $sqldate = date("Y-m-d", $thisdate); print " <a href=\"#" . date("Fj", $thisdate) . "\" title=\"" . date("M j, Y", $thisdate) . "\" style=\"font-size: larger; text-decoration: none;\" onclick=\"loadday('{$sqldate}', true, 0); return false;\">" . date("j", $thisdate) . "</a>\n"; tinyentries($sqldate, TRUE, $_COOKIE["alldays"] == "Y" ? FALSE : TRUE); print " </td>\n"; } ?> </tr> </table> <?php # for each day... $today = strtotime(date("Y-m-d")); $tomorrow = $today + 86400; $enddate = strtotime(PPEND); for ($thisdate = strtotime(PPSTART); $thisdate <= $enddate; $thisdate += 86400) { #output the day if ($_REQUEST["p"] == "") { print " <div class=hr></div>\n";