aboutsummaryrefslogtreecommitdiffstats
path: root/functions
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 /functions
parent86d615c773ff5cddb28d24064157b94d61695ac4 (diff)
downloadphpicalendar-b2b80439dfb4078a003b0a768c634b50759ddcb0.tar.gz
phpicalendar-b2b80439dfb4078a003b0a768c634b50759ddcb0.tar.bz2
phpicalendar-b2b80439dfb4078a003b0a768c634b50759ddcb0.zip
deal with various unset variable warning situations
Diffstat (limited to 'functions')
-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
6 files changed, 13 insertions, 3 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'];

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