From ff205ce74d9950105e9c4c9745462f433f81afa6 Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Mon, 29 Dec 2008 06:00:42 +0000 Subject: add all calendars to rss index --- functions/init/date_range.php | 1 + languages/english.inc.php | 1 + rss/index.php | 40 ++++++++++++++++++---------------------- rss/rss.php | 4 ++-- rss/rss_common.php | 5 +++++ templates/default/rss_index.tpl | 8 ++++---- 6 files changed, 31 insertions(+), 28 deletions(-) diff --git a/functions/init/date_range.php b/functions/init/date_range.php index 81e9190..6306c04 100644 --- a/functions/init/date_range.php +++ b/functions/init/date_range.php @@ -36,6 +36,7 @@ switch ($current_view){ case 'admin': case 'error': case 'preferences': + case 'rss_index': $mArray_begin = time(); $mArray_end = time(); break; diff --git a/languages/english.inc.php b/languages/english.inc.php index d2cfbc5..0db4bbe 100644 --- a/languages/english.inc.php +++ b/languages/english.inc.php @@ -36,6 +36,7 @@ $lang['l_today'] = 'Today'; $lang['l_this_week'] = 'This Week'; $lang['l_this_month'] = 'This Month'; $lang['l_jump'] = 'Jump to'; +$lang['l_todays'] = 'Today\'s Events'; $lang['l_tomorrows'] = 'Tomorrow\'s Events'; $lang['l_goday'] = 'Go to Today'; $lang['l_goweek'] = 'Go to This Week'; diff --git a/rss/index.php b/rss/index.php index 7f0168d..911f308 100644 --- a/rss/index.php +++ b/rss/index.php @@ -1,9 +1,9 @@ enable_rss != 'yes') { @@ -18,40 +18,36 @@ if (empty($default_path)) { } } -$current_view = "rssindex"; +$current_view = "rss_index"; $display_date = "RSS Info"; -$rss_list = "\n"; +$rss_list = "
\n"; $xml_icon ="rss icon"; - -$filelist = availableCalendars($username, $password, $phpiCal_config->ALL_CALENDARS_COMBINED); -foreach ($filelist as $file) { +$cals[] = ''; +$cal_displaynames[] = $all_cal_comb_lang; +foreach ($cals as $k=>$file) { // $cal_filename is the filename of the calendar without .ics // $cal is a urlencoded version of $cal_filename // $cal_displayname is $cal_filename with occurrences of "32" replaced with " " - - if (is_numeric(array_search($file, $cal_filelist))){ - $cal_displayname_tmp = $cal_displaynames[array_search($file,$cal_filelist)]; - }else{ - $cal_displayname_tmp = str_replace("32", " ", str_replace(".ics",'',basename($file))); - } - $rss_list .= ''; + + $rss_list .= ''; /* Changed to show links without urlencode, but links valid urls */ $rss_list .= ""; - $rss_list .= ''; - $rss_list .= ''; + $rss_list .= ''; + $rss_list .= ''; $rss_list .= ''; $rss_list .= ""; - $rss_list .= ''; - $rss_list .= ''; + $rss_list .= ''; + $rss_list .= ''; $rss_list .= ''; $rss_list .= ""; - $rss_list .= ''; - $rss_list .= ''; - $rss_list .= ''; + $rss_list .= ''; + $rss_list .= ''; + $rss_list .= ' + '; $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); @@ -78,7 +74,7 @@ $page->replace_tags(array( 'template' => $phpiCal_config->template, 'cal' => $cal, 'getdate' => $getdate, - 'calendar_name' => $calendar_name, + 'calendar_name' => $cal_displayname, 'display_date' => $display_date, 'current_view' => $current_view, 'sidebar_date' => @$sidebar_date, diff --git a/rss/rss.php b/rss/rss.php index 4100c61..c22f31e 100644 --- a/rss/rss.php +++ b/rss/rss.php @@ -11,7 +11,7 @@ $rss_version = ''."\n"; require(BASE.'rss/rss_common.php'); function rss_top(){ - global $cal_displayname, $theview, $default_path, $cpath, $lang, $rss_link, $rss_language; + global $cal_displayname, $theview, $phpiCal_config, $cpath, $lang, $rss_link, $rss_language; $rss = ""."\n"; $rss .= ''."\n"; $rss .= ''."\n"; @@ -26,7 +26,7 @@ function rss_top(){ $rss .= ''.$cal_displayname.' '.$lang['l_calendar'].' - '.$theview.''."\n"; $rss .= ''.$rss_language.''."\n"; - $rss .= 'Copyright '.date(Y).', '.htmlspecialchars ("$default_path").''."\n"; + $rss .= 'Copyright '.date("Y").', '.htmlspecialchars ("$default_path").''."\n"; return $rss; } diff --git a/rss/rss_common.php b/rss/rss_common.php index 73d704f..0e94b09 100644 --- a/rss/rss_common.php +++ b/rss/rss_common.php @@ -45,6 +45,11 @@ switch ($rssview){ $todate = date("Ymd", strtotime($getdate) + 60*60*24); $theview = $lang['l_day']; break; + case 'today': + $fromdate = date("Ymd"); + $todate = date("Ymd", strtotime('tomorrow')); + $theview = $lang['l_todays'] ; + break; case 'tomorrow': $fromdate = date("Ymd",strtotime('tomorrow')); $todate = date("Ymd", strtotime('tomorrow') + 60*60*24); diff --git a/templates/default/rss_index.tpl b/templates/default/rss_index.tpl index 7d61389..fac312f 100644 --- a/templates/default/rss_index.tpl +++ b/templates/default/rss_index.tpl @@ -13,10 +13,10 @@
'.$cal_displayname_tmp.' '. $lang['l_calendar'].'
'.$cal_displaynames[$k].' '. $lang['l_calendar'].'".$lang['l_day']."'.$xml_icon.' RSS 0.91'.$xml_icon.' RSS 1.0'.$xml_icon.' RSS 0.91 '.$xml_icon.' RSS 1.0 '.$xml_icon.' RSS 2.0
".$lang['l_week']."'.$xml_icon.' RSS 0.91'.$xml_icon.' RSS 1.0'.$xml_icon.' RSS 0.91 '.$xml_icon.' RSS 1.0 '.$xml_icon.' RSS 2.0
".$lang['l_month']."'.$xml_icon.' RSS 0.91'.$xml_icon.' RSS 1.0'.$xml_icon.' RSS 2.0
'.$xml_icon.' RSS 0.91 '.$xml_icon.' RSS 1.0 '.$xml_icon.' RSS 2.0
- - - - + + + +
{L_DAY}{L_WEEK}{L_MONTH}{L_YEAR}{L_DAY}{L_WEEK}{L_MONTH}{L_YEAR}
-- cgit v1.2.3