~ubuntu-branches/ubuntu/precise/boinc/precise

« back to all changes in this revision

Viewing changes to doc/rss_main.php

Tags: 6.12.8+dfsg-1
* New upstream release.
* Simplified debian/rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
 
// rss_main.php:
3
 
// RSS 2.0 feed for BOINC default server installation.
4
 
// Channel Main show the current news on project mainpage 
5
 
// - for more informations about RSS see RSS 2.0 Specification:
6
 
//   http://blogs.law.harvard.edu/tech/rss
7
 
 
8
 
// Create and send out http header
9
 
//
10
 
header ("Expires: " . gmdate('D, d M Y H:i:s', time()) . " GMT");
11
 
header ("Last-Modified: " . gmdate('D, d M Y H:i:s') . " GMT");
12
 
header ("Content-Type: text/xml");
13
 
 
14
 
// Get or set display options
15
 
// - from 1 to 9 News could be set by option news, default is up to 9
16
 
//
17
 
$news = $_GET["news"];
18
 
if (!$news) { 
19
 
    $news = "9";
20
 
} else {
21
 
    if($news < "1" or $news > "9") {
22
 
        $news = "9";
23
 
    }
24
 
}
25
 
 
26
 
// inclue project constants and news file
27
 
//
28
 
require_once("boinc_news.php");
29
 
 
30
 
// Create channel header and open XML content
31
 
//
32
 
$description = "BOINC project ".PROJECT.": Main page News";
33
 
$channel_image = "http://boinc.berkeley.edu/www_logo.gif";
34
 
$create_date  = gmdate('D, d M Y H:i:s') . ' GMT'; 
35
 
$language = "en-us";
36
 
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>
37
 
    <rss version=\"2.0\">
38
 
    <channel>
39
 
        <title>BOINC</title>
40
 
        <link>http://boinc.berkeley.edu</link>
41
 
        <description>
42
 
            News and announcements related to
43
 
            BOINC (Berkeley Open Infrastructure for Network Computing),
44
 
            an open-source platform for volunteer and grid commputing.
45
 
        </description>
46
 
        <copyright>U.C. Berkeley</copyright>
47
 
        <lastBuildDate>$create_date</lastBuildDate>
48
 
        <language>$language</language>
49
 
        <image>
50
 
            <url>$channel_image</url>
51
 
            <title>BOINC</title>
52
 
            <link>http://boinc.berkeley.edu</link>
53
 
        </image>
54
 
";
55
 
 
56
 
// - Create news items
57
 
//
58
 
$tot = count($project_news);
59
 
$news = min( $tot, $news);
60
 
for( $item=0; $item < $news; $item++ ) {
61
 
    $j = $tot - $item;
62
 
    if( count($project_news[$item]) == 2) {
63
 
        $d = strtotime($project_news[$item][0]);
64
 
        $news_date=gmdate('D, d M Y H:i:s',$d) . ' GMT';
65
 
        $unique_url="http://boinc.berkeley.edu/all_news.php#$j";
66
 
        echo "<item>
67
 
            <title>BOINC news ".strip_tags($project_news[$item][0])."</title>
68
 
            <link>http://boinc.berkeley.edu/all_news.php#$j</link>
69
 
            <guid isPermaLink=\"true\">$unique_url</guid>
70
 
            <description><![CDATA[".strip_tags($project_news[$item][1])."]]></description>
71
 
            <pubDate>$news_date</pubDate>
72
 
            </item>
73
 
        ";
74
 
    }
75
 
}
76
 
 
77
 
// Close XML content
78
 
//
79
 
echo "</channel>\n</rss>";
80
 
 
 
2
// This file is part of BOINC.
 
3
// http://boinc.berkeley.edu
 
4
// Copyright (C) 2008 University of California
 
5
//
 
6
// BOINC is free software; you can redistribute it and/or modify it
 
7
// under the terms of the GNU Lesser General Public License
 
8
// as published by the Free Software Foundation,
 
9
// either version 3 of the License, or (at your option) any later version.
 
10
//
 
11
// BOINC is distributed in the hope that it will be useful,
 
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
14
// See the GNU Lesser General Public License for more details.
 
15
//
 
16
// You should have received a copy of the GNU Lesser General Public License
 
17
// along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
 
18
 
 
19
require_once("../project/project.inc");
 
20
require_once("../html/inc/forum_rss.inc");
 
21
require_once("../html/inc/news.inc");
 
22
 
 
23
$forum = news_forum();
 
24
if (!$forum) {
 
25
    exit;
 
26
}
 
27
 
 
28
forum_rss($forum->id, 0, 0, 1, 14);
81
29
?>