aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2002-09-26 15:45:31 +0000
committerChad Little <clittle@users.sourceforge.net>2002-09-26 15:45:31 +0000
commitc0d6b2b33ebe7a02d7aa7863cbcf4922cb3e6527 (patch)
treec09bc1b9a8850b227d359dd3de8491f605bcf351
parente83d767bc9527ab20c7932ed359dc2d6a383d837 (diff)
downloadphpicalendar-c0d6b2b33ebe7a02d7aa7863cbcf4922cb3e6527.tar.gz
phpicalendar-c0d6b2b33ebe7a02d7aa7863cbcf4922cb3e6527.tar.bz2
phpicalendar-c0d6b2b33ebe7a02d7aa7863cbcf4922cb3e6527.zip
Calendar moves with "This Month, This Week"
-rw-r--r--day.php4
-rw-r--r--functions/list_icals.php39
-rw-r--r--languages/norwegian.inc.php4
-rw-r--r--month.php4
-rw-r--r--week.php2
5 files changed, 46 insertions, 7 deletions
diff --git a/day.php b/day.php
index cd0c493..4ef70d7 100644
--- a/day.php
+++ b/day.php
@@ -48,7 +48,7 @@ if ($getdate == (date("Ymd"))) {
<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="left" width="5%"><?php echo "<a class=\"psf\" href=\"day.php?cal=$cal&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>
@@ -80,7 +80,7 @@ if ($getdate == (date("Ymd"))) {
</td>
</tr>
<tr>
- <td align="left" valign="middle" class="G10B" width="50%"><?php include('./list_icals.php'); ?></td>
+ <td align="left" valign="middle" class="G10B" width="50%"><?php include('./functions/list_icals.php'); ?></td>
<td align="right" valign="middle" class="G10B" width="50%"><?php echo "<a class=\"psf\" href=\"$fullpath$cal.ics\">$subscribe_lang</a>&nbsp;|&nbsp;<a class=\"psf\" href=\"$filename\">$download_lang</a>"; ?></td>
</tr>
</table>
diff --git a/functions/list_icals.php b/functions/list_icals.php
new file mode 100644
index 0000000..c585780
--- /dev/null
+++ b/functions/list_icals.php
@@ -0,0 +1,39 @@
+<?php
+
+// start of <select> tag
+if (isset($getdate)) {
+ $query="&getdate=$getdate";
+} else {
+ $query="";
+}
+print "<form>\n<select name=\"action\" class=\"G10B\" onChange=\"window.location=(this.options[this.selectedIndex].value+'$query');\">\n";
+#print "<option value=\"null\">Select a Calendar</option>\n";
+
+// open file
+$dir_handle = @opendir($calendar_path) or die("Unable to open $calendar_path");
+
+// build the <option> tags
+while ($file = readdir($dir_handle)) {
+ if (strstr ($file, ".ics")) {
+ // $cal_filename is the filename of the calendar without .ics
+ // $cal is a urlencoded version of $cal_filename
+ // $cal_displayname is $cal_filename with occurrences of "32" replaced with " "
+ $cal_filename = substr($file,0,-4);
+ $cal_tmp = urlencode($cal_filename);
+ $cal_displayname = str_replace("32", " ", $cal_filename);
+
+ if ($cal_tmp == $cal) {
+ print "<option value=\"$current_view.php?cal=$cal_tmp\" selected>$cal_displayname Calendar</option>\n";
+ } else {
+ print "<option value=\"$current_view.php?cal=$cal_tmp\">$cal_filename Calendar</option>\n";
+ }
+
+ }
+}
+
+// close file
+closedir($dir_handle);
+
+// finish <select>
+print "</select>\n</form>";
+?> \ No newline at end of file
diff --git a/languages/norwegian.inc.php b/languages/norwegian.inc.php
index ab3ab9d..8c2ab4a 100644
--- a/languages/norwegian.inc.php
+++ b/languages/norwegian.inc.php
@@ -32,8 +32,8 @@ $event_end_lang = "Slutt Tid";
$this_months_lang = "Denne M&aring;nedens Hendelser";
$date_lang = "Dato";
$summary_lang = "Sammendrag";
-$all_day_lang = "All day event";
-$notes_lang = "Notes";
+$all_day_lang = "Hele dagen";
+$notes_lang = "Notater";
// Set Location for date formatting, check out: http://www.php.net/manual/en/function.setlocale.php
setlocale (LC_TIME, 'no_NO');
diff --git a/month.php b/month.php
index 781ae6b..2f30ad2 100644
--- a/month.php
+++ b/month.php
@@ -35,7 +35,7 @@
<center>
<table width="740" border="0" cellspacing="0" cellpadding="0" class="V12">
<tr>
- <td align="left" width="5%"><?php echo "<a class=\"psf\" href=\"month.php?getdate=$today_today\">This&nbsp;Month</a>"; ?></td>
+ <td align="left" width="5%"><?php echo "<a class=\"psf\" href=\"month.php?cal=$cal&getdate=$today_today\">This&nbsp;Month</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>
@@ -71,7 +71,7 @@
<td align="center" valign="middle">
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
<tr height="20">
- <td align="left" valign="middle" height="26"><?php include('./list_icals.php'); ?></td>
+ <td align="left" valign="middle" height="26"><?php include('./functions/list_icals.php'); ?></td>
<td align="right" class="G10B"><?php echo "<a class=\"psf\" href=\"$fullpath$cal.ics\">$subscribe_lang</a>&nbsp;|&nbsp;<a class=\"psf\" href=\"$filename\">$download_lang</a>"; ?></td>
</tr>
</table>
diff --git a/week.php b/week.php
index 72a7b1f..e683712 100644
--- a/week.php
+++ b/week.php
@@ -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); $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=\"week.php?getdate=$today_today\">This&nbsp;Week</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>&nbsp;|&nbsp;<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"> &nbsp; </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("\"", "&quot;", $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("\"", "&quot;", $event_text2); $description = addslashes($master_array["$thisday"]["$cal_time"][$k]["description"]); $description = str_replace("\"", "&quot;", $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\">&nbsp;<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\">&nbsp;</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("\"", "&quot;", $event_text2); $description = addslashes($master_array["$thisday"]["$cal_time"][$k]["description"]); $description = str_replace("\"", "&quot;", $description); if (strlen($event_text) > 14) { $event_text = substr("$event_text", 0, 11); $event_text = $event_text . "..."; } echo "<td colspan=\"2\" bgcolor=\"#ffffff\">&nbsp;<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\">&nbsp;</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=\"week.php?cal=$cal&getdate=$today_today\">This&nbsp;Week</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('./functions/list_icals.php'); ?></td> <td align="right" valign="middle" class="G10B"><?php echo "<a class=\"psf\" href=\"$fullpath$cal.ics\">$subscribe_lang</a>&nbsp;|&nbsp;<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"> &nbsp; </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("\"", "&quot;", $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("\"", "&quot;", $event_text2); $description = addslashes($master_array["$thisday"]["$cal_time"][$k]["description"]); $description = str_replace("\"", "&quot;", $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\">&nbsp;<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\">&nbsp;</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("\"", "&quot;", $event_text2); $description = addslashes($master_array["$thisday"]["$cal_time"][$k]["description"]); $description = str_replace("\"", "&quot;", $description); if (strlen($event_text) > 14) { $event_text = substr("$event_text", 0, 11); $event_text = $event_text . "..."; } echo "<td colspan=\"2\" bgcolor=\"#ffffff\">&nbsp;<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\">&nbsp;</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

© 2014-2024 Faster IT GmbH | imprint | privacy policy