OSDN Git Service

Add RSS 1.0 to iDB/inc/rssfeeds.php
authorKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Tue, 21 Oct 2008 07:40:32 +0000 (07:40 +0000)
committerKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Tue, 21 Oct 2008 07:40:32 +0000 (07:40 +0000)
git-svn-id: svn://svn.code.sf.net/p/intdb/svn/trunk@179 2b68903e-0b30-0410-9a39-a2e4f3c5be39

forum.php
inc/rssfeed.php
inc/versioninfo.php
rss.php
subforum.php

index cb7954c..0b62c00 100644 (file)
--- a/forum.php
+++ b/forum.php
@@ -11,7 +11,7 @@
     Copyright 2004-2008 Cool Dude 2k - http://idb.berlios.de/
     Copyright 2004-2008 Game Maker 2k - http://intdb.sourceforge.net/
 
-    $FileInfo: forum.php - Last Update: 01/01/2008 SVN 144 - Author: cooldude2k $
+    $FileInfo: forum.php - Last Update: 10/21/2008 SVN 179 - Author: cooldude2k $
 */
 require('preindex.php');
 $usefileext = $Settings['file_ext'];
@@ -21,7 +21,8 @@ if(!is_numeric($_GET['id']))
 { $_GET['id']="1"; }
 if($Settings['enable_rss']==true) {
 ?>
-<link rel="alternate" type="application/rss+xml" title="Forum Topics RSS Feed" href="<?php echo url_maker($exfile['rss'],$Settings['rss_ext'],"act=rss&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss']); ?>" />
+<link rel="alternate" type="application/rss+xml" title="Forum Topics RSS 1.0 Feed" href="<?php echo url_maker($exfile['rss'],$Settings['rss_ext'],"act=rss&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss']); ?>" />
+<link rel="alternate" type="application/rss+xml" title="Forum Topics RSS 2.0 Feed" href="<?php echo url_maker($exfile['rss'],$Settings['rss_ext'],"act=rss&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss']); ?>" />
 <link rel="alternate" type="application/rss+xml" title="Forum Topics Atom Feed" href="<?php echo url_maker($exfile['rss'],$Settings['rss_ext'],"act=atom&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss']); ?>" />
 <?php } ?>
 <title> <?php echo $Settings['board_name'].$idbpowertitle; ?> </title>
index ce67c39..6082738 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2008 Cool Dude 2k - http://idb.berlios.de/
     Copyright 2004-2008 Game Maker 2k - http://intdb.sourceforge.net/
 
-    $FileInfo: rssfeed.php - Last Update: 10/10/2008 SVN 173 - Author: cooldude2k $
+    $FileInfo: rssfeed.php - Last Update: 10/21/2008 SVN 179 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="rssfeed.php"||$File3Name=="/rssfeed.php") {
@@ -21,7 +21,8 @@ if(!is_numeric($_GET['id'])) { $_GET['id'] = null; }
 $boardsname = htmlentities($Settings['board_name'], ENT_QUOTES, $Settings['charset']);
 $boardsname = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $boardsname);
 $_GET['feedtype'] = strtolower($_GET['feedtype']);
-if($_GET['feedtype']!="rss"&&$_GET['feedtype']!="atom") { $_GET['feedtype'] = "rss"; }
+if($_GET['feedtype']!="rss"&&$_GET['feedtype']!="atom"&&
+       $_GET['feedtype']!="oldrss") { $_GET['feedtype'] = "rss"; }
 //$basepath = pathinfo($_SERVER['REQUEST_URI']);
 /*if(dirname($_SERVER['REQUEST_URI'])!="."||
        dirname($_SERVER['REQUEST_URI'])!=null) {
@@ -56,6 +57,7 @@ $feedsname .= htmlentities($_SERVER['PATH_INFO'], ENT_QUOTES, $Settings['charset
 if($_SERVER['QUERY_STRING']!=null) {
 $feedsname .= "?".htmlentities($_SERVER['QUERY_STRING'], ENT_QUOTES, $Settings['charset']); }
 $checkfeedtype = "application/rss+xml";
+if($_GET['feedtype']=="oldrss") { $checkfeedtype = "application/xml"; }
 if($_GET['feedtype']=="rss") { $checkfeedtype = "application/rss+xml"; }
 if($_GET['feedtype']=="atom") { $checkfeedtype = "application/atom+xml"; }
 if(stristr($_SERVER["HTTP_ACCEPT"],$checkfeedtype) ) {
@@ -122,8 +124,13 @@ if(isset($PermissionInfo['CanViewForum'][$ForumID])&&
        $PermissionInfo['CanViewForum'][$ForumID]=="yes"&&
        isset($CatPermissionInfo['CanViewCategory'][$CategoryID])&&
        $CatPermissionInfo['CanViewCategory'][$CategoryID]=="yes") {
-$Atom .= '<entry>'."\n".'<title>'.htmlentities($TopicName, ENT_QUOTES, $Settings['charset']).'</title>'."\n".'<summary>'.htmlentities($ForumDescription, ENT_QUOTES, $Settings['charset']).'</summary>'."\n".'<link rel="alternate" href="'.$BoardURL.url_maker($exfilerss['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstrrss['topic'],$exqstrrss['topic']).'" />'."\n".'<id>'.$BoardURL.url_maker($exfilerss['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstrrss['topic'],$exqstrrss['topic']).'</id>'."\n".'<author>'."\n".'<name>'.$SettInfo['Author'].'</name>'."\n".'</author>'."\n".'<updated>'.gmdate("Y-m-d\TH:i:s\Z").'</updated>'."\n".'</entry>'."\n";
-$RSS .= '<item>'."\n".'<title>'.htmlentities($TopicName, ENT_QUOTES, $Settings['charset']).'</title>'."\n".'<description>'.htmlentities($ForumDescription, ENT_QUOTES, $Settings['charset']).'</description>'."\n".'<link>'.$BoardURL.url_maker($exfilerss['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstrrss['topic'],$exqstrrss['topic']).'</link>'."\n".'<guid>'.$BoardURL.url_maker($exfilerss['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstrrss['topic'],$exqstrrss['topic']).'</guid>'."\n".'</item>'."\n"; }
+if($_GET['feedtype']=="atom") {
+$Atom .= '<entry>'."\n".'<title>'.htmlentities($TopicName, ENT_QUOTES, $Settings['charset']).'</title>'."\n".'<summary>'.htmlentities($ForumDescription, ENT_QUOTES, $Settings['charset']).'</summary>'."\n".'<link rel="alternate" href="'.$BoardURL.url_maker($exfilerss['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstrrss['topic'],$exqstrrss['topic']).'" />'."\n".'<id>'.$BoardURL.url_maker($exfilerss['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstrrss['topic'],$exqstrrss['topic']).'</id>'."\n".'<author>'."\n".'<name>'.$SettInfo['Author'].'</name>'."\n".'</author>'."\n".'<updated>'.gmdate("Y-m-d\TH:i:s\Z").'</updated>'."\n".'</entry>'."\n"; }
+if($_GET['feedtype']=="oldrss") {
+$PreRSS .= '      <rdf:li rdf:resource="'.$BoardURL.url_maker($exfilerss['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstrrss['topic'],$exqstrrss['topic']).' />'."\n";
+$RSS .= '<item rdf:about="'.$BoardURL.url_maker($exfilerss['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstrrss['topic'],$exqstrrss['topic']).'">'."\n".'<title>'.htmlentities($TopicName, ENT_QUOTES, $Settings['charset']).'</title>'."\n".'<description>'.htmlentities($ForumDescription, ENT_QUOTES, $Settings['charset']).'</description>'."\n".'</item>'."\n"; }
+if($_GET['feedtype']=="rss") {
+$RSS .= '<item>'."\n".'<title>'.htmlentities($TopicName, ENT_QUOTES, $Settings['charset']).'</title>'."\n".'<description>'.htmlentities($ForumDescription, ENT_QUOTES, $Settings['charset']).'</description>'."\n".'<link>'.$BoardURL.url_maker($exfilerss['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstrrss['topic'],$exqstrrss['topic']).'</link>'."\n".'<guid>'.$BoardURL.url_maker($exfilerss['topic'],$Settings['file_ext'],"act=view&id=".$TopicID."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstrrss['topic'],$exqstrrss['topic']).'</guid>'."\n".'</item>'."\n"; } }
 ++$i; } @mysql_free_result($result);
 ++$glti; }
 xml_doc_start("1.0",$Settings['charset']);
@@ -131,7 +138,30 @@ if($Settings['showverinfo']===true) { ?>
 <!-- generator="<?php echo $VerInfo['iDB_Ver_Show']; ?>" -->
 <?php } if($Settings['showverinfo']!==true) { ?>
 <!-- generator="<?php echo $iDB; ?>" -->
-<?php } echo "\n"; if($_GET['feedtype']=="rss") { ?>
+<?php } echo "\n"; if($_GET['feedtype']=="oldrss") { ?>
+<rdf:RDF 
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns="http://purl.org/rss/1.0/">
+<channel rdf:about="<?php echo $BoardURL.$feedsname; ?>">
+ <title><?php echo $boardsname." ".$ThemeSet['TitleDivider']; ?> Viewing Forum <?php echo $ForumName; ?></title>
+  <link><?php echo $BoardURL; ?></link>
+  <description>RSS Feed of the Topics in Forum <?php echo $ForumName; ?></description>
+  <image rdf:resource="<?php echo $BoardURL.$SettDir['inc']; ?>rss.gif" />
+  <items>
+    <rdf:Seq>
+<?php echo $PreRSS; ?>
+    </rdf:Seq>
+  </items>
+</channel>
+
+<image rdf:about="<?php echo $BoardURL.$SettDir['inc']; ?>rss.gif">
+  <title><?php echo $boardsname; ?></title>
+  <link><?php echo $BoardURL; ?></link>
+  <url><?php echo $BoardURL.$SettDir['inc']; ?>rss.gif</url>
+</image>
+<?php echo "\n".$RSS."\n"; ?></rdf:RDF>
+<?php } if($_GET['feedtype']=="rss") { ?>
 <rss version="2.0">
 <channel>
    <title><?php echo $boardsname." ".$ThemeSet['TitleDivider']; ?> Viewing Forum <?php echo $ForumName; ?></title>
index 92e6ab6..45012be 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2008 Cool Dude 2k - http://idb.berlios.de/
     Copyright 2004-2008 Game Maker 2k - http://intdb.sourceforge.net/
 
-    $FileInfo: versioninfo.php - Last Update: 10/18/2008 SVN 178 - Author: cooldude2k $
+    $FileInfo: versioninfo.php - Last Update: 10/21/2008 SVN 179 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="versioninfo.php"||$File3Name=="/versioninfo.php") {
@@ -27,8 +27,8 @@ function version_info($proname,$subver,$ver,$supver,$reltype,$svnver,$showsvn) {
        return $return_var; }
 // Version number and date stuff. :P
 $VER1[0] = 0; $VER1[1] = 2; $VER1[2] = 3; $VERFull[1] = $VER1[0].".".$VER1[1].".".$VER1[2];
-$VER2[0] = "Pre-Alpha"; $VER2[1] = "PA"; $VER2[2] = "SVN"; $SubVerN = 178; $RName = "iDB"; $SFName = "IntDB";
-$SVNDay[0] = 10; $SVNDay[1] = 18; $SVNDay[2] = 2008; $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
+$VER2[0] = "Pre-Alpha"; $VER2[1] = "PA"; $VER2[2] = "SVN"; $SubVerN = 179; $RName = "iDB"; $SFName = "IntDB";
+$SVNDay[0] = 10; $SVNDay[1] = 21; $SVNDay[2] = 2008; $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
 $VerInfo['iDB_Ver'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[1],$SubVerN,false);
 $VerInfo['iDB_Ver_SVN'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[1],$SubVerN,true);
 $VerInfo['iDB_Full_Ver'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[0],$SubVerN,false);
diff --git a/rss.php b/rss.php
index 9fdf728..b3d08df 100644 (file)
--- a/rss.php
+++ b/rss.php
@@ -11,7 +11,7 @@
     Copyright 2004-2008 Cool Dude 2k - http://idb.berlios.de/
     Copyright 2004-2008 Game Maker 2k - http://intdb.sourceforge.net/
 
-    $FileInfo: rss.php - Last Update: 01/01/2008 SVN 144 - Author: cooldude2k $
+    $FileInfo: rss.php - Last Update: 10/21/2008 SVN 179 - Author: cooldude2k $
 */
 //@ini_set("display_errors", true); 
 //@ini_set("display_startup_errors", true);
@@ -22,7 +22,7 @@ if($Settings['enable_rss']==false) {
 ob_clean(); echo "Sorry RSS Feeds are not enabled for this board."; 
 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); }
 if($_GET['act']==null) { $_GET['act'] = "rss"; }
-if($_GET['act']=="rss"||$_GET['act']=="atom") {
+if($_GET['act']=="rss"||$_GET['act']=="oldrss"||$_GET['act']=="atom") {
        $_GET['feedtype'] = $_GET['act']; $Feed['Feed']="Done";
        require($SettDir['inc'].'rssfeed.php'); }
 ?>
\ No newline at end of file
index 1d4f712..bf79611 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2008 Cool Dude 2k - http://idb.berlios.de/
     Copyright 2004-2008 Game Maker 2k - http://intdb.sourceforge.net/
 
-    $FileInfo: subforum.php - Last Update: 01/01/2008 SVN 144 - Author: cooldude2k $
+    $FileInfo: subforum.php - Last Update: 10/21/2008 SVN 179 - Author: cooldude2k $
 */
 require('preindex.php');
 $usefileext = $Settings['file_ext'];
@@ -21,7 +21,8 @@ if(!is_numeric($_GET['id']))
 { $_GET['id']="1"; }
 if($Settings['enable_rss']==true) {
 ?>
-<link rel="alternate" type="application/rss+xml" title="SubForum Topics RSS Feed" href="<?php echo url_maker($exfile['rss'],$Settings['rss_ext'],"act=rss&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss']); ?>" />
+<link rel="alternate" type="application/rss+xml" title="SubForum Topics RSS 1.0 Feed" href="<?php echo url_maker($exfile['rss'],$Settings['rss_ext'],"act=rss&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss']); ?>" />
+<link rel="alternate" type="application/rss+xml" title="SubForum Topics RSS 2.0 Feed" href="<?php echo url_maker($exfile['rss'],$Settings['rss_ext'],"act=rss&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss']); ?>" />
 <link rel="alternate" type="application/rss+xml" title="SubForum Topics Atom Feed" href="<?php echo url_maker($exfile['rss'],$Settings['rss_ext'],"act=atom&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['rss'],$exqstr['rss']); ?>" />
 <?php } ?>
 <title> <?php echo $Settings['board_name'].$idbpowertitle; ?> </title>