[Scummvm-cvs-logs] SF.net SVN: scummvm: [24189] web/trunk

sev at users.sourceforge.net sev at users.sourceforge.net
Sun Oct 8 09:26:28 CEST 2006


Revision: 24189
          http://svn.sourceforge.net/scummvm/?rev=24189&view=rev
Author:   sev
Date:     2006-10-08 00:25:42 -0700 (Sun, 08 Oct 2006)

Log Message:
-----------
Patch from Pierre-Henri Lavigne. Fix the ATOM bug and upgrade to a clean, 
stable and valid RSS 2.0 and ATOM 1.0 Feed. Tested with Firefox, Thunderbird 
and Akregator.

Regards to the RSS 2.0 specification, an email is required for the 
author field. So nospam at scummvm.org is used by default.

Modified Paths:
--------------
    web/trunk/feed-atom.php
    web/trunk/feed-rss20.php

Modified: web/trunk/feed-atom.php
===================================================================
--- web/trunk/feed-atom.php	2006-10-08 01:46:38 UTC (rev 24188)
+++ web/trunk/feed-atom.php	2006-10-08 07:25:42 UTC (rev 24189)
@@ -1,21 +1,25 @@
 <?php
 $file_root = ".";
 
-// load libraries
-require($file_root."/include/"."incl.php");
+// load specific libraries
+require($file_root."/include/"."util.php");
 require($file_root."/include/"."news.php");
 
-header("Content-type: application/atom+xml");
+header("Content-Type: text/xml; charset=UTF-8");
+echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
+
+$uri = $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
+
 ?>
-<feed xml:lang="en" xml:base="http://www.scummvm.org/" xmlns="http://www.w3.org/2005/Atom">
-    <id>tag:scummvm.org,2006:news/atom</id>
-    <title>ScummVM news</title>
-    <link rel="self" href="http://<?php echo $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];?>">
-    <tagline mode="escaped" type="text/html">ScummVM is a cross-platform interpreter for several point-and-click adventure engines. This includes all SCUMM-based adventures by LucasArts, Simon the Sorcerer 1&2 by AdventureSoft, Beneath a Steel Sky and Broken Sword 1&2 by Revolution, and many more.</tagline>
-    <author>
-        <name>ScummVM team</name>
-        <uri>http://www.scummvm.org/</uri>
-    </author>
+<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom">
+	<id>http://<?php echo $uri; ?></id>
+	<link rel="self" href="http://<?php echo $uri; ?>" />
+	<title type="text">ScummVM news</title>
+	<subtitle type="html"><![CDATA[ScummVM is a cross-platform interpreter for several point-and-click adventure engines. This includes all SCUMM-based adventures by LucasArts, Simon the Sorcerer 1&2 by AdventureSoft, Beneath a Steel Sky and Broken Sword 1&2 by Revolution, and many more.]]></subtitle>
+	<author>
+		<name>ScummVM team</name>
+		<uri>http://www.scummvm.org/</uri>
+	</author>
 
 <?php
 
@@ -28,14 +32,18 @@
 
 // Display news item
 while (list($key,$item) = each($news)) {
-  echo '<entry>'.
-	 '<title mode="escaped">'.htmlentities($item["title"]).'</title>'.
-     '<id>tag:scummvm.org,2006:news/atom/'.$item["date"].'</id>'.
-	 '<link rel="alternate" href="http://www.scummvm.org/?shownews=archive#'.date("Y-m-d", $item["date"]).'">'.
-	 '<content mode="escaped" type="text/html">'.htmlentities($item["body"]).'</content>'.
-	 '<published>'.date("Y-m-d\Th:i:s\Z", $item["date"] - date("Z", $item["date"])).'</published>'.
-     '<author><name>'.$item["author"].'</name></author>'.
-     '</entry>';
+  $news_date = date("Y-m-d\Th:i:s\Z", $item["date"] - date("Z", $item["date"]));
+  $news_url = "http://www.scummvm.org/?shownews=archive#".date("Y-m-d", $item["date"]);
+  echo "\t<entry xml:lang=\"en\">\n";
+  echo "\t\t<id>".$news_url."</id>\n";
+  echo "\t\t<link rel=\"alternate\" href=\"".$news_url."\" />";
+  echo "\t\t<updated>".$news_date."</updated>\n";
+  echo "\t\t<published>".$news_date."</published>\n";
+  echo "\t\t<title type=\"html\"><![CDATA[".$item["title"]."]]></title>\n";
+
+  echo "\t\t<content type=\"html\" xml:base=\"".$news_url."\"><![CDATA[\n\t\t".$item["body"]."\n\t\t]]></content>\n";
+  echo "\t\t<author>\n\t\t\t<name>".$item["author"]."</name>\n\t\t\t<email>nospam at scummvm.org</email>\n\t\t</author>\n";
+  echo "\t</entry>\n";
 } // end of news loop
 ?>
 </feed>

Modified: web/trunk/feed-rss20.php
===================================================================
--- web/trunk/feed-rss20.php	2006-10-08 01:46:38 UTC (rev 24188)
+++ web/trunk/feed-rss20.php	2006-10-08 07:25:42 UTC (rev 24189)
@@ -1,13 +1,14 @@
 <?php
 $file_root = ".";
 
-// load libraries
-require($file_root."/include/"."incl.php");
+// load specific libraries
+require($file_root."/include/"."util.php");
 require($file_root."/include/"."news.php");
 
-header("Content-type: text/xml");
+header("Content-Type: text/xml; charset=UTF-8");
+echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
 ?>
-<rss version="2.0">
+<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
     <channel>
         <title>ScummVM news</title>
         <link>http://www.scummvm.org/</link>
@@ -21,12 +22,15 @@
 
 // Display news items
 while (list($key,$item) = each($news)) {
-  echo '<item>'.
-	 '<title>'.htmlentities($item["title"]).'</title>'.
-	 '<link>http://www.scummvm.org/?shownews=archive#'.date("Y-m-d", $item["date"]).'</link>'.
-	 '<description>'.htmlentities($item["body"]).'</description>'.
-	 '<pubDate>'.date("r", $item["date"]).'</pubDate>'.
-       '</item>';
+  $news_url = "http://www.scummvm.org/?shownews=archive#".date("Y-m-d",$item["date"]);
+  echo "\t\t<item>\n";
+  echo "\t\t\t<title><![CDATA[".$item["title"]."]]></title>\n";
+  echo "\t\t\t<description><![CDATA[\n".$item["body"]."\n\t\t\t]]></description>\n";
+  echo "\t\t\t<pubDate>".date("r",$item["date"])."</pubDate>\n";
+  echo "\t\t\t<author>nospam at scummvm.org (".$item["author"].")</author>\n";
+  echo "\t\t\t<guid isPermaLink=\"true\">".$news_url."</guid>\n";
+  echo "\t\t\t<link>".$news_url."</link>\n";
+  echo "\t\t</item>\n";
 } // end of news loop
 ?>
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list