aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2007-10-12 06:41:33 +0000
committerJim Hu <jimhu@users.sourceforge.net>2007-10-12 06:41:33 +0000
commitb2b80439dfb4078a003b0a768c634b50759ddcb0 (patch)
tree999fce06df2493b1a0f090c2e97f72ba59602913
parent86d615c773ff5cddb28d24064157b94d61695ac4 (diff)
downloadphpicalendar-b2b80439dfb4078a003b0a768c634b50759ddcb0.tar.gz
phpicalendar-b2b80439dfb4078a003b0a768c634b50759ddcb0.tar.bz2
phpicalendar-b2b80439dfb4078a003b0a768c634b50759ddcb0.zip
deal with various unset variable warning situations
-rw-r--r--functions/calendar_functions.php1
-rw-r--r--functions/date_functions.php1
-rw-r--r--functions/ical_parser.php2
-rw-r--r--functions/init.inc.php2
-rw-r--r--functions/list_functions.php5
-rw-r--r--functions/template.php5
-rw-r--r--month.php1
-rw-r--r--print.php3
-rw-r--r--week.php1
-rw-r--r--year.php1
10 files changed, 15 insertions, 7 deletions
diff --git a/functions/calendar_functions.php b/functions/calendar_functions.php
index 23d23ec..d48713d 100644
--- a/functions/calendar_functions.php
+++ b/functions/calendar_functions.php
@@ -207,6 +207,7 @@ function getCalendarName($cal_path) {
function display_ical_list($cals, $pick=FALSE) {
global $cal, $ALL_CALENDARS_COMBINED, $current_view, $getdate, $calendar_lang, $all_cal_comb_lang, $cal_filelist, $cal_displaynames;
// Print each calendar option.
+ $return = '';
foreach ($cals as $cal_tmp) {
// Format the calendar path for display.
//
diff --git a/functions/date_functions.php b/functions/date_functions.php
index 83e51af..0e2dca4 100644
--- a/functions/date_functions.php
+++ b/functions/date_functions.php
@@ -236,6 +236,7 @@ function extractDateTime($data, $property, $field) {
// Set the values.
$unixtime = strtotime($data);
$date = date('Ymd', $unixtime);
+ $time = '';
$allday = $data;
}
diff --git a/functions/ical_parser.php b/functions/ical_parser.php
index 008ab86..6defc11 100644
--- a/functions/ical_parser.php
+++ b/functions/ical_parser.php
@@ -134,7 +134,7 @@ foreach ($cal_filelist as $cal_key=>$filename) {
$nextline = fgets($ifile, 1024);
$nextline = ereg_replace("[\r\n]", "", $nextline);
#handle continuation lines that start with either a space or a tab (MS Outlook)
- while ($nextline{0} == " " || $nextline{0} == "\t") {
+ while (isset($nextline{0}) && ($nextline{0} == " " || $nextline{0} == "\t")) {
$line = $line . substr($nextline, 1);
$nextline = fgets($ifile, 1024);
$nextline = ereg_replace("[\r\n]", "", $nextline);
diff --git a/functions/init.inc.php b/functions/init.inc.php
index b6c99ee..1a0007f 100644
--- a/functions/init.inc.php
+++ b/functions/init.inc.php
@@ -50,7 +50,7 @@ if (isset($user_template["$cpath"])){
$template = $user_template["$cpath"];
}
#set up specific webcals for a particular cpath
-if (is_array($more_webcals[$cpath])){
+if (isset($more_webcals) && is_array($more_webcals[$cpath])){
$list_webcals = array_merge($list_webcals, $more_webcals["$cpath"]);
}
include_once(BASE.'error.php');
diff --git a/functions/list_functions.php b/functions/list_functions.php
index 875a44b..7f6d817 100644
--- a/functions/list_functions.php
+++ b/functions/list_functions.php
@@ -14,6 +14,7 @@ function list_jumps() {
function list_calcolors() {
global $template, $master_array, $unique_colors;
+ $return = '';
$i = 1;
if (is_array($master_array['-3'])) {
foreach ($master_array['-3'] as $key => $val) {
@@ -30,6 +31,7 @@ function list_months() {
global $getdate, $this_year, $cal, $dateFormat_month;
$month_time = strtotime("$this_year-01-01");
$getdate_month = date("m", strtotime($getdate));
+ $return = '';
for ($i=0; $i<12; $i++) {
$monthdate = date ("Ymd", $month_time);
$month_month = date("m", $month_time);
@@ -48,6 +50,7 @@ function list_months() {
function list_years() {
global $getdate, $this_year, $cal, $num_years;
$year_time = strtotime($getdate);
+ $return = '';
for ($i=0; $i < $num_years; $i++) {
$offset = $num_years - $i;
$prev_time = strtotime("-$offset year", $year_time);
@@ -81,6 +84,7 @@ function list_weeks() {
$check_week = strtotime($getdate);
$start_week_time = strtotime(dateOfWeek(date("Ymd", strtotime("$this_year-01-01")), $week_start_day));
$end_week_time = $start_week_time + (6 * 25 * 60 * 60);
+ $return = '';
do {
$weekdate = date ("Ymd", $start_week_time);
@@ -101,6 +105,7 @@ function list_weeks() {
function list_languages() {
global $getdate, $cal, $current_view;
+ $return = '';
$dir_handle = @opendir(BASE.'languages/');
$tmp_pref_language = urlencode(ucfirst($language));
while ($file = readdir($dir_handle)) {
diff --git a/functions/template.php b/functions/template.php
index 9efd8ce..e5aab05 100644
--- a/functions/template.php
+++ b/functions/template.php
@@ -900,6 +900,8 @@ class Page {
$langtype = $daysofweek_lang;
}
+ $weekday_loop = '';
+ $middle = '';
for ($i=0; $i<7; $i++) {
$day_num = date("w", $start_day);
$weekday = $langtype[$day_num];
@@ -1006,6 +1008,7 @@ class Page {
$u_start = strtotime($m_start);
$i=0;
$seen_events = array();
+ $middle = '';
do {
if (isset($master_array[$m_start])) {
foreach ($master_array[$m_start] as $cal_time => $event_times) {
@@ -1020,7 +1023,7 @@ class Page {
$switch['CALNAME'] = $val['calname'];
if (!isset($val['event_start'])) {
$switch['START_TIME'] = $lang['l_all_day'];
- $switch['EVENT_TEXT'] = openevent($m_start, $cal_time, $uid, $val, $month_event_lines, 15, 'psf');
+ $switch['EVENT_TEXT'] = openevent($m_start, $cal_time, $uid, $val, @$month_event_lines, 15, 'psf');
$switch['DESCRIPTION'] = urldecode($val['description']);
} else {
$event_start = $val['start_unixtime'];
diff --git a/month.php b/month.php
index bd6152a..f817a0b 100644
--- a/month.php
+++ b/month.php
@@ -12,6 +12,7 @@ $today_today = date('Ymd', time() + $second_offset);
$tomorrows_date = date('Ymd', strtotime("+1 day", $unix_time));
$yesterdays_date = date('Ymd', strtotime("-1 day", $unix_time));
$sidebar_date = localizeDate($dateFormat_week_list, $unix_time);
+if (!isset($style_select)) $style_select = '';
// find out next month
$next_month_month = ($this_month+1 == '13') ? '1' : ($this_month+1);
diff --git a/print.php b/print.php
index 27230e6..3880cd2 100644
--- a/print.php
+++ b/print.php
@@ -1,9 +1,8 @@
<?php
-
define('BASE', './');
+$current_view ='print';
require_once(BASE.'functions/date_functions.php');
require_once(BASE.'functions/init.inc.php');
-$current_view ='print';
$start_week_time = strtotime(dateOfWeek($getdate, $week_start_day));
$end_week_time = $start_week_time + (6 * 25 * 60 * 60);
$parse_month = date ("Ym", strtotime($getdate));
diff --git a/week.php b/week.php
index 1709d9d..7d86fea 100644
--- a/week.php
+++ b/week.php
@@ -1,5 +1,4 @@
<?php
-
$current_view = "week";
define('BASE', './');
require_once(BASE.'functions/ical_parser.php');
diff --git a/year.php b/year.php
index 1eff2bc..d723046 100644
--- a/year.php
+++ b/year.php
@@ -1,5 +1,4 @@
<?php
-
define('BASE', './');
$current_view = 'year';
require_once(BASE.'functions/ical_parser.php');

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