OSDN Git Service

Another bug fix to RSS/Atom Feeds.
authorKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Sat, 7 Nov 2009 08:21:54 +0000 (08:21 +0000)
committerKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Sat, 7 Nov 2009 08:21:54 +0000 (08:21 +0000)
git-svn-id: svn://svn.code.sf.net/p/intdb/svn/trunk@333 2b68903e-0b30-0410-9a39-a2e4f3c5be39

inc/rssfeed.php
inc/versioninfo.php

index c4ce136..899a475 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2009 iDB Support - http://idb.berlios.de/
     Copyright 2004-2009 Game Maker 2k - http://gamemaker2k.org/
 
-    $FileInfo: rssfeed.php - Last Update: 11/06/2009 SVN 331 - Author: cooldude2k $
+    $FileInfo: rssfeed.php - Last Update: 11/07/2009 SVN 333 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="rssfeed.php"||$File3Name=="/rssfeed.php") {
@@ -126,7 +126,27 @@ $MyDescription = preg_replace("/\<br\>/", "<br />\n", nl2br($MyDescription));
 $MyDescription= text2icons($MyDescription,$Settings['sqltable']);
 $UsersID=mysql_result($result,$i,"UserID");
 $GuestsName=mysql_result($result,$i,"GuestName");
+$requery = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i LIMIT 1", array($UsersID));
+$reresult=mysql_query($requery);
+$renum=mysql_num_rows($reresult);
+$UsersName=mysql_result($reresult,0,"Name");
+$UsersGroupID=mysql_result($reresult,0,"GroupID");
+if($UsersName=="Guest") { $UsersName=$GuestsName;
+if($UsersName==null) { $UsersName="Guest"; } }
+@mysql_free_result($reresult);
+$gquery = query("SELECT * FROM `".$Settings['sqltable']."groups` WHERE `id`=%i LIMIT 1", array($UsersGroupID));
+$gresult=mysql_query($gquery);
+$UsersGroup=mysql_result($gresult,0,"Name");
+$GroupNamePrefix=mysql_result($gresult,0,"NamePrefix");
+$GroupNameSuffix=mysql_result($gresult,0,"NameSuffix");
+@mysql_free_result($gresult);
+if(isset($GroupNamePrefix)&&$GroupNamePrefix!=null) {
+       $UsersName = $GroupNamePrefix.$UsersName; }
+if(isset($GroupNameSuffix)&&$GroupNameSuffix!=null) {
+       $UsersName = $UsersName.$GroupNameSuffix; }
 $TheTime=mysql_result($result,$i,"TimeStamp");
+$AtomTime=GMTimeChange("Y-m-d\TH:i:s\Z",$TheTime,0);
+$OldRSSTime=GMTimeChange("Y-m-d\TH:i:s+0:00",$TheTime,0);
 $TheTime=GMTimeChange("D, j M Y G:i:s \G\M\T",$TheTime,0);
 $TopicName=mysql_result($result,$i,"TopicName");
 $ForumDescription=mysql_result($result,$i,"Description");
@@ -136,14 +156,14 @@ if(isset($PermissionInfo['CanViewForum'][$ForumID])&&
        $CatPermissionInfo['CanViewCategory'][$CategoryID]=="yes") {
 if($_GET['feedtype']=="atom") {
 $CDataDescription = "<![CDATA[\n".$MyDescription."\n]]>";
-$Atom .= '<entry>'."\n".'<title>'.$TopicName.'</title>'."\n".'<summary>'.$CDataDescription.'</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"; }
+$Atom .= '<entry>'."\n".'<title>'.$TopicName.'</title>'."\n".'<summary>'.$CDataDescription.'</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>'.$UsersName.'</name>'."\n".'</author>'."\n".'<updated>'.$AtomTime.'</updated>'."\n".'</entry>'."\n"; }
 if($_GET['feedtype']=="oldrss") {
 $CDataDescription = "<![CDATA[\n".$MyDescription."\n]]>";
 $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>'.$TopicName.'</title>'."\n".'<description>'.$CDataDescription.'</description>'."\n".'</item>'."\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>'.$TopicName.'</title>'."\n".'<description>'.$CDataDescription.'</description>'."\n".'<dc:publisher>'.$UsersName.'</dc:publisher>'."\n".'<dc:creator>'.$UsersName.'</dc:creator>'."\n".'<dc:date>'.$OldRSSTime.'</dc:date>'."\n".'</item>'."\n"; }
 if($_GET['feedtype']=="rss") {
 $CDataDescription = "<![CDATA[\n".$MyDescription."\n]]>";
-$RSS .= '<item>'."\n".'<title>'.$TopicName.'</title>'."\n".'<description>'.$CDataDescription.'</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"; } }
+$RSS .= '<item>'."\n".'<pubDate>'.$TheTime.'</pubDate>'."\n".'<author>'.$UsersName.'</author>'."\n".'<title>'.$TopicName.'</title>'."\n".'<description>'.$CDataDescription.'</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);
 @mysql_free_result($result);
 ++$glti; }
@@ -155,7 +175,9 @@ if($Settings['showverinfo']=="on") { ?>
 <?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/">
+ xmlns="http://purl.org/rss/1.0/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+>
 <channel rdf:about="<?php echo $BoardURL.$feedsname; ?>">
  <title><?php echo $boardsname." ".$ThemeSet['TitleDivider']; ?> Viewing Forum <?php echo $ForumName; ?></title>
   <link><?php echo $BoardURL.url_maker($exfile[$ForumType],$Settings['file_ext'],"act=view&id=".$ForumID,$Settings['qstr'],$Settings['qsep'],$prexqstr[$ForumType],$exqstr[$ForumType]); ?></link>
index 75d7f13..c7b9ab5 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2009 iDB Support - http://idb.berlios.de/
     Copyright 2004-2009 Game Maker 2k - http://gamemaker2k.org/
 
-    $FileInfo: versioninfo.php - Last Update: 11/06/2009 SVN 332 - Author: cooldude2k $
+    $FileInfo: versioninfo.php - Last Update: 11/07/2009 SVN 333 - 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] = 3; $VER1[2] = 0; $VERFull[1] = $VER1[0].".".$VER1[1].".".$VER1[2];
-$VER2[0] = "Pre-Alpha"; $VER2[1] = "PA"; $VER2[2] = "SVN"; $SubVerN = 332; $RName = "iDB"; $SFName = "IntDB";
-$SVNDay[0] = 11; $SVNDay[1] = 06; $SVNDay[2] = 2009; $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
+$VER2[0] = "Pre-Alpha"; $VER2[1] = "PA"; $VER2[2] = "SVN"; $SubVerN = 333; $RName = "iDB"; $SFName = "IntDB";
+$SVNDay[0] = 11; $SVNDay[1] = 07; $SVNDay[2] = 2009; $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);