From: <ji...@us...> - 2005-11-16 01:17:46
|
Update of /cvsroot/phpicalendar/phpicalendar/rss In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11974/phpicalendar/rss Modified Files: rss.php Log Message: bug fixes and additions to rss.php. Fixed problems with data calculations and added rssview=year Index: rss.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/rss/rss.php,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** rss.php 12 Nov 2005 07:57:37 -0000 1.30 --- rss.php 16 Nov 2005 01:17:34 -0000 1.31 *************** *** 8,13 **** --- 8,19 ---- * PHP note: #@ is error control operator to suppress execution halt on error * - used below to deal with undef? + * + * using rssview, RSS feeds can be specified to return events for a given day, week, month, or year + * feeds can be specified for a number of days to or from a given date + * feeds can be specified for a range of dates + * *********************************************************************************/ define('BASE', '../'); + include(BASE.'functions/init.inc.php'); include_once(BASE.'functions/date_functions.php'); *************** *** 40,43 **** --- 46,59 ---- $theview = date('M Y',strtotime($fromdate)); break; + case 'year': + if(isset($_GET['year'])){ + $theyear = $_GET['year']; + }else{ + $theyear = date('Y'); + } + $fromdate = ($theyear*10000)+101; + $todate = date("Ymd", strtotime($fromdate) + 365*60*60*24); + $theview = $theyear; + break; case 'daysfrom': $fromdate = $getdate; *************** *** 53,57 **** --- 69,77 ---- break; case 'range': + if(isset($_GET['from'])){ $fromdate = $_GET['from']; + }else{ + $fromdate = $getdate; + } $todate = $_GET['to']; $theview = date('n/d/Y',strtotime($fromdate)).'-'.date('n/d/Y',strtotime($todate)); *************** *** 132,135 **** --- 152,156 ---- foreach ($master_array[("$thisdate")] as $event_times) { foreach ($event_times as $uid=>$val) { + #handle multiday all day events if(!$val["event_start"]){ if (isset($uid_arr[$uid])){ *************** *** 165,170 **** $rss .= '<event_start>'.$event_start.'</event_start>'."\n"; $rss .= '<title>'.$rss_title.'</title>'."\n"; ! /* ! $rss .= '<event_start>'.$event_start.'</event_start>'."\n"; $rss .= '<seminardate>'.$dayofweek.'</seminardate>'."\n"; $rss .= '<seminarspeaker>'.$event_text.'</seminarspeaker>'."\n"; --- 186,190 ---- $rss .= '<event_start>'.$event_start.'</event_start>'."\n"; $rss .= '<title>'.$rss_title.'</title>'."\n"; ! /* custom stuff for Jim Hu's RSS feeds. Deprecated $rss .= '<seminardate>'.$dayofweek.'</seminardate>'."\n"; $rss .= '<seminarspeaker>'.$event_text.'</seminarspeaker>'."\n"; *************** *** 174,183 **** $rss .= '<organizer>'.$val['organizer'].'</organizer>'."\n"; $rss .= '<status>'.$val['status'].'</status>'."\n"; - $location = str_replace('&','&',$val['location']); - $location = str_replace('&amp;','&',$location); - $rss .= '<location>'.$location.'</location>'; */ $rss .= '<link>'.$rss_link.'</link>'."\n"; $rss .= '<description>'.$rss_description.'</description>'."\n"; $rss .= '</item>'."\n"; $events_count++; --- 194,203 ---- $rss .= '<organizer>'.$val['organizer'].'</organizer>'."\n"; $rss .= '<status>'.$val['status'].'</status>'."\n"; */ $rss .= '<link>'.$rss_link.'</link>'."\n"; $rss .= '<description>'.$rss_description.'</description>'."\n"; + $location = str_replace('&','&',$val['location']); + $location = str_replace('&amp;','&',$location); + $rss .= '<location>'.$location.'</location>'; $rss .= '</item>'."\n"; $events_count++; |