[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gforge-commits] gforge/www/export index.php, 1.9, 1.10 rss_sfnews.php,
From: |
tom |
Subject: |
[Gforge-commits] gforge/www/export index.php, 1.9, 1.10 rss_sfnews.php, 1.8, 1.9 |
Date: |
Wed, 30 Jun 2004 12:46:31 -0500 |
Update of /cvsroot/gforge/gforge/www/export
In directory db.perdue.net:/tmp/cvs-serv29084/www/export
Modified Files:
index.php rss_sfnews.php
Log Message:
Applied patch #831: more detailed RSS feed
Index: index.php
===================================================================
RCS file: /cvsroot/gforge/gforge/www/export/index.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- index.php 29 Apr 2004 20:06:56 -0000 1.9
+++ index.php 30 Jun 2004 17:46:29 -0000 1.10
@@ -27,8 +27,7 @@
<h4>News Data</h4>
<ul>
<li><a href="rss_sfnews.php"><?php echo $GLOBALS['sys_name']; ?> Front
Page/Project News</a>
-(<a href="http://my.netscape.com/publish/formats/rss-spec-0.91.html">RSS
0.91</a>,
-<a
href="http://my.netscape.com/publish/formats/rss-0.91.dtd"><rss-0.91.dtd></a>)</li>
+(<a href="http://web.resource.org/rss/1.0/spec">RSS 1.0</a>)</li>
<li><a href="rss_sfnewreleases.php"><?php echo $GLOBALS['sys_name']; ?> New
Releases</a>
(<a href="http://my.netscape.com/publish/formats/rss-spec-0.91.html">RSS
0.91</a>,
<a
href="http://my.netscape.com/publish/formats/rss-0.91.dtd"><rss-0.91.dtd></a>)</li>
Index: rss_sfnews.php
===================================================================
RCS file: /cvsroot/gforge/gforge/www/export/rss_sfnews.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- rss_sfnews.php 5 May 2004 18:43:36 -0000 1.8
+++ rss_sfnews.php 30 Jun 2004 17:46:29 -0000 1.9
@@ -16,10 +16,15 @@
require_once('rss_utils.inc');
header("Content-Type: text/plain");
-print '<?xml version="1.0"?>
-<!DOCTYPE rss SYSTEM "http://my.netscape.com/publish/formats/rss-0.91.dtd">
-<rss version="0.91">
-';
+print '<?xml version="1.0" encoding="UTF-8"?>
+
+<rdf:RDF
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns="http://purl.org/rss/1.0/"
+ xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:syn="http://purl.org/rss/1.0/modules/syndication/"
+ xmlns:admin="http://webns.net/mvcb/" >';
// ## default limit
if ($limit < 1) {
$limit = 10;
@@ -28,30 +33,42 @@
}
if ($group_id) {
- $where_clause = " AND group_id='$group_id'";
+ $where_clause = " AND g.group_id='$group_id'";
+} else {
+ $where_clause = " AND is_approved=1";
}
-$sql = "SELECT forum_id,summary,post_date,details,group_id
- FROM news_bytes, groups g
- WHERE is_approved=1
- AND news_bytes.group_id=g.group_id
+$sql = "SELECT
forum_id,summary,post_date,details,g.group_id,g.group_name,u.realname
+ FROM news_bytes, groups g,users u
+ WHERE news_bytes.group_id=g.group_id
+ AND u.user_id=news_bytes.submitted_by
AND g.is_public='1'
AND g.status='A'
$where_clause
order by post_date desc";
-$res = db_query($sql, $limit);
+ $res = db_query($sql, $limit);
-// ## one time output
-print " <channel>\n";
+print "\n <channel
rdf:about=".'"'."http://$GLOBALS[sys_default_domain]/export/rss_sfnews.php".'"'.">\n";
print " <copyright>Copyright 1999-2000 VA Linux Systems, Inc.</copyright>\n";
-print " <pubDate>".gmdate('D, d M Y g:i:s',time())." GMT</pubDate>\n";
-print " <description>".$GLOBALS['sys_name']." Project News
Highlights</description>\n";
+$grsql = "SELECT group_name from groups where group_id='.$group_id'";
+$grres = db_query($sql,$limit);
+$grrow = db_fetch_array($grres);
+
+print " <title>".$grrow[group_name]." Project News</title>\n";
+//print " <title>".$GLOBALS['sys_name']." Project News</title>\n";
print " <link>http://$GLOBALS[sys_default_domain]</link>\n";
-print " <title>".$GLOBALS['sys_name']." Project News</title>\n";
-print " <webMaster>address@hidden</webMaster>\n";
-print " <language>en-us</language>\n";
+print " <description>".$GLOBALS['sys_name']." Project News
Highlights</description>\n";
// ## item outputs
+print " <items>\n";
+print " <rdf:Seq>\n";
while ($row = db_fetch_array($res)) {
- print " <item>\n";
+ print " <rdf:li
rdf:resource=".'"'."http://$GLOBALS[sys_default_domain]/forum/forum.php?forum_id=$row[forum_id]".'"'."
/>\n";
+}
+print " </rdf:Seq>\n";
+print " </items>\n";
+print " </channel>\n";
+$res = db_query($sql, $limit);
+while ($row = db_fetch_array($res)) {
+ print "\n <item
rdf:about=".'"'."http://$GLOBALS[sys_default_domain]/forum/forum.php?forum_id=$row[forum_id]".'"'.">\n";
print " <title>".htmlspecialchars($row[summary])."</title>\n";
// if news group, link is main page
if ($row[group_id] != $sys_news_group) {
@@ -60,9 +77,11 @@
print " <link>http://$GLOBALS[sys_default_domain]/</link>\n";
}
print "
<description>".rss_description($row[details])."</description>\n";
+ print " <dc:subject>".$row[group_name]."</dc:subject>\n";
+ print " <dc:creator>".$row[realname]."</dc:creator>\n";
+ print " <dc:date>".gmdate('D, d M Y g:i:s',$row[post_date])."
GMT</dc:date>\n";
print " </item>\n";
}
// ## end output
-print " </channel>\n";
?>
-</rss>
+</rdf:RDF>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gforge-commits] gforge/www/export index.php, 1.9, 1.10 rss_sfnews.php, 1.8, 1.9,
tom <=