aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2008-12-20 03:22:54 +0000
committerJim Hu <jimhu@users.sourceforge.net>2008-12-20 03:22:54 +0000
commit9b00469b471a8b159c60ecca333f0f7064ba1d27 (patch)
treee4716278c994d577c67a9bf3887c453c56b67030
parent3734188aa20c0fad1610e5de3078d7d022694bbd (diff)
downloadphpicalendar-9b00469b471a8b159c60ecca333f0f7064ba1d27.tar.gz
phpicalendar-9b00469b471a8b159c60ecca333f0f7064ba1d27.tar.bz2
phpicalendar-9b00469b471a8b159c60ecca333f0f7064ba1d27.zip
misc error warnings and notices
-rw-r--r--functions/draw_functions.php8
-rw-r--r--functions/ical_parser.php20
-rw-r--r--functions/init/date_range.php2
-rw-r--r--functions/parse/end_vevent.php5
-rw-r--r--functions/parse/recur_functions.php2
-rw-r--r--functions/template.php37
-rw-r--r--includes/event.php23
-rw-r--r--includes/todo.php10
-rw-r--r--month.php2
-rw-r--r--print.php22
-rw-r--r--rss/index.php45
-rw-r--r--rss/rss.php2
-rwxr-xr-xrss/rss1.0.php6
-rw-r--r--rss/rss2.0.php6
-rw-r--r--rss/rss_common.php6
-rw-r--r--week.php2
-rw-r--r--year.php12
17 files changed, 115 insertions, 95 deletions
diff --git a/functions/draw_functions.php b/functions/draw_functions.php
index 20938a9..cc1c363 100644
--- a/functions/draw_functions.php
+++ b/functions/draw_functions.php
@@ -5,8 +5,8 @@ function drawEventTimes ($start, $end) {
global $phpiCal_config;
$gridLength = $phpiCal_config->gridLength;
preg_match ('/([0-9]{2})([0-9]{2})/', $start, $time);
- $sta_h = $time[1];
- $sta_min = $time[2];
+ $sta_h = @$time[1];
+ $sta_min = @$time[2];
$sta_min = sprintf("%02d", floor($sta_min / $gridLength) * $gridLength);
if ($sta_min == 60) {
$sta_h = sprintf("%02d", ($sta_h + 1));
@@ -14,8 +14,8 @@ function drawEventTimes ($start, $end) {
}
preg_match ('/([0-9]{2})([0-9]{2})/', $end, $time);
- $end_h = $time[1];
- $end_min = $time[2];
+ $end_h = @$time[1];
+ $end_min = @$time[2];
$end_min = sprintf("%02d", floor($end_min / $gridLength) * $gridLength);
if ($end_min == 60) {
$end_h = sprintf("%02d", ($end_h + 1));
diff --git a/functions/ical_parser.php b/functions/ical_parser.php
index c52594d..393a076 100644
--- a/functions/ical_parser.php
+++ b/functions/ical_parser.php
@@ -135,7 +135,7 @@ foreach ($cal_filelist as $cal_key=>$filename) {
$allday_start, $allday_end, $start, $end, $the_duration,
$beginning, $start_of_vevent, $url,
$valarm_description, $start_unixtime, $end_unixtime, $display_end_tmp, $end_time_tmp1,
- $recurrence_id, $uid, $rrule, $abs_until, $until_check,
+ $recurrence_id, $uid, $rrule, $until_check,
$until, $byweek, $byweekno,
$byminute, $byhour, $bysecond
);
@@ -170,9 +170,9 @@ foreach ($cal_filelist as $cal_key=>$filename) {
include BASE."functions/parse/end_vevent.php";
break;
case 'END:VTODO':
- if ((!$vtodo_priority) && ($status == 'COMPLETED')) {
+ if (($vtodo_priority == '') && ($status == 'COMPLETED')) {
$vtodo_sort = 11;
- } elseif (!$vtodo_priority) {
+ } elseif ($vtodo_priority == '') {
$vtodo_sort = 10;
} else {
$vtodo_sort = $vtodo_priority;
@@ -209,6 +209,16 @@ foreach ($cal_filelist as $cal_key=>$filename) {
case 'BEGIN:VTODO':
$vtodo_set = TRUE;
+ $summary = '';
+ $due_date = '';
+ $due_time = '';
+ $completed_date = '';
+ $completed_time = '';
+ $vtodo_priority = '';
+ $vtodo_categories = '';
+ $status = '';
+ $class = '';
+ $description = '';
break;
case 'BEGIN:VALARM':
$valarm_set = TRUE;
@@ -287,7 +297,7 @@ foreach ($cal_filelist as $cal_key=>$filename) {
preg_match ('/([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{0,2})([0-9]{0,2})/', $exdata, $regs);
$except_dates[] = $regs[1] . $regs[2] . $regs[3];
// Added for Evolution, since they dont think they need to tell me which time to exclude.
- if (($regs[4] == '') && ($start_time != '')) {
+ if ($regs[4] == '' && isset($start_time) && $start_time != '') {
$except_times[] = $start_time;
} else {
$except_times[] = $regs[4] . $regs[5];
@@ -356,7 +366,7 @@ foreach ($cal_filelist as $cal_key=>$filename) {
} else {
$offset_tmp = $chooseOffset($recur_unixtime);
}
- $recur_unixtime = calcTime($offset_tmp, $server_offset_tmp, $recur_unixtime);
+ $recur_unixtime = calcTime($offset_tmp, @$server_offset_tmp, $recur_unixtime);
$recurrence_id['date'] = date('Ymd', $recur_unixtime);
$recurrence_id['time'] = date('Hi', $recur_unixtime);
$recurrence_d = date('Ymd', $recur_unixtime);
diff --git a/functions/init/date_range.php b/functions/init/date_range.php
index d7e4235..c74b1dc 100644
--- a/functions/init/date_range.php
+++ b/functions/init/date_range.php
@@ -3,7 +3,7 @@ if (!isset($getdate)) {
if (isset($_GET['getdate']) && ($_GET['getdate'] !== '')) {
$getdate = $_GET['getdate'];
} else {
- $getdate = date('Ymd', time() + $phpIcal_config->second_offset);
+ $getdate = date('Ymd', time() + $phpiCal_config->second_offset);
}
}
diff --git a/functions/parse/end_vevent.php b/functions/parse/end_vevent.php
index 88f94fa..e9e3064 100644
--- a/functions/parse/end_vevent.php
+++ b/functions/parse/end_vevent.php
@@ -11,6 +11,8 @@ What happens in this file:
3. Add occurrences to master_array
*/
+if (!isset($start_date)) echo "no start date for $summary<br>";
+
// Handle DURATION
if (!isset($end_unixtime)) {
if(!isset($the_duration)) $the_duration = 0;
@@ -132,7 +134,6 @@ foreach ($rrule_array as $key => $val) {
$until = str_replace('T', '', $val);
$until = str_replace('Z', '', $until);
if (strlen($until) == 8) $until = $until.'235959';
- $abs_until = $until;
ereg ('([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})', $until, $regs);
$until_unixtime = mktime($regs[4],$regs[5],@$regs[6],$regs[2],$regs[3],$regs[1]);
$recur_array[($start_date)][($hour.$minute)][$uid]['recur'][$key] = localizeDate($dateFormat_week,$until);
@@ -330,7 +331,7 @@ foreach($recur_data as $recur_data_unixtime) {
// Let's double check the until to not write past it
$until_check = $start_date_tmp.$time_tmp.'00';
- if ($abs_until > $until_check) {
+ if (@$until > $until_check) {
$master_array[$start_date_tmp][$time_tmp][$uid] = array (
'event_start' => $start_time_tmp,
'event_end' => $end_time_tmp,
diff --git a/functions/parse/recur_functions.php b/functions/parse/recur_functions.php
index daf7399..c0ea88f 100644
--- a/functions/parse/recur_functions.php
+++ b/functions/parse/recur_functions.php
@@ -57,7 +57,7 @@ function add_recur($times,$freq=''){
}
function expand_bymonth($time){
global $bymonth, $byweekno, $bymonthday, $year, $start_unixtime, $freq_type;
- if(!empty($byweekno)) return $times;
+ if(!empty($byweekno)) return $time;
if(empty($bymonth)) $bymonth = array(date("m", $start_unixtime));
$d = date("d",$start_unixtime);
if (!empty($bymonthday)) $d = 1;
diff --git a/functions/template.php b/functions/template.php
index ed73672..5338b44 100644
--- a/functions/template.php
+++ b/functions/template.php
@@ -64,32 +64,34 @@ class Page {
$parse_year = date ("Y", strtotime($getdate));
$seen_events = array();
+ $final = '';
foreach($master_array as $key => $val) {
preg_match ('/([0-9]{6})([0-9]{2})/', $key, $regs);
- if ((($regs[1] == $parse_month) && ($printview == 'month')) || (($key == $getdate) && ($printview == 'day')) || ((($key >= $week_start) && ($key <= $week_end)) && ($printview == 'week')) || ((substr($regs[1],0,4) == $parse_year) && ($printview == 'year'))) {
- $events_week++;
+ if (((@$regs[1] == $parse_month) && ($printview == 'month')) || (($key == $getdate) && ($printview == 'day')) || ((($key >= $week_start) && ($key <= $week_end)) && ($printview == 'week')) || ((substr(@$regs[1],0,4) == $parse_year) && ($printview == 'year'))) {
+ @$events_week++;
$dayofmonth = strtotime ($key);
$dayofmonth = localizeDate ($dateFormat_day, $dayofmonth);
$events_tmp = $loop_event;
$day_tmp = $loop_day;
$day_events = 0;
// Pull out each day
+ $some_events = '';
foreach ($val as $new_val) {
foreach ($new_val as $new_key2 => $new_val2) {
- if (isset($seen_events["$new_key2"]) && $new_val2['spans_day'] == 1){
+ if (isset($seen_events["$new_key2"]) && isset($new_val2['spans_day']) && $new_val2['spans_day'] == 1){
$new_val2['event_text'] .= " second instance of ".$new_key2;
continue;
}
$seen_events["$new_key2"] = 1;
$day_events++;
- if ($new_val2['event_text']) {
+ if (isset($new_val2['event_text'])) {
$event_text = stripslashes(urldecode($new_val2['event_text']));
- $location = stripslashes(urldecode($new_val2['location']));
- $description = stripslashes(urldecode($new_val2['description']));
- $event_start = $new_val2['event_start'];
- $event_end = $new_val2['event_end'];
+ $location = stripslashes(urldecode(@$new_val2['location']));
+ $description = stripslashes(urldecode(@$new_val2['description']));
+ $event_start = @$new_val2['event_start'];
+ $event_end = @$new_val2['event_end'];
if (isset($new_val2['display_end'])) $event_end = $new_val2['display_end'];
- if (!$new_val2['event_start']) {
+ if (!isset($new_val2['event_start'])) {
$event_start = $lang['l_all_day'];
$event_start2 = '';
$event_end = '';
@@ -119,7 +121,8 @@ class Page {
if ($day_events == 0) continue;
$day_tmp = str_replace('{DAYOFMONTH}', $dayofmonth, $day_tmp);
$final .= $day_tmp.$some_events;
- unset ($day_tmp, $some_events);
+ unset ($day_tmp);
+ $some_events = '';
}
}
@@ -279,11 +282,12 @@ class Page {
$loop_ad = trim($match1[1]);
$loop_begin = trim($match2[1]);
$loop_end = trim($match3[1]);
+ $weekreplace = '';
foreach ($weekarray as $get_date) {
$replace = $loop_begin;
$colspan = 'colspan="'.$nbrGridCols[$get_date].'"';
$replace = str_replace('{COLSPAN}', $colspan, $replace);
- if (is_array($master_array[$get_date]['-1']) && !empty($master_array[$get_date]['-1']) ) {
+ if (isset($master_array[$get_date]['-1']) && is_array($master_array[$get_date]['-1']) && !empty($master_array[$get_date]['-1']) ) {
foreach ($master_array[$get_date]['-1'] as $uid => $allday) {
$event_calno = $allday['calnumber'];
$event_calno = (($event_calno - 1) % $phpiCal_config->unique_colors) + 1;
@@ -350,6 +354,7 @@ class Page {
$event_length[$thisday] = array ();
$thisdate = ($thisdate + (25 * 60 * 60));
}
+ $weekdisplay = '';
foreach ($day_array as $key) {
$cal_time = $key;
preg_match('/([0-9]{2})([0-9]{2})/', $key, $regs_tmp);
@@ -467,7 +472,7 @@ class Page {
// Start drawing the event
$event_temp = $loop_event;
- $event = openevent($thisday, $cal_time, $uid, $this_time_arr[$uid], $week_events_lines, 25, 'ps');
+ $event = openevent($thisday, $cal_time, $uid, $this_time_arr[$uid], $phpiCal_config->week_events_lines, 25, 'ps');
$event_temp = str_replace('{EVENT}', $event, $event_temp);
$event_temp = str_replace('{EVENT_START}', $event_start, $event_temp);
$event_temp = str_replace('{CONFIRMED}', $confirmed, $event_temp);
@@ -738,10 +743,12 @@ class Page {
preg_match("!<\!-- switch t_event on -->(.*)<\!-- switch t_event off -->!Uis", $this->page, $match2);
$loop_t_ad = trim($match1[1]);
$loop_t_e = trim($match2[1]);
+ $replace_ad = '';
+ $replace_e = '';
$return_adtmp = '';
$return_etmp = '';
- if (is_array($master_array[$next_day]) && sizeof($master_array[$next_day]) > 0) {
+ if (isset($master_array[$next_day]) && is_array($master_array[$next_day]) && sizeof($master_array[$next_day]) > 0) {
foreach ($master_array[$next_day] as $cal_time => $event_times) {
foreach ($event_times as $uid => $val) {
$event_text = stripslashes(urldecode($val["event_text"]));
@@ -811,7 +818,7 @@ class Page {
document.todo_popup_data[$todo_popup_data_index] = todoData;
// --></script>";
- $todo .= '<a class="psf" title="'.$title.'" href="#" onclick="openTodoInfo('.$todo_popup_data_index.'); return false;">';
+ $todo .= '<a class="psf" title="'.@$title.'" href="#" onclick="openTodoInfo('.$todo_popup_data_index.'); return false;">';
$todo_popup_data_index++;
$vtodo_array = $todo;
@@ -1015,7 +1022,7 @@ class Page {
# $switch['START_DATE'] = localizeDate ($dateFormat_week_list, $u_start);
$start_date = localizeDate ($dateFormat_week_list, $u_start);
foreach ($event_times as $uid => $val) {
- if (isset($seen_events[$uid]) && $val['spans_day'] == 1) continue;
+ if (isset($seen_events[$uid]) && @$val['spans_day'] == 1) continue;
$seen_events[$uid] = 1;
$switch['CAL'] = $cal;
$switch['START_DATE'] = $start_date;
diff --git a/includes/event.php b/includes/event.php
index c8c5865..faedd21 100644
--- a/includes/event.php
+++ b/includes/event.php
@@ -1,4 +1,5 @@
<?php
+$current_view = "event";
define('BASE', '../');
#$getdate = $_POST['date'];
include_once(BASE.'functions/init.inc.php');
@@ -29,21 +30,23 @@ if ($_POST['time'] == -1) {
$event['description'] = stripslashes(utf8_decode(urldecode($event['description'])));
$event['event_text'] = stripslashes(utf8_decode(urldecode($event['event_text'])));
$event['location'] = stripslashes(utf8_decode(urldecode($event['location'])));
-
+$display ='';
if ($event['description']) $event['description'] = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]",'<a target="_new" href="\0">\0</a>',$event['description']);
-if (is_array($organizer)) {
+$organizer = '';
+if (isset($organizer) && is_array($organizer)) {
$i=0;
- $display .= $organizer_lang . ' - ';
+ $display .= $lang['l_organizer'] . ' - ';
foreach ($organizer as $val) {
$organizers .= $organizer[$i]["name"] . ', ';
$i++;
}
$organizer = substr($organizers,0,-2);
}
-if (is_array($attendee)) {
+$attendees = '';
+if (isset($attendee) && is_array($attendee)) {
$i=0;
- $display .= $attendee_lang . ' - ';
+ $display .= $lang['l_attendee'] . ' - ';
foreach ($attendee as $val) {
$attendees .= $attendee[$i]["name"] . ', ';
$i++;
@@ -51,13 +54,13 @@ if (is_array($attendee)) {
$attendee = substr($attendees,0,-2);
}
-if ($event['location']) {
+if (isset($event['location'])) {
if ($event['url'] != '') $event['location'] = '<a href="'.$event['url'].'" target="_blank">'.stripslashes($event['location']).'</a>';
}else{
$event['location'] = stripslashes($event['location']);
}
-if (!$event['location'] && $event['url']) {
+if (!isset($event['location']) && isset($event['url'])) {
$event['location'] = '<a href="'.$event['url'].'" target="_blank">'.$event['url'].'</a>';
$lang['l_location'] = 'URL';
}
@@ -79,10 +82,10 @@ switch ($event['status']){
$event['status'] = '' ;
}
-$page = new Page(BASE.'templates/'.$template.'/event.tpl');
+$page = new Page(BASE.'templates/'.$phpiCal_config->template.'/event.tpl');
$page->replace_tags(array(
- 'charset' => $charset,
+ 'charset' => $phpiCal_config->charset,
'cal' => $event['calname'],
'event_text' => $event['event_text'],
'event_times' => $event_times,
@@ -92,7 +95,7 @@ $page->replace_tags(array(
'status' => $event['status'],
'location' => stripslashes($event['location']),
'cal_title_full' => $event['calname'].' '.$lang['l_calendar'],
- 'template' => $template,
+ 'template' => $phpiCal_config->template,
'l_organizer' => $lang['l_organizer'],
'l_attendee' => $lang['l_attendee'],
'l_status' => $lang['l_status'],
diff --git a/includes/todo.php b/includes/todo.php
index 6823405..1cefcdc 100644
--- a/includes/todo.php
+++ b/includes/todo.php
@@ -4,7 +4,7 @@ define('BASE', '../');
include_once(BASE.'functions/init.inc.php');
include_once(BASE.'functions/date_functions.php');
require_once(BASE.'functions/template.php');
-
+$current_view = 'todo';
$vtodo_array = unserialize(urldecode(base64_decode($_REQUEST['todo_data'])));
// Set the variables from the array
@@ -25,9 +25,9 @@ $vtodo_text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]",'<a tar
if ((!isset($status) || $status == "COMPLETED") && isset($completed_date)) {
$status = $lang['l_completed_date'] . ' ' . $completed_date;
} elseif ($status == "COMPLETED") {
- $status = $completed_lang;
+ $status = $lang['l_completed'];
} else {
- $status = $unfinished_lang;
+ $status = $lang['l_unfinished'];
}
if ($priority >= 1 && $priority <= 4) {
@@ -43,7 +43,7 @@ if ($priority >= 1 && $priority <= 4) {
$page = new Page(BASE.'templates/'.$template.'/todo.tpl');
$page->replace_tags(array(
- 'charset' => $charset,
+ 'charset' => $phpiCal_config->charset,
'cal' => $cal_title_full,
'vtodo_text' => $vtodo_text,
'description' => $description,
@@ -52,7 +52,7 @@ $page->replace_tags(array(
'status' => $status,
'due_date' => $due_date,
'cal_title_full' => $cal_title_full,
- 'template' => $template,
+ 'template' => $phpiCal_config->template,
'l_created' => $lang['l_created'],
'l_priority' => $lang['l_priority'],
'l_status' => $lang['l_status'],
diff --git a/month.php b/month.php
index b931740..07563e1 100644
--- a/month.php
+++ b/month.php
@@ -73,7 +73,7 @@ $page->replace_tags(array(
'calendar_name' => $cal_displayname,
'display_date' => $display_date,
'rss_powered' => $rss_powered,
- 'default_path' => '',
+ 'default_path' => $phpiCal_config->default_path,
'rss_available' => '',
'rss_valid' => '',
'show_search' => $phpiCal_config->show_search,
diff --git a/print.php b/print.php
index 804bfe5..5c2a30a 100644
--- a/print.php
+++ b/print.php
@@ -3,7 +3,7 @@ define('BASE', './');
$current_view ='print';
require_once(BASE.'functions/date_functions.php');
require_once(BASE.'functions/init.inc.php');
-$start_week_time = strtotime(dateOfWeek($getdate, $week_start_day));
+$start_week_time = strtotime(dateOfWeek($getdate, $phpiCal_config->week_start_day));
$end_week_time = $start_week_time + (6 * 25 * 60 * 60);
$parse_month = date ("Ym", strtotime($getdate));
$events_week = 0;
@@ -41,7 +41,7 @@ if ($printview == 'day') {
require_once(BASE.'functions/ical_parser.php');
require_once(BASE.'functions/list_functions.php');
require_once(BASE.'functions/template.php');
-header("Content-Type: text/html; charset=$charset");
+header("Content-Type: text/html; charset=$phpiCal_config->charset");
$page = new Page(BASE.'templates/'.$template.'/print.tpl');
@@ -64,21 +64,21 @@ $page->replace_tags(array(
'current_view' => $current_view,
'printview' => $printview,
'display_date' => $display_date,
- 'sidebar_date' => $sidebar_date,
+ 'sidebar_date' => @$sidebar_date,
'rss_powered' => $rss_powered,
'rss_available' => '',
'rss_valid' => '',
'show_search' => '',
- 'next_day' => $next_day,
- 'prev_day' => $prev_day,
+ 'next_day' => @$next_day,
+ 'prev_day' => @$prev_day,
'show_goto' => '',
'is_logged_in' => '',
- 'list_icals' => $list_icals,
- 'list_years' => $list_years,
- 'list_months' => $list_months,
- 'list_weeks' => $list_weeks,
- 'list_jumps' => $list_jumps,
- 'legend' => $list_calcolors,
+ 'list_icals' => @$list_icals,
+ 'list_years' => @$list_years,
+ 'list_months' => @$list_months,
+ 'list_weeks' => @$list_weeks,
+ 'list_jumps' => @$list_jumps,
+ 'legend' => @$list_calcolors,
'style_select' => @$style_select,
'l_time' => $lang['l_time'],
'l_summary' => $lang['l_summary'],
diff --git a/rss/index.php b/rss/index.php
index 1d265db..f36ecbd 100644
--- a/rss/index.php
+++ b/rss/index.php
@@ -1,8 +1,7 @@
<?php
-/* Rewritten by J. Hu 4/2/06
-*/
-
+/* Rewritten by J. Hu 4/2/06*/
+$current_view = 'rss';
define('BASE','../');
require_once(BASE.'functions/ical_parser.php');
require_once(BASE.'functions/calendar_functions.php');
@@ -12,7 +11,7 @@ if ($phpiCal_config->enable_rss != 'yes') {
}
if (empty($default_path)) {
- if (isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'on' ) {
+ if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) {
$default_path = 'https://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['PHP_SELF'],0,strpos($_SERVER['PHP_SELF'],'/rss/'));
} else {
$default_path = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['PHP_SELF'],0,strpos($_SERVER['PHP_SELF'],'/rss/'));
@@ -40,21 +39,21 @@ foreach ($filelist as $file) {
/* Changed to show links without urlencode, but links valid urls */
$rss_list .= "<td>".$lang['l_day']."</td>";
- $rss_list .= '<td><a href='.$default_path.'/rss/rss.php?cal='.rawurlencode($file).'&amp;cpath='.$cpath.'&amp;rssview=day>'.$xml_icon.'</a> RSS 0.91</td>';
- $rss_list .= '<td><a href='.$default_path.'/rss/rss1.0.php?cal='.rawurlencode($file).'&amp;cpath='.$cpath.'&amp;rssview=day>'.$xml_icon.'</a> RSS 1.0</td>';
- $rss_list .= '<td><a href='.$default_path.'/rss/rss2.0.php?cal='.rawurlencode($file).'&amp;cpath='.$cpath.'&amp;rssview=day>'.$xml_icon.'</a> RSS 2.0</td></tr>';
+ $rss_list .= '<td><a href='.$phpiCal_config->default_path.'/rss/rss.php?cal='.rawurlencode($file).'&amp;cpath='.$cpath.'&amp;rssview=day>'.$xml_icon.'</a> RSS 0.91</td>';
+ $rss_list .= '<td><a href='.$phpiCal_config->default_path.'/rss/rss1.0.php?cal='.rawurlencode($file).'&amp;cpath='.$cpath.'&amp;rssview=day>'.$xml_icon.'</a> RSS 1.0</td>';
+ $rss_list .= '<td><a href='.$phpiCal_config->default_path.'/rss/rss2.0.php?cal='.rawurlencode($file).'&amp;cpath='.$cpath.'&amp;rssview=day>'.$xml_icon.'</a> RSS 2.0</td></tr>';
$rss_list .= "<td>".$lang['l_week']."</td>";
- $rss_list .= '<td><a href='.$default_path.'/rss/rss.php?cal='.rawurlencode($file).'&amp;cpath='.$cpath.'&amp;rssview=week>'.$xml_icon.'</a> RSS 0.91</td>';
- $rss_list .= '<td><a href='.$default_path.'/rss/rss1.0.php?cal='.rawurlencode($file).'&amp;cpath='.$cpath.'&amp;rssview=week>'.$xml_icon.'</a> RSS 1.0</td>';
- $rss_list .= '<td><a href='.$default_path.'/rss/rss2.0.php?cal='.rawurlencode($file).'&amp;cpath='.$cpath.'&amp;rssview=week>'.$xml_icon.'</a> RSS 2.0</td></tr>';
+ $rss_list .= '<td><a href='.$phpiCal_config->default_path.'/rss/rss.php?cal='.rawurlencode($file).'&amp;cpath='.$cpath.'&amp;rssview=week>'.$xml_icon.'</a> RSS 0.91</td>';
+ $rss_list .= '<td><a href='.$phpiCal_config->default_path.'/rss/rss1.0.php?cal='.rawurlencode($file).'&amp;cpath='.$cpath.'&amp;rssview=week>'.$xml_icon.'</a> RSS 1.0</td>';
+ $rss_list .= '<td><a href='.$phpiCal_config->default_path.'/rss/rss2.0.php?cal='.rawurlencode($file).'&amp;cpath='.$cpath.'&amp;rssview=week>'.$xml_icon.'</a> RSS 2.0</td></tr>';
$rss_list .= "<td>".$lang['l_month']."</td>";
- $rss_list .= '<td><a href='.$default_path.'/rss/rss.php?cal='.rawurlencode($file).'&amp;cpath='.$cpath.'&amp;rssview=month>'.$xml_icon.'</a> RSS 0.91</td>';
- $rss_list .= '<td><a href='.$default_path.'/rss/rss1.0.php?cal='.rawurlencode($file).'&amp;cpath='.$cpath.'&amp;rssview=month>'.$xml_icon.'</a> RSS 1.0</td>';
- $rss_list .= '<td><a href='.$default_path.'/rss/rss2.0.php?cal='.rawurlencode($file).'&amp;cpath='.$cpath.'&amp;rssview=month>'.$xml_icon.'</a> RSS 2.0</td></tr>';
+ $rss_list .= '<td><a href='.$phpiCal_config->default_path.'/rss/rss.php?cal='.rawurlencode($file).'&amp;cpath='.$cpath.'&amp;rssview=month>'.$xml_icon.'</a> RSS 0.91</td>';
+ $rss_list .= '<td><a href='.$phpiCal_config->default_path.'/rss/rss1.0.php?cal='.rawurlencode($file).'&amp;cpath='.$cpath.'&amp;rssview=month>'.$xml_icon.'</a> RSS 1.0</td>';
+ $rss_list .= '<td><a href='.$phpiCal_config->default_path.'/rss/rss2.0.php?cal='.rawurlencode($file).'&amp;cpath='.$cpath.'&amp;rssview=month>'.$xml_icon.'</a> RSS 2.0</td></tr>';
- $footer_check = $default_path.'/rss/rss.php?cal%3D'.rawurlencode($file.'&amp;cpath='.$cpath.'&amp;rssview='.$default_view);
+ $footer_check = $phpiCal_config->default_path.'/rss/rss.php?cal%3D'.rawurlencode($file.'&amp;cpath='.$cpath.'&amp;rssview='.$phpiCal_config->default_view);
$validrss_check = str_replace('%', '%25', $footer_check);
$rss_list .= "<tr><td>&nbsp;</td></tr>\n";
@@ -65,34 +64,34 @@ $rss_list .= "</table>\n";
/* End link modification */
-$page = new Page(BASE.'templates/'.$template.'/rss_index.tpl');
+$page = new Page(BASE.'templates/'.$phpiCal_config->template.'/rss_index.tpl');
$page->replace_files(array(
- 'header' => BASE.'templates/'.$template.'/header.tpl',
- 'footer' => BASE.'templates/'.$template.'/footer.tpl',
+ 'header' => BASE.'templates/'.$phpiCal_config->template.'/header.tpl',
+ 'footer' => BASE.'templates/'.$phpiCal_config->template.'/footer.tpl',
'event_js' => ''
));
$page->replace_tags(array(
- 'version' => $phpicalendar_version,
- 'default_path' => $default_path.'/',
- 'template' => $template,
+ 'version' => $phpiCal_config->phpicalendar_version,
+ 'default_path' => $phpiCal_config->default_path.'/',
+ 'template' => $phpiCal_config->template,
'cal' => $cal,
'getdate' => $getdate,
'calendar_name' => $calendar_name,
'display_date' => $display_date,
'current_view' => $current_view,
- 'sidebar_date' => $sidebar_date,
+ 'sidebar_date' => @$sidebar_date,
'rss_powered' => $rss_powered,
'rss_list' => $rss_list,
- 'charset' => $charset,
+ 'charset' => $phpiCal_config->charset,
'rss_available' => '',
'rssdisable' => '',
'rss_valid' => '',
'rss_docinfo' => "RSS feeds can also be set up for a specified number of days before or after a given date, or between two dates. See the <a href='http://phpicalendar.net/documentation/index.php/RSS_feeds'>documentation</a> for how to set up the URLs",
/* Replaces footer.tpl {validrss_check} with $validrss_check */
'validrss_check' => $validrss_check,
- 'show_search' => $show_search,
+ 'show_search' => $phpiCal_config->show_search,
'l_rss_info' => $lang['l_rss_info'],
'l_rss_subhead' => $lang['l_rss_subhead'],
'l_day' => $lang['l_day'],
diff --git a/rss/rss.php b/rss/rss.php
index e6942a4..918e104 100644
--- a/rss/rss.php
+++ b/rss/rss.php
@@ -20,7 +20,7 @@ function rss_top(){
if ($theview !=""){$rss .= ' - '.$theview;}
$rss .= "</title>\n";
- $rss .= '<link>'.htmlspecialchars("$default_path").'</link>'."\n";
+ $rss .= '<link>'.htmlspecialchars("$phpiCal_config->default_path").'</link>'."\n";
if (isset($cpath) && $cpath !='') $rss_link.="?cpath=$cpath";
$rss .= "<link>$rss_link</link>\n";
diff --git a/rss/rss1.0.php b/rss/rss1.0.php
index 78c5491..813b368 100755
--- a/rss/rss1.0.php
+++ b/rss/rss1.0.php
@@ -19,7 +19,7 @@ function rss_top(){
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns="http://purl.org/rss/1.0/">'."\n";
- $rss .= '<channel rdf:about="'.$default_path.'/rss/rss.php/';
+ $rss .= '<channel rdf:about="'.$phpiCal_config->default_path.'/rss/rss.php/';
if (isset($cpath) && $cpath !='') $rss_link.="?cpath=$cpath";
$rss .='">'."\n";
@@ -48,8 +48,8 @@ function rss_item(){
# $rss .= '<guid isPermaLink="false">'.$rss_link.$uid.'</guid>'."\n";
/* End guid modification */
$rss_item .= '<title>'.$rss_title.'</title>'."\n";
- $rss .= '<ev:startdate>'.date("Y-m-d\TH:i:s", $val["start_unixtime"]).'</ev:startdate>'."\n";
- $rss .= '<ev:enddate>'.date("Y-m-d\TH:i:s", $val["end_unixtime"]).'</ev:enddate>'."\n";
+ $rss .= '<ev:startdate>'.date("Y-m-d\TH:i:s", @$val["start_unixtime"]).'</ev:startdate>'."\n";
+ $rss .= '<ev:enddate>'.date("Y-m-d\TH:i:s", @$val["end_unixtime"]).'</ev:enddate>'."\n";
$rss_item .= '<link>'.$rss_link.'</link>'."\n";
$rss_item .= '<description>'.$rss_description.'</description>'."\n";
diff --git a/rss/rss2.0.php b/rss/rss2.0.php
index 05ac5ba..f80dbee 100644
--- a/rss/rss2.0.php
+++ b/rss/rss2.0.php
@@ -37,7 +37,7 @@ function rss_top(){
if ($theview !=""){$rss .= ' - '.$theview;}
$rss .= "</title>\n";
- $rss .= '<link>'.$default_path.'/rss/rss2.0.php/';
+ $rss .= '<link>'.$phpiCal_config->default_path.'/rss/rss2.0.php/';
if (isset($cpath) && $cpath !='') $rss_link.="?cpath=$cpath";
$rss .='</link>'."\n";
$rss .= '<description>'.$cal_displayname.' '.$lang['l_calendar'].' - '.$theview.'</description>'."\n";
@@ -60,8 +60,8 @@ function rss_item(){
$rss .= '<guid isPermaLink="false">'.$rss_link.'&amp;uid='.$uid.'</guid>'."\n";
/* End guid modification */
$rss .= '<title>'.$rss_title.'</title>'."\n";
- $rss .= '<ev:startdate>'.date("Y-m-d\TH:i:s", $val["start_unixtime"]).'</ev:startdate>'."\n";
- $rss .= '<ev:enddate>'.date("Y-m-d\TH:i:s", $val["end_unixtime"]).'</ev:enddate>'."\n";
+ $rss .= '<ev:startdate>'.date("Y-m-d\TH:i:s", @$val["start_unixtime"]).'</ev:startdate>'."\n";
+ $rss .= '<ev:enddate>'.date("Y-m-d\TH:i:s", @$val["end_unixtime"]).'</ev:enddate>'."\n";
$rss .= '<link>'.$rss_link.'</link>'."\n";
$rss .= '<description>'.$rss_description.'</description>'."\n";
diff --git a/rss/rss_common.php b/rss/rss_common.php
index 9a7fd4f..e36ceba 100644
--- a/rss/rss_common.php
+++ b/rss/rss_common.php
@@ -21,7 +21,7 @@
Lines modified: 135-165, 208-223
Additional mods by J. Hu
*/
-
+$current_view = 'rss';
require(BASE.'functions/init.inc.php');
if ($phpiCal_config->enable_rss != 'yes') {
@@ -122,7 +122,7 @@ header ("ETag:\"$filemodtime\"");
// checks the user agents headers to see if they kept track of our
// stuff, if so be nice and send back a 304 and exit.
-if ( ($_SERVER['HTTP_IF_MODIFIED_SINCE'] == $filemodtime) || ($_SERVER['HTTP_IF_NONE_MATCH'] == $filemodtime)){
+if ( (@$_SERVER['HTTP_IF_MODIFIED_SINCE'] == $filemodtime) || (@$_SERVER['HTTP_IF_NONE_MATCH'] == $filemodtime)){
header ("HTTP/1.1 304 Not Modified");
exit;
}
@@ -154,7 +154,7 @@ do {
foreach ($master_array[("$thisdate")] as $event_times) {
foreach ($event_times as $uid=>$val) {
#handle multiday all day events
- if(!$val["event_start"]){
+ if(!isset($val["event_start"])){
if (isset($uid_arr[$uid])){
$uid_arr[$uid] .= "+$dayofweek" ;
continue;
diff --git a/week.php b/week.php
index 4f9ddbd..80cc53d 100644
--- a/week.php
+++ b/week.php
@@ -56,7 +56,7 @@ $page->replace_files(array(
$page->replace_tags(array(
'version' => $phpiCal_config->phpicalendar_version,
'charset' => $phpiCal_config->charset,
- 'default_path' => '',
+ 'default_path' => $phpiCal_config->default_path,
'template' => $phpiCal_config->template,
'cal' => $cal,
'getdate' => $getdate,
diff --git a/year.php b/year.php
index 9bcf802..6a0a6d0 100644
--- a/year.php
+++ b/year.php
@@ -57,7 +57,7 @@ $page->replace_tags(array(
'current_view' => $current_view,
'template' => $phpiCal_config->template,
'charset' => $phpiCal_config->charset,
- 'default_path' => '',
+ 'default_path' => $phpiCal_config->default_path,
'cal' => $cal,
'getcpath' => "&cpath=$cpath",
'cpath' => $cpath,
@@ -71,10 +71,10 @@ $page->replace_tags(array(
'todo_available' => '',
'event_js' => '',
'this_year' => $this_year,
- 'next_day' => $next_day,
- 'next_week' => $next_week,
- 'prev_day' => $prev_day,
- 'prev_week' => $prev_week,
+ 'next_day' => @$next_day,
+ 'next_week' => @$next_week,
+ 'prev_day' => @$prev_day,
+ 'prev_week' => @$prev_week,
'next_year' => $next_year,
'prev_year' => $prev_year,
'show_goto' => '',
@@ -91,7 +91,7 @@ $page->replace_tags(array(
'list_weeks' => $list_weeks,
'list_jumps' => $list_jumps,
'legend' => $list_calcolors,
- 'style_select' => $style_select,
+ 'style_select' => @$style_select,
'l_goprint' => $lang['l_goprint'],
'l_preferences' => $lang['l_preferences'],
'l_calendar' => $lang['l_calendar'],

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