From bc6a1d8cc900c4a52b84c840ea0ddc156a4a79a0 Mon Sep 17 00:00:00 2001 From: Kazuki Przyborowski Date: Thu, 28 Jan 2010 00:07:39 +0000 Subject: [PATCH] Added support for OPML. git-svn-id: svn://svn.code.sf.net/p/intdb/svn/trunk@453 2b68903e-0b30-0410-9a39-a2e4f3c5be39 --- inc/rssfeed.php | 35 +++++++++++++++++++++++++++-------- inc/versioninfo.php | 6 +++--- rss.php | 9 +++++---- 3 files changed, 35 insertions(+), 15 deletions(-) diff --git a/inc/rssfeed.php b/inc/rssfeed.php index 797c933..d5b3568 100644 --- a/inc/rssfeed.php +++ b/inc/rssfeed.php @@ -8,10 +8,10 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Revised BSD License for more details. - Copyright 2004-2009 iDB Support - http://idb.berlios.de/ - Copyright 2004-2009 Game Maker 2k - http://gamemaker2k.org/ + Copyright 2004-2010 iDB Support - http://idb.berlios.de/ + Copyright 2004-2010 Game Maker 2k - http://gamemaker2k.org/ - $FileInfo: rssfeed.php - Last Update: 12/10/2009 SVN 391 - Author: cooldude2k $ + $FileInfo: rssfeed.php - Last Update: 01/27/2010 SVN 453 - Author: cooldude2k $ */ $File3Name = basename($_SERVER['SCRIPT_NAME']); if ($File3Name=="rssfeed.php"||$File3Name=="/rssfeed.php") { @@ -22,8 +22,8 @@ if(!is_numeric($_GET['id'])) { $_GET['id'] = null; } $boardsname = htmlentities($Settings['board_name'], ENT_QUOTES, $Settings['charset']); $boardsname = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $boardsname); $_GET['feedtype'] = strtolower($_GET['feedtype']); -if($_GET['feedtype']!="rss"&&$_GET['feedtype']!="atom"&& - $_GET['feedtype']!="oldrss"&&$_GET['feedtype']!="opensearch") { +if($_GET['feedtype']!="rss"&&$_GET['feedtype']!="atom"&&$_GET['feedtype']!="oldrss"&& + $_GET['feedtype']!="opml"&&$_GET['feedtype']!="opensearch") { $_GET['feedtype'] = "rss"; } //$basepath = pathinfo($_SERVER['REQUEST_URI']); /*if(dirname($_SERVER['REQUEST_URI'])!="."|| @@ -64,6 +64,7 @@ $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($_GET['feedtype']=="opml") { $checkfeedtype = "text/x-opml"; } if($_GET['feedtype']=="opensearch") { $checkfeedtype = "application/opensearchdescription+xml"; } if(stristr($_SERVER["HTTP_ACCEPT"],$checkfeedtype) ) { header("Content-Type: ".$checkfeedtype."; charset=".$Settings['charset']); } @@ -78,6 +79,9 @@ $prequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."forums\" WHE $preresult=sql_query($prequery,$SQLStat); $prenum=sql_num_rows($preresult); $prei=0; +if($prenum==0) { redirect("location",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($preresult); +ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); +gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } $ForumID=sql_result($preresult,0,"id"); $ForumName=sql_result($preresult,0,"Name"); $ForumName = htmlentities($ForumName, ENT_QUOTES, $Settings['charset']); @@ -174,6 +178,7 @@ $RSS .= ''."\n".''.$TheTime.''."\n".''.$UsersNa ++$i; sql_free_result($presult); } sql_free_result($result); ++$glti; } +$endtag = " \n"; xml_doc_start("1.0",$Settings['charset']); if($Settings['showverinfo']=="on") { ?> @@ -224,7 +229,7 @@ if($Settings['showverinfo']=="on") { ?> <?php echo $boardsname; ?> - + @@ -240,9 +245,23 @@ if($Settings['showverinfo']=="on") { ?> rss.gif - + + + + + + + + Topics RSS 1.0 Feed" type="link" url="" htmlUrl="" xmlUrl="" /> + -->*/ ?> +" htmlUrl="" xmlUrl="" /> + " htmlUrl="" xmlUrl="" /> + + + @@ -256,7 +275,7 @@ if($Settings['showverinfo']=="on") { ?> - + -- 2.11.4.GIT