aboutsummaryrefslogtreecommitdiffstats
path: root/rss
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2006-04-05 04:48:01 +0000
committerJim Hu <jimhu@users.sourceforge.net>2006-04-05 04:48:01 +0000
commit91f74617b9451ae7b64399d19e88da8f0f828f4e (patch)
tree82d50fcd973561919aeef8eabe00afe925e88aab /rss
parente3ce63d1406a343d7295995d3f2fbfad9e12b608 (diff)
downloadphpicalendar-91f74617b9451ae7b64399d19e88da8f0f828f4e.tar.gz
phpicalendar-91f74617b9451ae7b64399d19e88da8f0f828f4e.tar.bz2
phpicalendar-91f74617b9451ae7b64399d19e88da8f0f828f4e.zip
update rss.php and README
Diffstat (limited to 'rss')
-rw-r--r--rss/rss.php33
1 files changed, 23 insertions, 10 deletions
diff --git a/rss/rss.php b/rss/rss.php
index f37d5d9..66db472 100644
--- a/rss/rss.php
+++ b/rss/rss.php
@@ -12,8 +12,16 @@
* feeds can be specified for a number of days to or from a given date
* feeds can be specified for a range of dates
*
-* Language encoding added by dyfrin 2006/03/08 19:09:28
*********************************************************************************/
+
+/* Modified from 2.21 by dyfrin 2006/03/08 19:09:28
+ Changes:
+ -RSS changed to 2.0, encoding removed, languages converted to ISO standard for feeds
+ -RSS title changed to be set by config.inc.php. Make sure that is added to it.
+ Lines modified: 135-165, 208-223
+ Additional mods by J. Hu
+*/
+
define('BASE', '../');
require(BASE.'functions/init.inc.php');
@@ -111,8 +119,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;
}
@@ -123,18 +130,24 @@ $iso_language = array ("en", "pl", "de", "fr", "nl", "da", "it", "ja", "no", "es
$rss_language = str_replace($user_language, $iso_language, $language);
/* End language modification */
-//If client needs new feed - make the header
$rss = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"."\n";
-$rss .= '<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">'."\n";
-$rss .= '<rss version="0.91">'."\n";
-$rss .= '<channel>'."\n";
+
+/* Use 1.0 and strip encoding, use rss_language */
+$rss .= '<rdf:RDF
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:ev="http://purl.org/rss/1.0/modules/event/"
+ 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/';
+if (isset($cpath) && $cpath !='') $rss_link.="?cpath=$cpath";
+$rss .='">'."\n";
+
$rss .= '<title>'.$cal_displayname;
if ($theview !=""){$rss .= ' - '.$theview;}
$rss .= "</title>\n";
-$views = array('day','week','month','year');
-if (in_array($rssview, $views)) $default_path .= "/$rssview.php";
-$rss_link = $default_path."/";
+$rss .= '<link>'.htmlspecialchars("$default_path").'</link>'."\n";
if (isset($cpath) && $cpath !='') $rss_link.="?cpath=$cpath";
$rss .= "<link>$rss_link</link>\n";

© 2014-2024 Faster IT GmbH | imprint | privacy policy