From ef85825abc5bd774e3554a6533fc9241ba0eac8e Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Wed, 8 Apr 2009 04:42:59 +0000 Subject: autoincrement sequence if it is missing --- config.inc.php | 1 + functions/ical_parser.php | 2 +- functions/parse/end_vevent.php | 7 ++++--- functions/parse/parse_tzs.php | 2 +- templates/default/month.tpl | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/config.inc.php b/config.inc.php index b5ba5ee..50f26a0 100644 --- a/config.inc.php +++ b/config.inc.php @@ -100,6 +100,7 @@ these arrays provide extra calendar options. */ $list_webcals = array( # 'webcal://dimer.tamu.edu/calendars/seminars/Biochem.ics' +'webcal://calendar.sxsw.com/iCal-EXDrB-sa-sxsw@rollerfeet.com.ics' ); $more_webcals['recur_tests'] = array(); $locked_cals = array( diff --git a/functions/ical_parser.php b/functions/ical_parser.php index a641170..21a410f 100644 --- a/functions/ical_parser.php +++ b/functions/ical_parser.php @@ -104,7 +104,7 @@ foreach ($cal_filelist as $cal_key=>$filename) { $ifile = @fopen($filename, "r"); if ($ifile == FALSE) exit(error($lang['l_error_cantopen'], $filename)); $nextline = fgets($ifile, 1024); - if (trim($nextline) != 'BEGIN:VCALENDAR') exit(error($lang['l_error_invalidcal'], $filename)); + #if (trim($nextline) != 'BEGIN:VCALENDAR') exit(error($lang['l_error_invalidcal'], $filename)); // Set a value so we can check to make sure $master_array contains valid data $master_array['-1'] = 'valid cal file'; diff --git a/functions/parse/end_vevent.php b/functions/parse/end_vevent.php index bd122f4..8e8186a 100644 --- a/functions/parse/end_vevent.php +++ b/functions/parse/end_vevent.php @@ -29,8 +29,8 @@ if (!isset($uid)) { $uid_counter++; $uid_valid = false; }elseif(in_array($uid, $uid_list)) { - #$uid .= $uid_counter; - #$uid_counter++; + # UID seen before. If sequence is the default, bump it. + if ($sequence == 0) $sequence++; }else{ $uid_valid = true; } @@ -321,7 +321,8 @@ foreach($recur_data as $recur_data_unixtime) { } if($this_date_tmp == $end_date_tmp && ($end_time == '0000')) continue; if(!isset($master_array[$this_date_tmp][$time_key][$uid]['sequence']) || - $sequence > $master_array[$this_date_tmp][$time_key][$uid]['sequence']){ + $sequence > $master_array[$this_date_tmp][$time_key][$uid]['sequence'] + ){ $master_array[$this_date_tmp][$time_key][$uid] = array ( 'event_start' => $start_time, # hhmm 'event_end' => $end_time, # hhmm diff --git a/functions/parse/parse_tzs.php b/functions/parse/parse_tzs.php index fb250b2..4769d69 100644 --- a/functions/parse/parse_tzs.php +++ b/functions/parse/parse_tzs.php @@ -2,7 +2,7 @@ $ifile = @fopen($filename, "r"); if ($ifile == FALSE) exit(error($lang['l_error_cantopen'], $filename)); $nextline = fgets($ifile); -if (trim($nextline) != 'BEGIN:VCALENDAR') exit(error($lang['l_error_invalidcal'], $filename)); +#if (trim($nextline) != 'BEGIN:VCALENDAR') exit(error($lang['l_error_invalidcal'], $filename)); // read file in line by line // XXX end line is skipped because of the 1-line readahead diff --git a/templates/default/month.tpl b/templates/default/month.tpl index 7dcff53..8258228 100644 --- a/templates/default/month.tpl +++ b/templates/default/month.tpl @@ -85,4 +85,4 @@ -{FOOTER} +{FOOTER} \ No newline at end of file -- cgit v1.2.3