aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjwangen <jwangen>2002-10-07 23:52:47 +0000
committerjwangen <jwangen>2002-10-07 23:52:47 +0000
commit10fade306fc4136986d88b14f0afc6219a121919 (patch)
treee592586a36f64c55fc8eb4d2ea59d6f732ed2dfd
parentf65b0cfdd54177ed6c265d9f110a9a19d6700e2b (diff)
downloadphpicalendar-10fade306fc4136986d88b14f0afc6219a121919.tar.gz
phpicalendar-10fade306fc4136986d88b14f0afc6219a121919.tar.bz2
phpicalendar-10fade306fc4136986d88b14f0afc6219a121919.zip
Fixed yearly recurrence bug
-rw-r--r--config.inc.php4
-rw-r--r--functions/ical_parser.php5
2 files changed, 6 insertions, 3 deletions
diff --git a/config.inc.php b/config.inc.php
index 16ca7fc..1425cb4 100644
--- a/config.inc.php
+++ b/config.inc.php
@@ -31,8 +31,8 @@ $blacklisted_cals[] = ''; // list. This should be the exact calendar filename
$blacklisted_cals[] = ''; // the parser will *not* parse any cal that is in this list (it will not be Web accessible)
// add more lines as necessary
-$list_webcals[] = ''; // Fill in between the quotes exact URL of a calendar that you wish
-$list_webcals[] = ''; // to show up in your calendar list. You must prefix the URL with http://
+$list_webcals[] = 'webcal://ical.mac.com/ical/Movies.ics'; // Fill in between the quotes exact URL of a calendar that you wish
+$list_webcals[] = 'webcal://phpicalendar.sourceforge.net/phpicalendar-0.6/calendars/Jareds32Classes.ics'; // to show up in your calendar list. You must prefix the URL with http://
$list_webcals[] = ''; // or webcal:// and the filename should contain the .ics suffix
$list_webcals[] = ''; // $allow_webcals does *not* need to be "yes" for these to show up and work
// add more lines as necessary
diff --git a/functions/ical_parser.php b/functions/ical_parser.php
index a51818e..2e1dc3f 100644
--- a/functions/ical_parser.php
+++ b/functions/ical_parser.php
@@ -62,7 +62,7 @@ if ($parse_file) {
// Then turn it into an array after we pull every wrapped line up a level.
$contents = @file($filename);
-$contents = implode('', $contents);
+$contents = @implode('', $contents);
$contents = ereg_replace("\n ", '', $contents);
$contents = split ("\n", $contents);
if ($contents[0] != 'BEGIN:VCALENDAR') exit(error($error_invalidcal_lang, $filename));
@@ -423,6 +423,7 @@ foreach($contents as $line) {
// loop through the days on which this event happens
foreach($bymonthday as $day) {
if ($day != '0') {
+ $day = str_pad($day, 2, '0', STR_PAD_LEFT);
$next_date_time = strtotime(date('Y-m-',$next_range_time).$day);
$next_date = date('Ymd', $next_date_time);
if (($next_date_time > $start_date_time) && ($next_date_time <= $end_date_time) && ($count_to != $count) && !in_array($next_date, $except_dates)) {
@@ -490,7 +491,9 @@ foreach($contents as $line) {
if ($diff_years < $count) {
if ($diff_years % $number == 0) {
foreach($bymonth as $month) {
+ $month = str_pad($month, 2, '0', STR_PAD_LEFT);
if (is_array($byday)) {
+
$next_range_time = strtotime($this_year.$month.'01');
foreach($byday as $day) {
ereg ('([0-9]{1})([A-Z]{2})', $day, $byday_arr);

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