diff options
author | Chad Little <clittle@users.sourceforge.net> | 2002-10-27 02:34:32 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2002-10-27 02:34:32 +0000 |
commit | 0ea6ec6e0653a11059394d38ee75e300abe32759 (patch) | |
tree | 563d2c83dcb031ecb821ed7fe65839b67f7fd756 | |
parent | 8bbbdd3905e6d788fe6893acebc3dad8029f1470 (diff) | |
download | phpicalendar-0ea6ec6e0653a11059394d38ee75e300abe32759.tar.gz phpicalendar-0ea6ec6e0653a11059394d38ee75e300abe32759.tar.bz2 phpicalendar-0ea6ec6e0653a11059394d38ee75e300abe32759.zip |
printer view check in.
-rw-r--r-- | config.inc.php | 2 | ||||
-rw-r--r-- | day.php | 4 | ||||
-rw-r--r-- | languages/english.inc.php | 1 | ||||
-rw-r--r-- | month_bottom.php | 7 | ||||
-rw-r--r-- | print.php | 114 | ||||
-rw-r--r-- | sidebar.php | 7 |
6 files changed, 131 insertions, 4 deletions
diff --git a/config.inc.php b/config.inc.php index 5f4d3e4..2371a63 100644 --- a/config.inc.php +++ b/config.inc.php @@ -30,7 +30,7 @@ $display_ical_list = 'yes'; // In the 'Jump To' box, display the pop-up menu $allow_webcals = 'no'; // Allow http:// and webcal:// prefixed URLs to be used as the $cal for remote viewing of "subscribe-able" calendars. This does not have to be enabled to allow specific ones below. $this_months_events = 'yes'; // Display "This month's events" at the bottom off the month page. $use_color_cals = 'yes'; // Display each calendar in the pop-up as a different color. -$daysofweek_dayview = 'yes'; // Display the days of the week in day.php view. +$daysofweek_dayview = 'no'; // Display the days of the week in day.php view. $enable_rss = 'yes'; // Enable RSS access to your calendars (good thing). $blacklisted_cals[] = ''; // Fill in between the quotes the name of the calendars @@ -63,9 +63,7 @@ if (is_array($master_array[($getdate)])) { <td align="center" valign="middle"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> - <td align="left" width="90" class="navback"> - <img src="styles/silver/printer.gif" alt="" width="26" height="22" border="0"> - </td> + <td align="left" width="90" class="navback"> </td> <td class="navback"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> diff --git a/languages/english.inc.php b/languages/english.inc.php index 7dad94a..858cec6 100644 --- a/languages/english.inc.php +++ b/languages/english.inc.php @@ -44,6 +44,7 @@ $goday_lang = 'Go to Today'; $goweek_lang = 'Go to This Week'; $gomonth_lang = 'Go to This Month'; $goyear_lang = 'Go to This Year'; +$goprint_lang = 'Printer Friendly'; // RSS text for 0.8 $this_site_is_lang = 'This site is'; diff --git a/month_bottom.php b/month_bottom.php index 62b21f4..4f1647a 100644 --- a/month_bottom.php +++ b/month_bottom.php @@ -212,6 +212,13 @@ <td colspan="6" class="G10B"><?php echo "<a class=\"psf\" href=\"year.php?cal=$cal&getdate=$today_today\">$goyear_lang</a>"; ?></td> </tr> <tr> + <td colspan="7"><img src="images/spacer.gif" width="21" height="1"></td> + </tr> + <tr> + <td width="1%"><img src="images/spacer.gif" width="4" height="1"></td> + <td colspan="6" class="G10B"><?php echo "<a class=\"psf\" href=\"print.php?cal=$cal&getdate=$today_today&printview=$current_view\">$goprint_lang</a>"; ?></td> + </tr> + <tr> <td colspan="7"><img src="images/spacer.gif" width="21" height="5"></td> </tr> <tr> diff --git a/print.php b/print.php new file mode 100644 index 0000000..8c0e504 --- /dev/null +++ b/print.php @@ -0,0 +1,114 @@ +<?php + +define('BASE', './'); +include(BASE.'functions/ical_parser.php'); +$cal_displayname2 = $calendar_name . " $calendar_lang"; +if (strlen($cal_displayname2) > 24) { + $cal_displayname2 = substr("$cal_displayname2", 0, 21); + $cal_displayname2 = $cal_displayname2 . "..."; +} + +$start_week_time = strtotime(dateOfWeek($getdate, $week_start_day)); +$end_week_time = $start_week_time + (6 * 25 * 60 * 60); +$start_week = localizeDate($dateFormat_week, $start_week_time); +$end_week = localizeDate($dateFormat_week, $end_week_time); +$parse_month = date ("Ym", strtotime($getdate)); +$rssview = $HTTP_GET_VARS['rssview']; +$cal_displayname = str_replace("32", " ", $cal); +$events_week = 0; + + ?> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html;charset=UTF-8"> + <title><?php echo "$goprint_lang"; ?></title> + <link rel="stylesheet" type="text/css" href="styles/<?php echo $style_sheet.'/default.css'; ?>"> +</head> +<body bgcolor="#FFFFFF"> +<center><table border="0" width="737" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" class="calborder"> + <tr> + <td align="left" valign="top" width="1%" class="sideback"><?php echo "<img src=\"images/spacer.gif\" alt=\"right\" height=\"22\" border=\"0\" align=\"left\">"; ?></td> + <td align="center" width="98%" class="sideback"><font class="G10BOLD"><?php print (localizeDate ($dateFormat_day, strtotime($getdate))); ?></font></td> + <td align="right" valign="top" width="1%" class="sideback"></td> + </tr> + <tr> + <td colspan="3"><img src="images/spacer.gif" width="1" height="5"></td> + </tr> + <tr> + <td colspan="3"> + <table border="0" cellspacing="0" cellpadding="0" width="100%"> + <tr> + <td align="center" valign="top"> + <table width="100%" border="0" cellspacing="0" cellpadding="0"> + <tr> + <td colspan="3" height="1"></td> + </tr> + <?php + // Iterate the entire master array + foreach($master_array as $key => $val) { + + // Pull out only this months + ereg ("([0-9]{6})([0-9]{2})", $key, $regs); + if ($regs[1] == $parse_month) { + $dayofmonth = strtotime ($key); + $dayofmonth = localizeDate ($dateFormat_day, $dayofmonth); + echo "<tr><td width=\"10\"><img src=\"images/spacer.gif\" width=\"10\" height=\"1\"></td>\n"; + echo "<td colspan=\"2\"><font class=\"V12\"><b>$dayofmonth</b></font></td></tr>"; + echo "<tr><td colspan=\"3\"><img src=\"images/spacer.gif\" width=\"1\" height=\"5\"></td></tr>\n"; + + // Pull out each day + foreach ($val as $new_val) { + + // Pull out each time + foreach ($new_val as $new_key2 => $new_val2) { + if ($new_val2["event_text"]) { + $event_text = stripslashes(urldecode($new_val2["event_text"])); + $description = stripslashes(urldecode($new_val2["description"])); + $event_start = $new_val2["event_start"]; + $event_end = $new_val2["event_end"]; + $event_start = date ($timeFormat, strtotime ("$event_start")); + $event_end = date ($timeFormat, strtotime ("$event_end")); + if (!$new_val2["event_start"]) { + $event_start = "$all_day_lang"; + $event_start2 = ''; + $event_end = ''; + } + echo "<tr>\n"; + echo "<td width=\"10\"><img src=\"images/spacer.gif\" width=\"10\" height=\"1\"></td>\n"; + echo "<td width=\"10\"><img src=\"images/spacer.gif\" width=\"10\" height=\"1\"></td>\n"; + echo "<td align=\"left\">\n"; + echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\">\n"; + echo "<tr>\n"; + echo "<td width=\"100\" class=\"G10BOLD\">Time:</td>\n"; + echo "<td align=\"left\" class=\"G10B\">$event_start - $event_end</td>\n"; + echo "</tr>\n"; + echo "<tr>\n"; + echo "<td valign=\"top\" width=\"100\" class=\"G10BOLD\">Summary:</td>\n"; + echo "<td valign=\"top\" align=\"left\" class=\"G10B\">$event_text</td>\n"; + echo "</tr>\n"; + if ($new_val2["description"]) { + echo "<tr>\n"; + echo "<td valign=\"top\" width=\"100\" class=\"G10BOLD\">Description:</td>\n"; + echo "<td valign=\"top\" align=\"left\" class=\"G10B\">$description</td>\n"; + echo "</tr>\n"; + } + echo "</table>\n"; + echo "</td>\n"; + echo "</tr>\n"; + echo "<tr><td colspan=\"3\"><img src=\"images/spacer.gif\" width=\"1\" height=\"10\"></td></tr>\n"; + } + } + } + } + } + + ?> + </table> + </td> + </tr> + </table> + </td> + </tr> +</table> diff --git a/sidebar.php b/sidebar.php index 7b3415d..75ae58d 100644 --- a/sidebar.php +++ b/sidebar.php @@ -56,6 +56,13 @@ <td colspan="6" class="G10B"><?php echo "<a class=\"psf\" href=\"year.php?cal=$cal&getdate=$today_today\">$goyear_lang</a>"; ?></td> </tr> <tr> + <td colspan="7"><img src="images/spacer.gif" width="21" height="1"></td> + </tr> + <tr> + <td width="1%"><img src="images/spacer.gif" width="4" height="1"></td> + <td colspan="6" class="G10B"><?php echo "<a class=\"psf\" href=\"print.php?cal=$cal&getdate=$today_today&printview=$current_view\">$goprint_lang</a>"; ?></td> + </tr> + <tr> <td colspan="7"><img src="images/spacer.gif" width="21" height="5"></td> </tr> <tr> |