Update of /cvsroot/phpicalendar/phpicalendar/rss
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4323/phpicalendar/rss
Modified Files:
rss.php
Log Message:
improve date calcs
Index: rss.php
===================================================================
RCS file: /cvsroot/phpicalendar/phpicalendar/rss/rss.php,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** rss.php 8 Feb 2006 09:15:49 -0000 1.35
--- rss.php 15 Feb 2006 08:28:17 -0000 1.36
***************
*** 42,47 ****
$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));
$theview = date('M Y',strtotime($fromdate));
break;
--- 42,46 ----
$parse_month = date ("Ym", strtotime($getdate));
$fromdate = ($parse_month *100) + 1;
! $todate = ($parse_month *100) + date("t",strtotime($getdate));
$theview = date('M Y',strtotime($fromdate));
break;
***************
*** 105,113 ****
--- 104,120 ----
// 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);
***************
*** 135,143 ****
$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";
//generate the items
! $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
--- 142,150 ----
$rss .= '<link>'.htmlspecialchars ("$default_path").'</link>'."\n";
$rss .= '<description>'.$cal_displayname.' '.$lang['l_calendar'].' - '.$theview.'</description>'."\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);
$thisdate = $fromdate; # start at beginning of date range,
# note that usage of $thisdate is different from distribution
***************
*** 178,182 ****
! $rss_title = htmlspecialchars ("$dayofweek: $event_text");
$rss_link = htmlspecialchars ("$default_path/day.php?getdate=$thisdate&cal=$cal&cpath=$cpath");
$rss_description = htmlspecialchars ("$dayofweek $event_start: $description");
--- 185,189 ----
! $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");
|