# If following month doesn't start on a Sunday, then skip days if ($timet["wday"] != 0) { skipdays(7 - $timet["wday"]); } ?> </tr> </table> </center> <?php # for each week... $timet["mday"] = 0; for ($thisdate = $startdate; $timet["mday"] != 1;) { #output the day print " <div class=hr></div>\n"; print " <h2><a name=\"" . date("Fj", $thisdate) . "\">" . date("l F j", $thisdate) . "</a></h2>\n"; fullentries(date("Y-m-d", $thisdate)); #increment the date $thisdate += 86400 + 3600; $timet = getdate($thisdate); $thisdate -= 3600 * $timet["hours"]; } ?> </div> <?php if (!isset($_REQUEST['p'])) { include INCLUDES . "/footer.html"; } else { print "</body>"; print "</html>"; }
# 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"; } else { print " <hr>\n"; } print " <h2><a name=\"" . date("Fj", $thisdate) . "\">" . date("l F j", $thisdate) . "</a></h2>\n"; $ymd = date("Y-m-d", $thisdate); print " <div id='div{$ymd}'>\n"; if ($thisdate == $today || $thisdate == $tomorrow || $_REQUEST["p"] || $_COOKIE['alldays'] == "Y") { fullentries(date("Y-m-d", $thisdate), TRUE); } else { print "<span class=\"loadday\" onClick=\"loadday('{$ymd}', true);\">Click here to load this day's events</span>\n"; } print "</div>\n"; } ?> <script language="JavaScript" type="text/JavaScript"> <!-- /* Highlight today in the calendar table */ var now = new Date(); var day = now.getDate(); var year = now.getYear(); if (year < 1970) year += 1900;
echo $previous; ?> "> << A fortnight</a> <a role="button" class="btn btn-default" href="<?php echo $future; ?> ">Two weeks >></a> </div> <div class="event-list"> <?php foreach ($dates as $d) { //defined above print " <div class=hr></div>\n"; print " <h2><a name=\"" . date("Fj", $d) . "\"></a>" . date('l F\\&\\nb\\sp;j', $d) . "</h2>\n"; fullentries(date("Y-m-d", $d)); } ?> </div> <div class="container pagination-month"> <a role="button" class="btn btn-default" href="<?php echo $previous; ?> "> << drawroF</a> <a role="button" class="btn btn-default" href="<?php echo $future; ?> ">Forward >></a> </div>
# The viewppXXXX.php page doesn't always load all days' events, for the sake # of saving bandwidth. When it needs to load a day, it uses this page to # fetch the data. THIS IS NOT A COMPLETE PAGE! It only contains the fragment # of HTML code needed to fill in one day's long descriptions. # # sqldate= Identifies the date of the event (for multi-day events) # exclude= TRUE to exclude $startdate = "2008-06-12"; $enddate = "2008-06-28"; $sqldate = $_REQUEST["sqldate"]; $exclude = !!$_REQUEST["exclude"]; include "include/common.php"; include "include/repeat.php"; include "include/view.php"; # Connect to MySQL $conn = mysql_connect(DBHOST, DBUSER, DBPASSWORD) or die(mysql_error()); mysql_select_db(DBDATABASE, $conn); # This is used for choosing which side images should go on. The # preferred side is always the right side since it doesn't interfere # with the heading indentations that way. But to avoid a "staircase" # effect, if two consecutive events have images then the second one # is left-aligned, and smaller. This variable indicates how much # overlap there is; if >0 then the image must go on the left. $imageover = 0; # Generate the entries fullentries($sqldate, $exclude); #ex:se sw=4: ?> <span></span>