diff options
author | Chad Little <clittle@users.sourceforge.net> | 2002-09-25 23:29:10 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2002-09-25 23:29:10 +0000 |
commit | 263a43dafb9a0e7cc93a3b1bdd2ba6f68d0fc504 (patch) | |
tree | 866a9bf2d01bf67608ebead782bccd4c82f1c834 | |
parent | f73fafca80535e75215c8f3d179fca8a892fa849 (diff) | |
download | phpicalendar-263a43dafb9a0e7cc93a3b1bdd2ba6f68d0fc504.tar.gz phpicalendar-263a43dafb9a0e7cc93a3b1bdd2ba6f68d0fc504.tar.bz2 phpicalendar-263a43dafb9a0e7cc93a3b1bdd2ba6f68d0fc504.zip |
Descriptions / Notes add-in, now supports this in event.php and master_array
-rw-r--r-- | day.php | 25 | ||||
-rw-r--r-- | event.php | 18 | ||||
-rw-r--r-- | functions/event.js | 7 | ||||
-rw-r--r-- | ical_parser.php | 15 | ||||
-rw-r--r-- | languages/danish.inc.php | 1 | ||||
-rw-r--r-- | languages/dutch.inc.php | 1 | ||||
-rw-r--r-- | languages/english.inc.php | 1 | ||||
-rw-r--r-- | languages/french.inc.php | 1 | ||||
-rw-r--r-- | languages/german.inc.php | 1 | ||||
-rw-r--r-- | languages/italian.inc.php | 1 | ||||
-rw-r--r-- | languages/japanese.inc.php | 1 | ||||
-rw-r--r-- | languages/norwegian.inc.php | 1 | ||||
-rw-r--r-- | languages/polish.inc.php | 1 | ||||
-rw-r--r-- | month.php | 45 | ||||
-rw-r--r-- | week.php | 2 |
15 files changed, 78 insertions, 43 deletions
@@ -6,6 +6,7 @@ include("./ical_parser.php"); $starttime = "0700"; $weekstart = 1; $gridLength = 30; +$today_today = date ("Ymd"); if ($getdate == (date("Ymd"))) { $display_date = strftime ($dateFormat_day); @@ -40,7 +41,7 @@ if ($getdate == (date("Ymd"))) { <table width="700" border="0" cellspacing="0" cellpadding="0" class="V12"> <tr> - <td align="left" width="5%"><!--[[a class="psf" href="day.php"]]Today[[/a]]--></td> + <td align="left" width="5%"><?php echo "<a class=\"psf\" href=\"day.php?getdate=$today_today\">Today</a>"; ?></td> <td align="center" width="90%"><?php echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$getdate\">$day_lang</a> | <a class=\"psf\" href=\"week.php?cal=$cal&getdate=$getdate\">$week_lang</a> | <a class=\"psf\" href=\"month.php?cal=$cal&getdate=$getdate\">$month_lang</a>"; ?></td> <td align="right" width="5%"><!--[[a class="psf" href="preferences.php"]]Preferences[[/a]]--></td> </tr> @@ -158,15 +159,17 @@ if ($getdate == (date("Ymd"))) { switch ($event_length[$i]["state"]) { case "begin": $event_length[$i]["state"] = "started"; - $event_text = $master_array[($getdate)]["$cal_time"][($event_length[$i]["key"])]["event_text"]; - $event_text2 = addslashes($master_array[($getdate)]["$cal_time"][($event_length[$i]["key"])]["event_text"]); - $event_text2 = str_replace("\"", """, $event_text2); - $event_start = $master_array[($getdate)]["$cal_time"][($event_length[$i]["key"])]["event_start"]; - $event_end = $master_array[($getdate)]["$cal_time"][($event_length[$i]["key"])]["event_end"]; - $event_start = strtotime ("$event_start"); - $event_start = date ($timeFormat, $event_start); - $event_end = strtotime ("$event_end"); - $event_end = date ($timeFormat, $event_end); + $event_text = $master_array[($getdate)]["$cal_time"][($event_length[$i]["key"])]["event_text"]; + $event_text2 = addslashes($master_array[($getdate)]["$cal_time"][($event_length[$i]["key"])]["event_text"]); + $event_text2 = str_replace("\"", """, $event_text2); + $event_start = $master_array[($getdate)]["$cal_time"][($event_length[$i]["key"])]["event_start"]; + $event_end = $master_array[($getdate)]["$cal_time"][($event_length[$i]["key"])]["event_end"]; + $description = $master_array[($getdate)]["$cal_time"][($event_length[$i]["key"])]["description"]; + $description = str_replace("\"", """, $description); + $event_start = strtotime ("$event_start"); + $event_start = date ($timeFormat, $event_start); + $event_end = strtotime ("$event_end"); + $event_end = date ($timeFormat, $event_end); echo "<td rowspan=\"" . $event_length[$i]["length"] . "\" colspan=\"" . $drawWidth . "\" align=\"left\" valign=\"top\" class=\"eventbg\">\n"; echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n"; echo "<tr>\n"; @@ -176,7 +179,7 @@ if ($getdate == (date("Ymd"))) { echo "<td>\n"; echo "<table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"0\">\n"; echo "<tr>\n"; - echo "<td class=\"eventbg\"><a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end')\"><font class=\"eventfont\">$event_text</font></a></td>\n"; + echo "<td class=\"eventbg\"><a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end', '$description')\"><font class=\"eventfont\">$event_text</font></a></td>\n"; echo "</tr>\n"; echo "</table>\n"; echo "</td>\n"; @@ -2,6 +2,9 @@ include "init.inc.php"; $event = stripslashes($event); +$event = str_replace("\\", "", $event); +$description = stripslashes($description); +$description = str_replace("\\", "", $description); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" @@ -22,16 +25,31 @@ $event = stripslashes($event); <td nowrap width="7" height="18"></td> <td align="left" valign="top" height="18" class="V12"><?php echo "$event"; ?></td> </tr> + +<?php if ($start) { ?> <tr height="18"> <td align="right" valign="top" width="80" class="V12"> <b><?php echo "$event_start_lang"; ?>:</b></td> <td width="7" height="18"></td> <td align="left" valign="top" height="18" class="V12"><?php echo "$start"; ?></td> </tr> +<?php } ?> + +<?php if ($end) { ?> <tr height="18"> <td align="right" valign="top" width="80" class="V12"> <b><?php echo "$event_end_lang"; ?>:</b></td> <td width="7" height="18"></td> <td align="left" valign="top" height="18" class="V12"><?php echo "$end"; ?></td> </tr> +<?php } ?> + +<?php if ($description) { ?> + <tr height="18"> + <td align="right" valign="top" width="80" class="V12"> <b><?php echo "$notes_lang"; ?>:</b></td> + <td width="7" height="18"></td> + <td align="left" valign="top" height="18" class="V12"><?php echo "$description"; ?></td> + </tr> +<?php } ?> + </table> </td> </tr> diff --git a/functions/event.js b/functions/event.js index 6b51d1e..2b78312 100644 --- a/functions/event.js +++ b/functions/event.js @@ -1,14 +1,15 @@ <script language="JavaScript"> <!-- - function openEventInfo(event, calendarname, start, end) + function openEventInfo(event, calendarname, start, end, description) { var windowW = 450; - var windowH = 175; + var windowH = 275; var url = "event.php?event="+escape(event)+ "&calendar_name="+escape(calendarname)+ "&start="+escape(start)+ - "&end="+escape(end); + "&end="+escape(end)+ + "&description="+escape(description); options = "scrollbars=no"+",width="+windowW+",height="+windowH; diff --git a/ical_parser.php b/ical_parser.php index 5334e99..750aed2 100644 --- a/ical_parser.php +++ b/ical_parser.php @@ -60,7 +60,7 @@ foreach($contents as $line) { // Clean out \n's and other slashes $summary = str_replace("\\n", "<br>", $summary); $summary = stripslashes($summary); - + $description = str_replace("\\n", "<br>", $description); //echo "<b>Start</b> $start_time <b>End</B> $end_time <b>Summary</b> $summary<br>\n"; if ($start_time != "") { @@ -91,7 +91,7 @@ foreach($contents as $line) { $start_date = date("Ymd", $start); // $master_array[($start_date)][("0001")]["event_text"][] = "$summary"; // drei 20020921: changed array for allday event - $master_array[($start_date)][("-1")][]= array ("event_text" => "$summary"); + $master_array[($start_date)][("-1")][]= array ("event_text" => "$summary", "description" => $description); $start = ($start + (24*3600)); } while ($start != $end); } @@ -207,7 +207,7 @@ foreach($contents as $line) { $end = $end_of_vevent; do { $start_date = date("Ymd", $start); - $master_array[($start_date)][("-1")][]= array ("event_text" => "$summary"); + $master_array[($start_date)][("-1")][]= array ("event_text" => "$summary", "description" => $description); $start = ($start + (24*3600)); } while ($start < $end); $start_of_vevent = DateAdd ($interval, $number, $start_of_vevent); @@ -277,7 +277,7 @@ foreach($contents as $line) { // check for overlapping events $nbrOfOverlaps = checkOverlap(); // writes to $master array here - $master_array[($next_date)][($hour.$minute)][] = array ("event_start" => $start_time, "event_text" => $summary, "event_end" => $end_time, "event_length" => $length, "event_overlap" => $nbrOfOverlaps); + $master_array[($next_date)][($hour.$minute)][] = array ("event_start" => $start_time, "event_text" => $summary, "event_end" => $end_time, "event_length" => $length, "event_overlap" => $nbrOfOverlaps, "description" => $description); } } } else { @@ -301,7 +301,7 @@ foreach($contents as $line) { // check for overlapping events $nbrOfOverlaps = checkOverlap(); // writes to $master array here - $master_array[($next_date)][($hour.$minute)][] = array ("event_start" => $start_time, "event_text" => $summary, "event_end" => $end_time, "event_length" => $length, "event_overlap" => $nbrOfOverlaps); + $master_array[($next_date)][($hour.$minute)][] = array ("event_start" => $start_time, "event_text" => $summary, "event_end" => $end_time, "event_length" => $length, "event_overlap" => $nbrOfOverlaps, "description" => $description); } } else { $interval = 1; @@ -326,7 +326,7 @@ foreach($contents as $line) { $nbrOfOverlaps = checkOverlap(); // writes to $master array here - $master_array[($start_date)][($hour.$minute)][] = array ("event_start" => $start_time, "event_text" => $summary, "event_end" => $end_time, "event_length" => $length, "event_overlap" => $nbrOfOverlaps); + $master_array[($start_date)][($hour.$minute)][] = array ("event_start" => $start_time, "event_text" => $summary, "event_end" => $end_time, "event_length" => $length, "event_overlap" => $nbrOfOverlaps, "description" => $description); } @@ -378,6 +378,9 @@ foreach($contents as $line) { } elseif (strstr($field, "SUMMARY")) { $summary = $data; + + } elseif (strstr($field, "DESCRIPTION")) { + $description = $data; } elseif (strstr($field, "X-WR-CALNAME")) { $calendar_name = $data; diff --git a/languages/danish.inc.php b/languages/danish.inc.php index 134258d..aa061c0 100644 --- a/languages/danish.inc.php +++ b/languages/danish.inc.php @@ -33,6 +33,7 @@ $this_months_lang = "Denne Måneds Aftaler"; $date_lang = "Dato"; $summary_lang = "Opsummering"; $all_day_lang = "All day event"; +$notes_lang = "Notes"; // Set Location for date formatting, check out: http://www.php.net/manual/en/function.setlocale.php setlocale (LC_TIME, 'dk_DK'); diff --git a/languages/dutch.inc.php b/languages/dutch.inc.php index a964b90..0be2327 100644 --- a/languages/dutch.inc.php +++ b/languages/dutch.inc.php @@ -33,6 +33,7 @@ $this_months_lang = "Activiteiten Deze Maand"; $date_lang = "Datum"; $summary_lang = "Overzicht"; $all_day_lang = "All day event"; +$notes_lang = "Notes"; // Set Location for date formatting, check out: http://www.php.net/manual/en/function.setlocale.php setlocale (LC_TIME, 'nl_BE'); diff --git a/languages/english.inc.php b/languages/english.inc.php index 9fe1f77..893bbaa 100644 --- a/languages/english.inc.php +++ b/languages/english.inc.php @@ -33,6 +33,7 @@ $this_months_lang = "This Month's Events"; $date_lang = "Date"; $summary_lang = "Summary"; $all_day_lang = "All day event"; +$notes_lang = "Notes"; // Set Location for date formatting, check out: http://www.php.net/manual/en/function.setlocale.php setlocale (LC_TIME, 'en_EN'); diff --git a/languages/french.inc.php b/languages/french.inc.php index 5508d32..6f6c3b2 100644 --- a/languages/french.inc.php +++ b/languages/french.inc.php @@ -33,6 +33,7 @@ $this_months_lang = "Événements de ce mois"; $date_lang = "Date"; $summary_lang = "Résumé"; $all_day_lang = "All day event"; +$notes_lang = "Notes"; // Set Location for date formatting, check out: http://www.php.net/manual/fr/function.setlocale.php setlocale (LC_TIME,"fr_FR"); diff --git a/languages/german.inc.php b/languages/german.inc.php index f8243e1..f5b677b 100644 --- a/languages/german.inc.php +++ b/languages/german.inc.php @@ -32,6 +32,7 @@ $this_months_lang = "Alle Einträge in diesem Monat"; $date_lang = "Datum"; $summary_lang = "Beschreibung"; $all_day_lang = "All day event"; +$notes_lang = "Notes"; // Set Location for date formatting, check out: http://www.php.net/manual/en/function.setlocale.php // for Switzerland diff --git a/languages/italian.inc.php b/languages/italian.inc.php index a763d68..c6c17d5 100644 --- a/languages/italian.inc.php +++ b/languages/italian.inc.php @@ -33,6 +33,7 @@ $this_months_lang = "Eventi di questo mese"; $date_lang = "Data"; $summary_lang = "Sommario"; $all_day_lang = "All day event"; +$notes_lang = "Notes"; // Set Location for date formatting, check out: http://www.php.net/manual/en/function.setlocale.php setlocale (LC_TIME, 'it_IT'); diff --git a/languages/japanese.inc.php b/languages/japanese.inc.php index e201cb7..33a68e1 100644 --- a/languages/japanese.inc.php +++ b/languages/japanese.inc.php @@ -34,6 +34,7 @@ $this_months_lang = "今月の予定"; $date_lang = "月日"; $summary_lang = "話題"; $all_day_lang = "終日イベント"; +$notes_lang = "Notes"; // Set Location for date formatting, check out: http://www.php.net/manual/en/function.setlocale.php setlocale (LC_TIME, 'ja_JP.SJIS'); diff --git a/languages/norwegian.inc.php b/languages/norwegian.inc.php index d15f181..ab3ab9d 100644 --- a/languages/norwegian.inc.php +++ b/languages/norwegian.inc.php @@ -33,6 +33,7 @@ $this_months_lang = "Denne Månedens Hendelser"; $date_lang = "Dato"; $summary_lang = "Sammendrag"; $all_day_lang = "All day event"; +$notes_lang = "Notes"; // Set Location for date formatting, check out: http://www.php.net/manual/en/function.setlocale.php setlocale (LC_TIME, 'no_NO'); diff --git a/languages/polish.inc.php b/languages/polish.inc.php index 81b251b..7e2743a 100644 --- a/languages/polish.inc.php +++ b/languages/polish.inc.php @@ -33,6 +33,7 @@ $this_months_lang = "Zadania miesiąca"; $date_lang = "Data"; $summary_lang = "Info"; $all_day_lang = "All day event"; +$notes_lang = "Notes"; // Set Location for date formatting, check out: http://www.php.net/manual/en/function.setlocale.php setlocale (LC_TIME, 'pl_PL'); @@ -18,6 +18,7 @@ $display_month = strftime ($dateFormat_month, $date); $parse_month = date ("Ym", $date); $first_sunday = sundayOfWeek($this_year, $this_month, "1"); + $today_today = date ("Ymd"); ?> @@ -34,7 +35,7 @@ <center> <table width="740" border="0" cellspacing="0" cellpadding="0" class="V12"> <tr> - <td align="left" width="5%"><!--[[a class="psf" href="day.php"]]Today[[/a]]--></td> + <td align="left" width="5%"><?php echo "<a class=\"psf\" href=\"day.php?getdate=$today_today\">Today</a>"; ?></td> <td align="center" width="90%"><?php echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$getdate\">$day_lang</a> | <a class=\"psf\" href=\"week.php?cal=$cal&getdate=$getdate\">$week_lang</a> | <a class=\"psf\" href=\"month.php?cal=$cal&getdate=$getdate\">$month_lang</a>"; ?></td> <td align="right" width="5%"><!--[[a class="psf" href="preferences.php"]]Preferences[[/a]]--></td> </tr> @@ -127,14 +128,14 @@ $event_text = $val["event_text"]; $event_text = strip_tags($event_text, '<b><i><u>'); if ($event_text != "") { - $event_text2 = addslashes($val["event_text"]); - $event_text2 = str_replace("\"", """, $event_text2); - $event_start = $val["event_start"]; - $event_end = $val["event_end"]; - $event_start = strtotime ("$event_start"); - $event_end = strtotime ("$event_end"); - $event_end = date ($timeFormat, $event_end); - $event_start = date ($timeFormat, $event_start); + $event_text2 = addslashes($val["event_text"]); + $event_text2 = str_replace("\"", """, $event_text2); + $description = addslashes($val["description"]); + $description = str_replace("\"", """, $description); + $event_start = $val["event_start"]; + $event_end = $val["event_end"]; + $event_start = date ($timeFormat, strtotime ("$event_start")); + $event_end = date ($timeFormat, strtotime ("$event_end")); if (strlen($event_text) > 12) { $event_text = substr("$event_text", 0, 10); $event_text = $event_text . "..."; @@ -145,9 +146,9 @@ echo "<tr>\n"; echo "<td>\n"; if (!$event_start = $val["event_start"]) { - echo "<center><a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end')\"><i>$event_text</i></a></center>\n"; + echo "<center><a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end', '$description')\"><i>$event_text</i></a></center>\n"; } else { - echo "<a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end')\"><font class=\"G10B\">• $event_text</font></a>\n"; + echo "<a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end', '$description')\"><font class=\"G10B\">• $event_text</font></a>\n"; } echo "</td>\n"; echo "</tr>\n"; @@ -263,15 +264,15 @@ // Pull out each time foreach ($new_val as $new_key2 => $new_val2) { if ($new_val2["event_text"]) { - $event_text = $new_val2["event_text"]; - $event_text2 = addslashes($new_val2["event_text"]); - $event_text2 = str_replace("\"", """, $event_text2); - $event_start = $new_val2["event_start"]; - $event_end = $new_val2["event_end"]; - $event_start = strtotime ("$event_start"); - $event_end = strtotime ("$event_end"); - $event_end = date ($timeFormat, $event_end); - $event_start = date ($timeFormat, $event_start); + $event_text = $new_val2["event_text"]; + $event_text2 = addslashes($new_val2["event_text"]); + $event_text2 = str_replace("\"", """, $event_text2); + $description = addslashes($new_val2["description"]); + $description = str_replace("\"", """, $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")); $event_text = str_replace ("<br>", "", $event_text); if (strlen($event_text) > 70) { $event_text = substr("$event_text", 0, 65); @@ -285,9 +286,9 @@ echo "</td>\n"; echo "<td valign=\"middle\" bgcolor=\"white\" width=\"540\" height=\"20\">\n"; if (!$new_val2["event_start"]) { - echo "<font class=\"G10B\"> <a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end')\">$event_text</font></a> <font class=\"V9\">($all_day_lang)</font>\n"; + echo "<font class=\"G10B\"> <a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end', '$description')\">$event_text</font></a> <font class=\"V9\">($all_day_lang)</font>\n"; } else { - echo "<font class=\"G10B\"> <a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end')\">$event_text</a></font> <font class=\"V9\">($event_start - $event_end)</font>\n"; + echo "<font class=\"G10B\"> <a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end', '$description')\">$event_text</a></font> <font class=\"V9\">($event_start - $event_end)</font>\n"; } echo "</td>\n"; echo "</tr>\n"; @@ -1 +1 @@ -<?php
$current_view = "week";
include("ical_parser.php");
ereg ("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2);
$this_day = $day_array2[3];
$this_week = $day_array2[2];
$this_year = $day_array2[1];
$sunday = sundayOfWeek($this_year, $this_month, $this_day);
$sunday_date = strtotime("$sunday");
$saturday = ($sunday_date + (6 * 25 * 60 * 60));
$start_week = strftime($dateFormat_week, strtotime("$sunday"));
$end_week = strftime($dateFormat_week, $saturday);
$date = strtotime ("$getdate");
$next_week2 = ($date + (7 * 24.4 * 60 * 60));
$prev_week2 = ($date - (7 * 24.4 * 60 * 60));
$next_week = date("Ymd", $next_week2);
$prev_week = date("Ymd", $prev_week2);
?>
<!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 "$calendar_name"; ?></title>
<link rel="stylesheet" type="text/css" href="styles/default.css">
<?php include "functions/event.js"; ?>
</head>
<body bgcolor="#FFFFFF">
<center>
<table width="700" border="0" cellspacing="0" cellpadding="0" class="V12">
<tr>
<td align="left" width="5%"><!--[[a class="psf" href="day.php"]]Today[[/a]]--></td>
<td align="center" width="90%"><?php echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$getdate\">$day_lang</a> | <a class=\"psf\" href=\"week.php?cal=$cal&getdate=$getdate\">$week_lang</a> | <a class=\"psf\" href=\"month.php?cal=$cal&getdate=$getdate\">$month_lang</a>"; ?></td>
<td align="right" width="5%"><!--[[a class="psf" href="preferences.php"]]Preferences[[/a]]--></td>
</tr>
<tr>
<td colspan="3"><img src="images/spacer.gif" height="10" width="1"></td>
</tr>
</table>
<table width="700" border="0" cellspacing="1" cellpadding="2" class="calborder">
<tr>
<td>
<table width="700" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="middle">
<table border="0" cellspacing="0" cellpadding="0" bgcolor="#a1a5a9" class="G10B">
<tr>
<td align="center" valign="top">
<table border="0" cellspacing="1" cellpadding="0">
<tr>
<td colspan="3" bgcolor="white" nowrap>
<table width="100%" border="0" cellspacing="4" cellpadding="0">
<tr>
<td colspan="3">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="G10B" align="left" valign="top" width="5%" nowrap><?php echo "<a class=\"psf\" href=\"week.php?cal=$cal&getdate=$prev_week\">$last_week_lang</a>"; ?></td>
<td class="H20" align="center" valign="middle" width="90%" nowrap><?php echo "$start_week - $end_week"; ?></td>
<td class="G10B" align="right" valign="top" width="5%" nowrap><?php echo "<a class=\"psf\" href=\"week.php?cal=$cal&getdate=$next_week\">$next_week_lang</a>"; ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="middle"><?php include('./list_icals.php'); ?></td>
<td align="right" valign="middle" class="G10B"><?php echo "<a class=\"psf\" href=\"$fullpath$cal.ics\">$subscribe_lang</a> | <a class=\"psf\" href=\"$filename\">$download_lang</a>"; ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" valign="top">
<table border="0" cellspacing="1" cellpadding="0" class="G10B">
<tr height="12">
<td colspan="2" height="11" width="60" nowrap bgcolor="#f5f5f5">
</td>
<?php
$thisdate = strtotime ("$sunday");
$i = 0;
do {
$thisday = date("Ymd", $thisdate);
$thisday2 = strftime($dateFormat_week_list, $thisdate);
echo "<td height=\"12\" width=\"101\" colspan=\"2\" valign=\"top\" align=\"center\" bgcolor=\"#f5f5f5\" class=\"V9\">\n";
echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$thisday\">$thisday2</a>\n";
echo "</td>\n";
$thisdate = ($thisdate + (25 * 60 * 60));
$i++;
} while ($i != 7);
?>
</tr>
<tr>
<td colspan="2" width="60" valign="top" align="center" bgcolor="#f5f5f5">
<img src="images/spacer.gif" width="1" height="1">
</td>
<?php
$thisdate = strtotime ("$sunday");
$i = 0;
do {
$thisday = date("Ymd", $thisdate);
if ($master_array[("$thisday")]["-1"]) {
echo "<td colspan=\"2\" valign=\"top\" align=\"center\" bgcolor=\"#ffffff\">\n";
foreach ($master_array[("$thisday")]["-1"] as $allDay_event) {
$event_text2 = addslashes($allDay_event["event_text"]);
$event_text2 = str_replace("\"", """, $event_text2);
if (strlen($allDay_event["event_text"]) > 14) {
$event_text = substr($allDay_event["event_text"], 0, 11);
$event_text = $event_text . "...";
} else {
$event_text = $allDay_event["event_text"];
}
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
echo "<tr height=\"20\">\n";
echo "<td height=\"20\" valign=\"middle\" align=\"center\" class=\"eventbg\">\n";
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
echo "<tr>\n";
echo "<td valign=\"top\" align=\"center\">\n";
echo "<a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end')\"><font class=\"eventfont\"><i>$event_text</i></font></a>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr height=\"1\">\n";
echo "<td height=\"1\">\n";
echo "<img src=\"images/spacer.gif\" width=\"1\" height=\"1\"> \n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
}
echo "</td>\n";
} else {
echo "<td colspan=\"2\" valign=\"top\" align=\"center\" bgcolor=\"#ffffff\">\n";
echo "<img src=\"images/spacer.gif\" width=\"1\" height=\"1\">\n";
echo "</td>\n";
}
$thisdate = ($thisdate + (25 * 60 * 60));
$i++;
} while ($i != 7);
?>
</tr>
<tr>
<td width="60" bgcolor="#a1a5a9" nowrap>
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="1" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
</tr>
<?php
$event_length = 0;
$k = 0;
foreach ($day_array as $key) {
$count = 0;
$k = 0;
$cal_time = $key;
$key = strtotime ("$key");
if ($time_format == "24") {
$key = date ("G:i", $key);
} else {
$key = date ("g:i A", $key);
}
// The first <TR> (on the hour)
if (ereg("^([0-9]{1,2}):00", $key)) {
echo "<tr height=\"30\">\n";
echo "<td rowspan=\"2\" align=\"center\" valign=\"top\" bgcolor=\"#f5f5f5\" width=\"60\">$key</td>\n";
echo "<td height=\"30\" width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\n";
$thisdate = strtotime ("$sunday");
$thisday = date("Ymd", $thisdate);
do {
if ($master_array["$thisday"]["$cal_time"]) {
$event_text = $master_array["$thisday"]["$cal_time"][$k]["event_text"];
$event_text2 = addslashes($master_array["$thisday"]["$cal_time"][$k]["event_text"]);
$event_text2 = str_replace("\"", """, $event_text2);
$event_start = $master_array["$thisday"]["$cal_time"][$k]["event_start"];
$event_end = $master_array["$thisday"]["$cal_time"][$k]["event_end"];
$event_start = strtotime ("$event_start");
$event_end = strtotime ("$event_end");
if ($time_format == "24") {
$event_start = date ("G:i", $event_start);
$event_end = date ("G:i", $event_end);
} else {
$event_start = date ("g:i a", $event_start);
$event_end = date ("g:i a", $event_end);
}
if (strlen($event_text) > 14) {
$event_text = substr("$event_text", 0, 11);
$event_text = $event_text . "...";
}
echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> <a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end')\">$event_text</a></td>\n";
} else {
echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> </td>\n";
}
$thisdate = ($thisdate + (25 * 60 * 60));
$thisday = date("Ymd", $thisdate);
$count++;
} while ($count != 7);
// End Week
echo "</tr>\n";
$count = 0;
}
// The second <TR> (on the half hour)
if (ereg("([0-9]{1,2}):30", $key)) {
echo "<tr height=\"30\">\n";
echo "<td height=\"30\" width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\n";
$thisdate = strtotime ("$sunday");
$thisday = date("Ymd", $thisdate);
do {
if ($master_array["$thisday"]["$cal_time"]) {
$event_start = $master_array["$thisday"]["$cal_time"][$k]["event_start"];
$event_end = $master_array["$thisday"]["$cal_time"][$k]["event_end"];
$event_start = strtotime ("$event_start");
$event_end = strtotime ("$event_end");
if ($time_format == "24") {
$event_start = date ("G:i", $event_start);
$event_end = date ("G:i", $event_end);
} else {
$event_start = date ("g:i a", $event_start);
$event_end = date ("g:i a", $event_end);
}
$event_text = $master_array["$thisday"]["$cal_time"][$k]["event_text"];
$event_text2 = addslashes($master_array["$thisday"]["$cal_time"][$k]["event_text"]);
$event_text2 = str_replace("\"", """, $event_text2);
if (strlen($event_text) > 14) {
$event_text = substr("$event_text", 0, 11);
$event_text = $event_text . "...";
}
echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> <a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end')\">$event_text</a></td>\n";
} else {
echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> </td>\n";
}
$thisdate = ($thisdate + (25 * 60 * 60));
$thisday = date("Ymd", $thisdate);
$count++;
} while ($count != 7);
echo "</tr>\n";
}
}
?>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<?php echo "<font class=\"V9\">$powered_by_lang <a class=\"psf\" href=\"http://sourceforge.net/projects/phpicalendar/\">PHP iCalendar $version_lang</a></font>"; ?>
</center>
</body>
</html>
\ No newline at end of file +<?php
$current_view = "week";
include("ical_parser.php");
ereg ("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2);
$this_day = $day_array2[3];
$this_week = $day_array2[2];
$this_year = $day_array2[1];
$sunday = sundayOfWeek($this_year, $this_month, $this_day);
$sunday_date = strtotime("$sunday");
$saturday = ($sunday_date + (6 * 25 * 60 * 60));
$start_week = strftime($dateFormat_week, strtotime("$sunday"));
$end_week = strftime($dateFormat_week, $saturday);
$date = strtotime ("$getdate");
$next_week2 = ($date + (7 * 24.4 * 60 * 60));
$prev_week2 = ($date - (7 * 24.4 * 60 * 60));
$next_week = date("Ymd", $next_week2);
$prev_week = date("Ymd", $prev_week2);
$today_today = date ("Ymd");
?>
<!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 "$calendar_name"; ?></title>
<link rel="stylesheet" type="text/css" href="styles/default.css">
<?php include "functions/event.js"; ?>
</head>
<body bgcolor="#FFFFFF">
<center>
<table width="700" border="0" cellspacing="0" cellpadding="0" class="V12">
<tr>
<td align="left" width="5%"><?php echo "<a class=\"psf\" href=\"day.php?getdate=$today_today\">Today</a>"; ?></td>
<td align="center" width="90%"><?php echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$getdate\">$day_lang</a> | <a class=\"psf\" href=\"week.php?cal=$cal&getdate=$getdate\">$week_lang</a> | <a class=\"psf\" href=\"month.php?cal=$cal&getdate=$getdate\">$month_lang</a>"; ?></td>
<td align="right" width="5%"><!--[[a class="psf" href="preferences.php"]]Preferences[[/a]]--></td>
</tr>
<tr>
<td colspan="3"><img src="images/spacer.gif" height="10" width="1"></td>
</tr>
</table>
<table width="700" border="0" cellspacing="1" cellpadding="2" class="calborder">
<tr>
<td>
<table width="700" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="middle">
<table border="0" cellspacing="0" cellpadding="0" bgcolor="#a1a5a9" class="G10B">
<tr>
<td align="center" valign="top">
<table border="0" cellspacing="1" cellpadding="0">
<tr>
<td colspan="3" bgcolor="white" nowrap>
<table width="100%" border="0" cellspacing="4" cellpadding="0">
<tr>
<td colspan="3">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="G10B" align="left" valign="top" width="5%" nowrap><?php echo "<a class=\"psf\" href=\"week.php?cal=$cal&getdate=$prev_week\">$last_week_lang</a>"; ?></td>
<td class="H20" align="center" valign="middle" width="90%" nowrap><?php echo "$start_week - $end_week"; ?></td>
<td class="G10B" align="right" valign="top" width="5%" nowrap><?php echo "<a class=\"psf\" href=\"week.php?cal=$cal&getdate=$next_week\">$next_week_lang</a>"; ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="middle"><?php include('./list_icals.php'); ?></td>
<td align="right" valign="middle" class="G10B"><?php echo "<a class=\"psf\" href=\"$fullpath$cal.ics\">$subscribe_lang</a> | <a class=\"psf\" href=\"$filename\">$download_lang</a>"; ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" valign="top">
<table border="0" cellspacing="1" cellpadding="0" class="G10B">
<tr height="12">
<td colspan="2" height="11" width="60" nowrap bgcolor="#f5f5f5">
</td>
<?php
$thisdate = strtotime ("$sunday");
$i = 0;
do {
$thisday = date("Ymd", $thisdate);
$thisday2 = strftime($dateFormat_week_list, $thisdate);
echo "<td height=\"12\" width=\"101\" colspan=\"2\" valign=\"top\" align=\"center\" bgcolor=\"#f5f5f5\" class=\"V9\">\n";
echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$thisday\">$thisday2</a>\n";
echo "</td>\n";
$thisdate = ($thisdate + (25 * 60 * 60));
$i++;
} while ($i != 7);
?>
</tr>
<tr>
<td colspan="2" width="60" valign="top" align="center" bgcolor="#f5f5f5">
<img src="images/spacer.gif" width="1" height="1">
</td>
<?php
$thisdate = strtotime ("$sunday");
$i = 0;
do {
$thisday = date("Ymd", $thisdate);
if ($master_array[("$thisday")]["-1"]) {
echo "<td colspan=\"2\" valign=\"top\" align=\"center\" bgcolor=\"#ffffff\">\n";
foreach ($master_array[("$thisday")]["-1"] as $allDay_event) {
$event_text2 = addslashes($allDay_event["event_text"]);
$event_text2 = str_replace("\"", """, $event_text2);
if (strlen($allDay_event["event_text"]) > 14) {
$event_text = substr($allDay_event["event_text"], 0, 11);
$event_text = $event_text . "...";
} else {
$event_text = $allDay_event["event_text"];
}
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
echo "<tr height=\"20\">\n";
echo "<td height=\"20\" valign=\"middle\" align=\"center\" class=\"eventbg\">\n";
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
echo "<tr>\n";
echo "<td valign=\"top\" align=\"center\">\n";
echo "<a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end', '$description')\"><font class=\"eventfont\"><i>$event_text</i></font></a>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr height=\"1\">\n";
echo "<td height=\"1\">\n";
echo "<img src=\"images/spacer.gif\" width=\"1\" height=\"1\"> \n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
}
echo "</td>\n";
} else {
echo "<td colspan=\"2\" valign=\"top\" align=\"center\" bgcolor=\"#ffffff\">\n";
echo "<img src=\"images/spacer.gif\" width=\"1\" height=\"1\">\n";
echo "</td>\n";
}
$thisdate = ($thisdate + (25 * 60 * 60));
$i++;
} while ($i != 7);
?>
</tr>
<tr>
<td width="60" bgcolor="#a1a5a9" nowrap>
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="1" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
</tr>
<?php
$event_length = 0;
$k = 0;
foreach ($day_array as $key) {
$count = 0;
$k = 0;
$cal_time = $key;
$key = strtotime ("$key");
if ($time_format == "24") {
$key = date ("G:i", $key);
} else {
$key = date ("g:i A", $key);
}
// The first <TR> (on the hour)
if (ereg("^([0-9]{1,2}):00", $key)) {
echo "<tr height=\"30\">\n";
echo "<td rowspan=\"2\" align=\"center\" valign=\"top\" bgcolor=\"#f5f5f5\" width=\"60\">$key</td>\n";
echo "<td height=\"30\" width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\n";
$thisdate = strtotime ("$sunday");
$thisday = date("Ymd", $thisdate);
do {
if ($master_array["$thisday"]["$cal_time"]) {
$event_text = $master_array["$thisday"]["$cal_time"][$k]["event_text"];
$event_text2 = addslashes($master_array["$thisday"]["$cal_time"][$k]["event_text"]);
$event_text2 = str_replace("\"", """, $event_text2);
$description = addslashes($master_array["$thisday"]["$cal_time"][$k]["description"]);
$description = str_replace("\"", """, $description);
$event_start = $master_array["$thisday"]["$cal_time"][$k]["event_start"];
$event_end = $master_array["$thisday"]["$cal_time"][$k]["event_end"];
$event_start = strtotime ("$event_start");
$event_end = strtotime ("$event_end");
if ($time_format == "24") {
$event_start = date ("G:i", $event_start);
$event_end = date ("G:i", $event_end);
} else {
$event_start = date ("g:i a", $event_start);
$event_end = date ("g:i a", $event_end);
}
if (strlen($event_text) > 14) {
$event_text = substr("$event_text", 0, 11);
$event_text = $event_text . "...";
}
echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> <a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end', '$description')\">$event_text</a></td>\n";
} else {
echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> </td>\n";
}
$thisdate = ($thisdate + (25 * 60 * 60));
$thisday = date("Ymd", $thisdate);
$count++;
} while ($count != 7);
// End Week
echo "</tr>\n";
$count = 0;
}
// The second <TR> (on the half hour)
if (ereg("([0-9]{1,2}):30", $key)) {
echo "<tr height=\"30\">\n";
echo "<td height=\"30\" width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\n";
$thisdate = strtotime ("$sunday");
$thisday = date("Ymd", $thisdate);
do {
if ($master_array["$thisday"]["$cal_time"]) {
$event_start = $master_array["$thisday"]["$cal_time"][$k]["event_start"];
$event_end = $master_array["$thisday"]["$cal_time"][$k]["event_end"];
$event_start = date ($timeFormat, strtotime ("$event_start"));
$event_end = date ($timeFormat, strtotime ("$event_end"));
$event_text = $master_array["$thisday"]["$cal_time"][$k]["event_text"];
$event_text2 = addslashes($master_array["$thisday"]["$cal_time"][$k]["event_text"]);
$event_text2 = str_replace("\"", """, $event_text2);
$description = addslashes($master_array["$thisday"]["$cal_time"][$k]["description"]);
$description = str_replace("\"", """, $description);
if (strlen($event_text) > 14) {
$event_text = substr("$event_text", 0, 11);
$event_text = $event_text . "...";
}
echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> <a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end', '$description')\">$event_text</a></td>\n";
} else {
echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> </td>\n";
}
$thisdate = ($thisdate + (25 * 60 * 60));
$thisday = date("Ymd", $thisdate);
$count++;
} while ($count != 7);
echo "</tr>\n";
}
}
?>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<?php echo "<font class=\"V9\">$powered_by_lang <a class=\"psf\" href=\"http://sourceforge.net/projects/phpicalendar/\">PHP iCalendar $version_lang</a></font>"; ?>
</center>
</body>
</html>
\ No newline at end of file |