aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2006-11-14 07:00:51 +0000
committerJim Hu <jimhu@users.sourceforge.net>2006-11-14 07:00:51 +0000
commit03d63c81c1e6f46be4d145ea84aa2c1198bc0984 (patch)
tree1ed6b1f78e40eed2de95db380362a8306153833b
parent3854c55579f2a8987176052f15a7a1a271858c23 (diff)
downloadphpicalendar-03d63c81c1e6f46be4d145ea84aa2c1198bc0984.tar.gz
phpicalendar-03d63c81c1e6f46be4d145ea84aa2c1198bc0984.tar.bz2
phpicalendar-03d63c81c1e6f46be4d145ea84aa2c1198bc0984.zip
change date calcs to allow rss feeds to go across years
-rw-r--r--functions/ical_parser.php28
-rw-r--r--functions/init.inc.php7
-rw-r--r--rss/rss.php2
3 files changed, 20 insertions, 17 deletions
diff --git a/functions/ical_parser.php b/functions/ical_parser.php
index 56475b2..6db0351 100644
--- a/functions/ical_parser.php
+++ b/functions/ical_parser.php
@@ -24,13 +24,6 @@ while ($fillTime < $day_end) {
$fillTime = $fill_h . $fill_min;
}
-// what date we want to get data for (for day calendar)
-if (!isset($getdate) || $getdate == '') $getdate = date('Ymd');
-preg_match ("/([0-9]{4})([0-9]{2})([0-9]{2})/", $getdate, $day_array2);
-$this_day = $day_array2[3];
-$this_month = $day_array2[2];
-$this_year = $day_array2[1];
-
// reading the file if it's allowed
$parse_file = true;
if ($save_parsed_cals == 'yes') {
@@ -427,15 +420,20 @@ foreach ($cal_filelist as $cal_key=>$filename) {
}
$start_date_time = strtotime($start_date);
- $this_month_start_time = strtotime($this_year.$this_month.'01');
- if ($current_view == 'year' || ($save_parsed_cals == 'yes' && !$is_webcal)|| $current_view == 'print' && $printview == 'year') {
- $start_range_time = strtotime($this_year.'-01-01 -2 weeks');
- $end_range_time = strtotime($this_year.'-12-31 +2 weeks');
- } else {
- $start_range_time = strtotime('-1 month -2 day', $this_month_start_time);
- $end_range_time = strtotime('+2 month +2 day', $this_month_start_time);
+ if (!isset($fromdate)){
+ #this should happen if not in one of the rss views
+ $this_month_start_time = strtotime($this_year.$this_month.'01');
+ if ($current_view == 'year' || ($save_parsed_cals == 'yes' && !$is_webcal)|| $current_view == 'print' && $printview == 'year') {
+ $start_range_time = strtotime($this_year.'-01-01 -2 weeks');
+ $end_range_time = strtotime($this_year.'-12-31 +2 weeks');
+ } else {
+ $start_range_time = strtotime('-1 month -2 day', $this_month_start_time);
+ $end_range_time = strtotime('+2 month +2 day', $this_month_start_time);
+ }
+ }else{
+ $start_range_time = strtotime($fromdate);
+ $end_range_time = strtotime($todate)+60*60*24;
}
-
foreach ($rrule_array as $key => $val) {
switch($key) {
case 'FREQ':
diff --git a/functions/init.inc.php b/functions/init.inc.php
index 83b540e..883ab36 100644
--- a/functions/init.inc.php
+++ b/functions/init.inc.php
@@ -1,5 +1,5 @@
<?php
-$phpicalendar_version = '2.22';
+$phpicalendar_version = '2.23 rc1';
// uncomment when developing, comment for shipping version
//error_reporting (E_ERROR | E_WARNING | E_PARSE);
error_reporting(0);
@@ -94,6 +94,11 @@ if (!isset($getdate)) {
}
}
+preg_match ("/([0-9]{4})([0-9]{2})([0-9]{2})/", $getdate, $day_array2);
+$this_day = $day_array2[3];
+$this_month = $day_array2[2];
+$this_year = $day_array2[1];
+
if (ini_get('max_execution_time') < 60) {
@ini_set('max_execution_time', '60');
}
diff --git a/rss/rss.php b/rss/rss.php
index a480465..85b29f5 100644
--- a/rss/rss.php
+++ b/rss/rss.php
@@ -111,7 +111,7 @@ foreach ($master_array['-4'] as $calinfo){
if ($calinfo['mtime'] > $filemod) $filemod = $calinfo['mtime'];
}
$filemodtime = date("r", $filemod);
-
+/*
//send relevant headers
header ("Last-Modified: $filemodtime");
header ("ETag:\"$filemodtime\"");

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