diff options
author | Jim Hu <jimhu@users.sourceforge.net> | 2008-12-20 03:22:54 +0000 |
---|---|---|
committer | Jim Hu <jimhu@users.sourceforge.net> | 2008-12-20 03:22:54 +0000 |
commit | 9b00469b471a8b159c60ecca333f0f7064ba1d27 (patch) | |
tree | e4716278c994d577c67a9bf3887c453c56b67030 /rss | |
parent | 3734188aa20c0fad1610e5de3078d7d022694bbd (diff) | |
download | phpicalendar-9b00469b471a8b159c60ecca333f0f7064ba1d27.tar.gz phpicalendar-9b00469b471a8b159c60ecca333f0f7064ba1d27.tar.bz2 phpicalendar-9b00469b471a8b159c60ecca333f0f7064ba1d27.zip |
misc error warnings and notices
Diffstat (limited to 'rss')
-rw-r--r-- | rss/index.php | 45 | ||||
-rw-r--r-- | rss/rss.php | 2 | ||||
-rwxr-xr-x | rss/rss1.0.php | 6 | ||||
-rw-r--r-- | rss/rss2.0.php | 6 | ||||
-rw-r--r-- | rss/rss_common.php | 6 |
5 files changed, 32 insertions, 33 deletions
diff --git a/rss/index.php b/rss/index.php index 1d265db..f36ecbd 100644 --- a/rss/index.php +++ b/rss/index.php @@ -1,8 +1,7 @@ <?php -/* Rewritten by J. Hu 4/2/06 -*/ - +/* Rewritten by J. Hu 4/2/06*/ +$current_view = 'rss'; define('BASE','../'); require_once(BASE.'functions/ical_parser.php'); require_once(BASE.'functions/calendar_functions.php'); @@ -12,7 +11,7 @@ if ($phpiCal_config->enable_rss != 'yes') { } if (empty($default_path)) { - if (isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'on' ) { + if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) { $default_path = 'https://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['PHP_SELF'],0,strpos($_SERVER['PHP_SELF'],'/rss/')); } else { $default_path = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['PHP_SELF'],0,strpos($_SERVER['PHP_SELF'],'/rss/')); @@ -40,21 +39,21 @@ foreach ($filelist as $file) { /* Changed to show links without urlencode, but links valid urls */ $rss_list .= "<td>".$lang['l_day']."</td>"; - $rss_list .= '<td><a href='.$default_path.'/rss/rss.php?cal='.rawurlencode($file).'&cpath='.$cpath.'&rssview=day>'.$xml_icon.'</a> RSS 0.91</td>'; - $rss_list .= '<td><a href='.$default_path.'/rss/rss1.0.php?cal='.rawurlencode($file).'&cpath='.$cpath.'&rssview=day>'.$xml_icon.'</a> RSS 1.0</td>'; - $rss_list .= '<td><a href='.$default_path.'/rss/rss2.0.php?cal='.rawurlencode($file).'&cpath='.$cpath.'&rssview=day>'.$xml_icon.'</a> RSS 2.0</td></tr>'; + $rss_list .= '<td><a href='.$phpiCal_config->default_path.'/rss/rss.php?cal='.rawurlencode($file).'&cpath='.$cpath.'&rssview=day>'.$xml_icon.'</a> RSS 0.91</td>'; + $rss_list .= '<td><a href='.$phpiCal_config->default_path.'/rss/rss1.0.php?cal='.rawurlencode($file).'&cpath='.$cpath.'&rssview=day>'.$xml_icon.'</a> RSS 1.0</td>'; + $rss_list .= '<td><a href='.$phpiCal_config->default_path.'/rss/rss2.0.php?cal='.rawurlencode($file).'&cpath='.$cpath.'&rssview=day>'.$xml_icon.'</a> RSS 2.0</td></tr>'; $rss_list .= "<td>".$lang['l_week']."</td>"; - $rss_list .= '<td><a href='.$default_path.'/rss/rss.php?cal='.rawurlencode($file).'&cpath='.$cpath.'&rssview=week>'.$xml_icon.'</a> RSS 0.91</td>'; - $rss_list .= '<td><a href='.$default_path.'/rss/rss1.0.php?cal='.rawurlencode($file).'&cpath='.$cpath.'&rssview=week>'.$xml_icon.'</a> RSS 1.0</td>'; - $rss_list .= '<td><a href='.$default_path.'/rss/rss2.0.php?cal='.rawurlencode($file).'&cpath='.$cpath.'&rssview=week>'.$xml_icon.'</a> RSS 2.0</td></tr>'; + $rss_list .= '<td><a href='.$phpiCal_config->default_path.'/rss/rss.php?cal='.rawurlencode($file).'&cpath='.$cpath.'&rssview=week>'.$xml_icon.'</a> RSS 0.91</td>'; + $rss_list .= '<td><a href='.$phpiCal_config->default_path.'/rss/rss1.0.php?cal='.rawurlencode($file).'&cpath='.$cpath.'&rssview=week>'.$xml_icon.'</a> RSS 1.0</td>'; + $rss_list .= '<td><a href='.$phpiCal_config->default_path.'/rss/rss2.0.php?cal='.rawurlencode($file).'&cpath='.$cpath.'&rssview=week>'.$xml_icon.'</a> RSS 2.0</td></tr>'; $rss_list .= "<td>".$lang['l_month']."</td>"; - $rss_list .= '<td><a href='.$default_path.'/rss/rss.php?cal='.rawurlencode($file).'&cpath='.$cpath.'&rssview=month>'.$xml_icon.'</a> RSS 0.91</td>'; - $rss_list .= '<td><a href='.$default_path.'/rss/rss1.0.php?cal='.rawurlencode($file).'&cpath='.$cpath.'&rssview=month>'.$xml_icon.'</a> RSS 1.0</td>'; - $rss_list .= '<td><a href='.$default_path.'/rss/rss2.0.php?cal='.rawurlencode($file).'&cpath='.$cpath.'&rssview=month>'.$xml_icon.'</a> RSS 2.0</td></tr>'; + $rss_list .= '<td><a href='.$phpiCal_config->default_path.'/rss/rss.php?cal='.rawurlencode($file).'&cpath='.$cpath.'&rssview=month>'.$xml_icon.'</a> RSS 0.91</td>'; + $rss_list .= '<td><a href='.$phpiCal_config->default_path.'/rss/rss1.0.php?cal='.rawurlencode($file).'&cpath='.$cpath.'&rssview=month>'.$xml_icon.'</a> RSS 1.0</td>'; + $rss_list .= '<td><a href='.$phpiCal_config->default_path.'/rss/rss2.0.php?cal='.rawurlencode($file).'&cpath='.$cpath.'&rssview=month>'.$xml_icon.'</a> RSS 2.0</td></tr>'; - $footer_check = $default_path.'/rss/rss.php?cal%3D'.rawurlencode($file.'&cpath='.$cpath.'&rssview='.$default_view); + $footer_check = $phpiCal_config->default_path.'/rss/rss.php?cal%3D'.rawurlencode($file.'&cpath='.$cpath.'&rssview='.$phpiCal_config->default_view); $validrss_check = str_replace('%', '%25', $footer_check); $rss_list .= "<tr><td> </td></tr>\n"; @@ -65,34 +64,34 @@ $rss_list .= "</table>\n"; /* End link modification */ -$page = new Page(BASE.'templates/'.$template.'/rss_index.tpl'); +$page = new Page(BASE.'templates/'.$phpiCal_config->template.'/rss_index.tpl'); $page->replace_files(array( - 'header' => BASE.'templates/'.$template.'/header.tpl', - 'footer' => BASE.'templates/'.$template.'/footer.tpl', + 'header' => BASE.'templates/'.$phpiCal_config->template.'/header.tpl', + 'footer' => BASE.'templates/'.$phpiCal_config->template.'/footer.tpl', 'event_js' => '' )); $page->replace_tags(array( - 'version' => $phpicalendar_version, - 'default_path' => $default_path.'/', - 'template' => $template, + 'version' => $phpiCal_config->phpicalendar_version, + 'default_path' => $phpiCal_config->default_path.'/', + 'template' => $phpiCal_config->template, 'cal' => $cal, 'getdate' => $getdate, 'calendar_name' => $calendar_name, 'display_date' => $display_date, 'current_view' => $current_view, - 'sidebar_date' => $sidebar_date, + 'sidebar_date' => @$sidebar_date, 'rss_powered' => $rss_powered, 'rss_list' => $rss_list, - 'charset' => $charset, + 'charset' => $phpiCal_config->charset, 'rss_available' => '', 'rssdisable' => '', 'rss_valid' => '', 'rss_docinfo' => "RSS feeds can also be set up for a specified number of days before or after a given date, or between two dates. See the <a href='http://phpicalendar.net/documentation/index.php/RSS_feeds'>documentation</a> for how to set up the URLs", /* Replaces footer.tpl {validrss_check} with $validrss_check */ 'validrss_check' => $validrss_check, - 'show_search' => $show_search, + 'show_search' => $phpiCal_config->show_search, 'l_rss_info' => $lang['l_rss_info'], 'l_rss_subhead' => $lang['l_rss_subhead'], 'l_day' => $lang['l_day'], diff --git a/rss/rss.php b/rss/rss.php index e6942a4..918e104 100644 --- a/rss/rss.php +++ b/rss/rss.php @@ -20,7 +20,7 @@ function rss_top(){ if ($theview !=""){$rss .= ' - '.$theview;} $rss .= "</title>\n"; - $rss .= '<link>'.htmlspecialchars("$default_path").'</link>'."\n"; + $rss .= '<link>'.htmlspecialchars("$phpiCal_config->default_path").'</link>'."\n"; if (isset($cpath) && $cpath !='') $rss_link.="?cpath=$cpath"; $rss .= "<link>$rss_link</link>\n"; diff --git a/rss/rss1.0.php b/rss/rss1.0.php index 78c5491..813b368 100755 --- a/rss/rss1.0.php +++ b/rss/rss1.0.php @@ -19,7 +19,7 @@ function rss_top(){ xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns="http://purl.org/rss/1.0/">'."\n";
- $rss .= '<channel rdf:about="'.$default_path.'/rss/rss.php/';
+ $rss .= '<channel rdf:about="'.$phpiCal_config->default_path.'/rss/rss.php/';
if (isset($cpath) && $cpath !='') $rss_link.="?cpath=$cpath";
$rss .='">'."\n";
@@ -48,8 +48,8 @@ function rss_item(){ # $rss .= '<guid isPermaLink="false">'.$rss_link.$uid.'</guid>'."\n";
/* End guid modification */
$rss_item .= '<title>'.$rss_title.'</title>'."\n";
- $rss .= '<ev:startdate>'.date("Y-m-d\TH:i:s", $val["start_unixtime"]).'</ev:startdate>'."\n";
- $rss .= '<ev:enddate>'.date("Y-m-d\TH:i:s", $val["end_unixtime"]).'</ev:enddate>'."\n";
+ $rss .= '<ev:startdate>'.date("Y-m-d\TH:i:s", @$val["start_unixtime"]).'</ev:startdate>'."\n";
+ $rss .= '<ev:enddate>'.date("Y-m-d\TH:i:s", @$val["end_unixtime"]).'</ev:enddate>'."\n";
$rss_item .= '<link>'.$rss_link.'</link>'."\n";
$rss_item .= '<description>'.$rss_description.'</description>'."\n";
diff --git a/rss/rss2.0.php b/rss/rss2.0.php index 05ac5ba..f80dbee 100644 --- a/rss/rss2.0.php +++ b/rss/rss2.0.php @@ -37,7 +37,7 @@ function rss_top(){ if ($theview !=""){$rss .= ' - '.$theview;}
$rss .= "</title>\n";
- $rss .= '<link>'.$default_path.'/rss/rss2.0.php/';
+ $rss .= '<link>'.$phpiCal_config->default_path.'/rss/rss2.0.php/';
if (isset($cpath) && $cpath !='') $rss_link.="?cpath=$cpath";
$rss .='</link>'."\n";
$rss .= '<description>'.$cal_displayname.' '.$lang['l_calendar'].' - '.$theview.'</description>'."\n";
@@ -60,8 +60,8 @@ function rss_item(){ $rss .= '<guid isPermaLink="false">'.$rss_link.'&uid='.$uid.'</guid>'."\n";
/* End guid modification */
$rss .= '<title>'.$rss_title.'</title>'."\n";
- $rss .= '<ev:startdate>'.date("Y-m-d\TH:i:s", $val["start_unixtime"]).'</ev:startdate>'."\n";
- $rss .= '<ev:enddate>'.date("Y-m-d\TH:i:s", $val["end_unixtime"]).'</ev:enddate>'."\n";
+ $rss .= '<ev:startdate>'.date("Y-m-d\TH:i:s", @$val["start_unixtime"]).'</ev:startdate>'."\n";
+ $rss .= '<ev:enddate>'.date("Y-m-d\TH:i:s", @$val["end_unixtime"]).'</ev:enddate>'."\n";
$rss .= '<link>'.$rss_link.'</link>'."\n";
$rss .= '<description>'.$rss_description.'</description>'."\n";
diff --git a/rss/rss_common.php b/rss/rss_common.php index 9a7fd4f..e36ceba 100644 --- a/rss/rss_common.php +++ b/rss/rss_common.php @@ -21,7 +21,7 @@ Lines modified: 135-165, 208-223 Additional mods by J. Hu */ - +$current_view = 'rss'; require(BASE.'functions/init.inc.php'); if ($phpiCal_config->enable_rss != 'yes') { @@ -122,7 +122,7 @@ header ("ETag:\"$filemodtime\""); // checks the user agents headers to see if they kept track of our // stuff, if so be nice and send back a 304 and exit. -if ( ($_SERVER['HTTP_IF_MODIFIED_SINCE'] == $filemodtime) || ($_SERVER['HTTP_IF_NONE_MATCH'] == $filemodtime)){ +if ( (@$_SERVER['HTTP_IF_MODIFIED_SINCE'] == $filemodtime) || (@$_SERVER['HTTP_IF_NONE_MATCH'] == $filemodtime)){ header ("HTTP/1.1 304 Not Modified"); exit; } @@ -154,7 +154,7 @@ do { foreach ($master_array[("$thisdate")] as $event_times) { foreach ($event_times as $uid=>$val) { #handle multiday all day events - if(!$val["event_start"]){ + if(!isset($val["event_start"])){ if (isset($uid_arr[$uid])){ $uid_arr[$uid] .= "+$dayofweek" ; continue; |