diff options
author | Chad Little <clittle@users.sourceforge.net> | 2004-10-25 17:16:07 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2004-10-25 17:16:07 +0000 |
commit | f1a377b8f764275248ef91fa84a79576efe84136 (patch) | |
tree | 7a910efa078f61c3d84b5aadcb262da633b6e77f /rss | |
parent | 3d5388d9730504775b56c7ef9e9776b48c1b1689 (diff) | |
download | phpicalendar-f1a377b8f764275248ef91fa84a79576efe84136.tar.gz phpicalendar-f1a377b8f764275248ef91fa84a79576efe84136.tar.bz2 phpicalendar-f1a377b8f764275248ef91fa84a79576efe84136.zip |
More error messages. Fixed default paths everywhere.
Diffstat (limited to 'rss')
-rw-r--r-- | rss/index.php | 13 | ||||
-rw-r--r-- | rss/rss.php | 11 |
2 files changed, 21 insertions, 3 deletions
diff --git a/rss/index.php b/rss/index.php index fed55ea..4357020 100644 --- a/rss/index.php +++ b/rss/index.php @@ -4,7 +4,17 @@ define('BASE','../'); require_once(BASE.'functions/ical_parser.php'); require_once(BASE.'functions/calendar_functions.php'); -$default_path = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['PHP_SELF'],0,strpos($_SERVER['PHP_SELF'],'/rss/')); +if ($enable_rss != 'yes') { + exit(error('RSS is not available for this installation.', $cal, '../')); +} + +if (empty($default_path)) { + 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/')); + } +} $current_view = "rssindex"; $display_date = "RSS Info"; @@ -44,6 +54,7 @@ $page->replace_tags(array( 'sidebar_date' => $sidebar_date, 'rss_powered' => $rss_powered, 'rss_list' => $rss_list, + 'charset' => $charset, 'rss_available' => '', 'rssdisable' => '', 'rss_valid' => '', diff --git a/rss/rss.php b/rss/rss.php index c604afa..e15c63c 100644 --- a/rss/rss.php +++ b/rss/rss.php @@ -4,10 +4,17 @@ define('BASE', '../'); include(BASE.'functions/ical_parser.php'); if ($enable_rss != 'yes') { - die ("RSS feeds are not enabled on this site."); + exit(error('RSS is not available for this installation.', $cal, '../')); +} + +if (empty($default_path)) { + 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/')); + } } -$default_path = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['PHP_SELF'],0,strpos($_SERVER['PHP_SELF'],'/rss/')); $start_week_time = strtotime(dateOfWeek($getdate, $week_start_day)); $end_week_time = $start_week_time + (6 * 25 * 60 * 60); $start_week = localizeDate($dateFormat_week, $start_week_time); |