From ce4d8be46ccefe642883253544a4ec81bdde8cc5 Mon Sep 17 00:00:00 2001 From: jwangen Date: Fri, 4 Oct 2002 09:32:29 +0000 Subject: Fixed almost all the warning we were getting before. Basically just added isset() to all the conditions that were reporting errors. One line in ical_parser needs to be double checked, it's commented, towards the bottom. --- week.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'week.php') diff --git a/week.php b/week.php index c1f443d..e0f0e11 100644 --- a/week.php +++ b/week.php @@ -42,7 +42,7 @@ $thisdate = $start_week_time; for ($i=0;$i<7;$i++) { $thisday = date("Ymd", $thisdate); $nbrGridCols[$thisday] = 1; - if ($master_array[($thisday)]) { + if (isset($master_array[$thisday])) { foreach($master_array[($thisday)] as $ovlKey => $ovlValue) { if ($ovlKey != "-1") { foreach($ovlValue as $ovl2Value) { @@ -138,7 +138,7 @@ for ($i=0;$i<7;$i++) { $thisdate = $start_week_time; for ($i=0;$i<7;$i++) { $thisday = date("Ymd", $thisdate); - if ($master_array[($thisday)]["-1"]) { + if (isset($master_array[($thisday)]["-1"])) { $allday_events_this_week = true; break; } @@ -152,11 +152,14 @@ for ($i=0;$i<7;$i++) { do { $thisday = date("Ymd", $thisdate); echo "\n"; - if ($master_array[($thisday)]["-1"]) { + if (isset($master_array[($thisday)]["-1"])) { echo "\n"; foreach($master_array[($thisday)]["-1"] as $allday) { $all_day_text = $allday["event_text"]; + $event_text2 = urlencode(addslashes($all_day_text)); $description = $allday["description"]; + $event_start = 'All'; + $event_end = 'Day'; echo "\n"; echo "\n"; echo "\n"; @@ -204,11 +207,11 @@ for ($i=0;$i<7;$i++) { // check for eventstart - if (sizeof($master_array[($thisday)]["$cal_time"]) > 0) { + if (isset($master_array[($thisday)]["$cal_time"]) && sizeof($master_array[($thisday)]["$cal_time"]) > 0) { foreach ($master_array[($thisday)]["$cal_time"] as $eventKey => $loopevent) { $drawEvent = drawEventTimes ($loopevent["event_start"], $loopevent["event_end"]); $j = 0; - while ($event_length[$thisday][$j]) { + while (isset($event_length[$thisday][$j])) { if ($event_length[$thisday][$j]["state"] == "ended") { $event_length[$thisday][$j] = array ("length" => ($drawEvent["draw_length"] / $gridLength), "key" => $eventKey, "overlap" => $loopevent["event_overlap"],"state" => "begin"); break; @@ -305,7 +308,7 @@ for ($i=0;$i<7;$i++) { if ($emptyWidth > 0) { echo "\n"; } - while ($event_length[$thisday][(sizeof($event_length[$thisday]) - 1)]["state"] == "ended") { + while (isset($event_length[$thisday][(sizeof($event_length[$thisday]) - 1)]["state"]) && $event_length[$thisday][(sizeof($event_length[$thisday]) - 1)]["state"] == "ended") { array_pop($event_length[$thisday]); } } -- cgit v1.2.3
$all_day_text