aboutsummaryrefslogtreecommitdiffstats
path: root/rss
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2006-02-15 08:28:17 +0000
committerJim Hu <jimhu@users.sourceforge.net>2006-02-15 08:28:17 +0000
commit57eb99d1980353cdc4449825e2fcdc171e8caa1b (patch)
tree5c85769875acac09cdcd4c8e3c4ccbca8ff87e42 /rss
parentec888750ef1d834eb5feba1d982ec04dee3c58ea (diff)
downloadphpicalendar-57eb99d1980353cdc4449825e2fcdc171e8caa1b.tar.gz
phpicalendar-57eb99d1980353cdc4449825e2fcdc171e8caa1b.tar.bz2
phpicalendar-57eb99d1980353cdc4449825e2fcdc171e8caa1b.zip
improve date calcs
Diffstat (limited to 'rss')
-rw-r--r--rss/rss.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/rss/rss.php b/rss/rss.php
index 1c18ce5..059ab92 100644
--- a/rss/rss.php
+++ b/rss/rss.php
@@ -41,8 +41,7 @@ switch ($rssview){
case 'month':
$parse_month = date ("Ym", strtotime($getdate));
$fromdate = ($parse_month *100) + 1;
- $nextmonth = ($parse_month +1) * 100; #should give the 0th day of following month
- $todate = date('Ymd',strtotime($nextmonth+1));
+ $todate = ($parse_month *100) + date("t",strtotime($getdate));
$theview = date('M Y',strtotime($fromdate));
break;
case 'year':
@@ -104,11 +103,19 @@ if ($cal == $ALL_CALENDARS_COMBINED) {
$events_count = 0;
// calculate a value for Last Modified and ETag
+$filemod = time(); #default to now in case filemtime can't find the mod date
+$cal = str_replace("+"," ",$cal);
+$calendar_path = str_replace("+"," ",$calendar_path);
+$filemod = time(); #default to now in case filemtime can't find the mod date
+$cal = str_replace("+"," ",$cal);
+$calendar_path = str_replace("+"," ",$calendar_path);
if ($cal == $ALL_CALENDARS_COMBINED) {
$filemod = filemtime("$calendar_path");
}else{
+ if (is_file("$calendar_path/$cal.ics")){
$filemod = filemtime("$calendar_path/$cal.ics");
}
+}
$filemodtime = date("r", $filemod);
//send relevant headers
@@ -134,11 +141,11 @@ if ($theview !=""){$rss .= ' - '.$theview;}
$rss .= "</title>\n";
$rss .= '<link>'.htmlspecialchars ("$default_path").'</link>'."\n";
$rss .= '<description>'.$cal_displayname.' '.$lang['l_calendar'].' - '.$theview.'</description>'."\n";
-$rss .= '<language>'.$rss_language.'</language>'."\n";
-$rss .= '<copyright>Copyright '.date(Y).', '.htmlspecialchars ("$default_path").'</copyright>'."\n";
+$rss .= '<language>'.$language.'</language>'."\n";
+$rss .= '<copyright>Copyright '.date('Y').', '.htmlspecialchars ("$default_path").'</copyright>'."\n";
//generate the items
-$numdays = round((strtotime($todate) - strtotime($fromdate))/(60*60*24)-1);
+$numdays = round((strtotime($todate) - strtotime($fromdate))/(60*60*24)+1);
$thisdate = $fromdate; # start at beginning of date range,
# note that usage of $thisdate is different from distribution
# I use it as a date, dist uses it as a time
@@ -177,7 +184,7 @@ $uid_arr = array();
$description = str_replace('&amp;amp;','&amp;',$description);
- $rss_title = htmlspecialchars ("$dayofweek: $event_text");
+ $rss_title = urldecode ("$dayofweek: $event_text");
$rss_link = htmlspecialchars ("$default_path/day.php?getdate=$thisdate&cal=$cal&cpath=$cpath");
$rss_description = htmlspecialchars ("$dayofweek $event_start: $description");

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