2004-05-31 18:13:01 +00:00
|
|
|
<?php
|
|
|
|
// rss_main.php:
|
|
|
|
// RSS 2.0 feed for BOINC default server installation.
|
|
|
|
// Channel Main show the current news on project mainpage
|
|
|
|
// - for more informations about RSS see RSS 2.0 Specification:
|
|
|
|
// http://blogs.law.harvard.edu/tech/rss
|
|
|
|
|
|
|
|
// Create and send out http header
|
|
|
|
//
|
|
|
|
header ("Expires: " . gmdate('D, d M Y H:i:s', time()) . " GMT");
|
|
|
|
header ("Last-Modified: " . gmdate('D, d M Y H:i:s') . " GMT");
|
|
|
|
header ("Content-Type: text/xml");
|
|
|
|
|
|
|
|
// Get or set display options
|
|
|
|
// - from 1 to 9 News could be set by option news, default is up to 9
|
|
|
|
//
|
|
|
|
$news = $_GET["news"];
|
|
|
|
if (!$news) {
|
|
|
|
$news = "9";
|
|
|
|
} else {
|
|
|
|
if($news < "1" or $news > "9") {
|
|
|
|
$news = "9";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// inclue project constants and news file
|
|
|
|
//
|
2006-12-01 00:38:36 +00:00
|
|
|
require_once("boinc_news.php");
|
2004-05-31 18:13:01 +00:00
|
|
|
|
|
|
|
// Create channel header and open XML content
|
|
|
|
//
|
|
|
|
$description = "BOINC project ".PROJECT.": Main page News";
|
2008-01-02 17:52:21 +00:00
|
|
|
$channel_image = "http://boinc.berkeley.edu/www_logo.gif";
|
2004-05-31 18:13:01 +00:00
|
|
|
$create_date = gmdate('D, d M Y H:i:s') . ' GMT';
|
|
|
|
$language = "en-us";
|
2004-06-01 17:02:14 +00:00
|
|
|
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>
|
|
|
|
<rss version=\"2.0\">
|
|
|
|
<channel>
|
|
|
|
<title>BOINC</title>
|
|
|
|
<link>http://boinc.berkeley.edu</link>
|
2008-01-02 17:52:21 +00:00
|
|
|
<description>
|
|
|
|
News and announcements related to
|
|
|
|
BOINC (Berkeley Open Infrastructure for Network Computing),
|
|
|
|
an open-source platform for volunteer and grid commputing.
|
|
|
|
</description>
|
2004-06-01 17:02:14 +00:00
|
|
|
<copyright>U.C. Berkeley</copyright>
|
|
|
|
<lastBuildDate>$create_date</lastBuildDate>
|
|
|
|
<language>$language</language>
|
|
|
|
<image>
|
|
|
|
<url>$channel_image</url>
|
|
|
|
<title>BOINC</title>
|
|
|
|
<link>http://boinc.berkeley.edu</link>
|
|
|
|
</image>
|
|
|
|
";
|
2004-05-31 18:13:01 +00:00
|
|
|
|
|
|
|
// - Create news items
|
|
|
|
//
|
2006-01-20 07:39:29 +00:00
|
|
|
$tot = count($project_news);
|
|
|
|
$news = min( $tot, $news);
|
2004-05-31 18:13:01 +00:00
|
|
|
for( $item=0; $item < $news; $item++ ) {
|
2006-01-20 07:39:29 +00:00
|
|
|
$j = $tot - $item;
|
2004-06-01 17:02:14 +00:00
|
|
|
if( count($project_news[$item]) == 2) {
|
2005-08-30 14:55:17 +00:00
|
|
|
$d = strtotime($project_news[$item][0]);
|
2006-09-09 17:22:14 +00:00
|
|
|
$news_date=gmdate('D, d M Y H:i:s',$d) . ' GMT';
|
|
|
|
$unique_url="http://boinc.berkeley.edu/all_news.php#$j";
|
2005-08-30 14:55:17 +00:00
|
|
|
echo "<item>
|
2008-01-02 17:52:21 +00:00
|
|
|
<title>BOINC news ".strip_tags($project_news[$item][0])."</title>
|
2006-01-20 07:39:29 +00:00
|
|
|
<link>http://boinc.berkeley.edu/all_news.php#$j</link>
|
2006-09-09 17:22:14 +00:00
|
|
|
<guid isPermaLink=\"true\">$unique_url</guid>
|
2006-12-29 16:22:08 +00:00
|
|
|
<description><![CDATA[".strip_tags($project_news[$item][1])."]]></description>
|
2006-09-09 17:22:14 +00:00
|
|
|
<pubDate>$news_date</pubDate>
|
2005-08-30 14:55:17 +00:00
|
|
|
</item>
|
2004-06-01 17:02:14 +00:00
|
|
|
";
|
2004-05-31 18:13:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Close XML content
|
|
|
|
//
|
|
|
|
echo "</channel>\n</rss>";
|
|
|
|
|
|
|
|
?>
|