diff options
author | Dries Buytaert <dries@buytaert.net> | 2000-10-19 13:31:23 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2000-10-19 13:31:23 +0000 |
commit | 11ee95dadc408e16e9832af9fd0b41495e78b0a6 (patch) | |
tree | a8f5ca3387e360b37d0eafc4edfdc5fdc52d3b87 /includes/calendar.class.php | |
parent | 43af5a7389265891770e4a283e4748678754797f (diff) | |
download | brdo-11ee95dadc408e16e9832af9fd0b41495e78b0a6.tar.gz brdo-11ee95dadc408e16e9832af9fd0b41495e78b0a6.tar.bz2 |
A big, fat commit with a shitload of internal changes. Not that much
visual changes:
- removed redundant files user.class.php, calendar.class.php
and backend.class.php.
- converted *all* mysql queries to queries supported by the
database abstraction layer.
- expanded the watchdog to record more information on what
actually happened.
- bugfix: anonymous readers where not able to view comments.
- bugfix: anonymous readers could gain read-only access to
the submission queue.
- bugfix: invalid includes in backend.php
- bugfix: invalid use of '$user->block'
and last but not least:
- redid 50% of the user account system
Diffstat (limited to 'includes/calendar.class.php')
-rw-r--r-- | includes/calendar.class.php | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/includes/calendar.class.php b/includes/calendar.class.php deleted file mode 100644 index 561363c33..000000000 --- a/includes/calendar.class.php +++ /dev/null @@ -1,76 +0,0 @@ -<? - -class calendar { - var $date; - - function calendar($date) { - $this->date = $date; - } - - function display() { - global $PHP_SELF; - - ### Extract information from the given date: - $month = date("n", $this->date); - $year = date("Y", $this->date); - $day = date("d", $this->date); - - ### Extract first day of the month: - $first = date("w", mktime(0, 0, 0, $month, 1, $year)); - - ### Extract last day of the month: - $last = date("t", mktime(0, 0, 0, $month, 1, $year)); - - ### Calculate previous and next months dates: - $prev = mktime(0, 0, 0, $month - 1, $day, $year); - $next = mktime(0, 0, 0, $month + 1, $day, $year); - - ### Generate calendar header: - $output .= "\n<!-- calendar -->\n"; - $output .= "<TABLE WIDTH=\"100%\" BORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"1\">\n"; - $output .= " <TR><TD ALIGN=\"center\" COLSPAN=\"7\"><SMALL><A HREF=\"$PHP_SELF?date=$prev\"><</A> ". date("F Y", $this->date) ." <A HREF=\"$PHP_SELF?date=$next\">></A></SMALL></TD></TR>\n"; - $output .= " <TR><TD ALIGN=\"center\"><SMALL>S</SMALL></TD><TD ALIGN=\"center\"><SMALL>M</SMALL></TD><TD ALIGN=\"center\"><SMALL>T</SMALL></TD><TD ALIGN=\"center\"><SMALL>W</SMALL></TD><TD ALIGN=\"center\"><SMALL>T</SMALL></TD><TD ALIGN=\"center\"><SMALL>F</SMALL></TD><TD ALIGN=\"center\"><SMALL>S</SMALL></TD></TR>\n"; - - ### Initialize temporary variables: - $nday = 1; - $sday = $first; - - ### Loop through all the days of the month: - while ($nday <= $last) { - ### Set up blank days for first week of the month: - if ($first) { - $output .= " <TR><TD COLSPAN=\"$first\"> </TD>\n"; - $first = 0; - } - - ### Start every week on a new line: - if ($sday == 0) $output .= " <TR>\n"; - - ### Print one cell: - $date = mktime(24, 0, 0, $month, $nday, $year); - if ($nday == $day) $output .= " <TD ALIGN=\"center\"><SMALL><B>$nday</B></SMALL></TD>\n"; - else if ($date > time()) $output .= " <TD ALIGN=\"center\"><SMALL>$nday</SMALL></TD>\n"; - else $output .= " <TD ALIGN=\"center\"><SMALL><A HREF=\"$PHP_SELF?date=$date\" STYLE=\"text-decoration: none;\">$nday</A></SMALL></TD>\n"; - - ### Start every week on a new line: - if ($sday == 6) $output .= " </TR>\n"; - - ### Update temporary variables: - $sday++; - $sday = $sday % 7; - $nday++; - } - - ### Complete the calendar: - if ($sday) { - $end = 7 - $sday; - $output .= " <TD COLSPAN=\"$end\"> </TD>\n </TR>\n"; - } - $output .= "</TABLE>\n\n"; - - ### Return calendar: - return $output; - } -} - -?> |