aboutsummaryrefslogtreecommitdiff
path: root/public/rss.php
blob: 88ed7b09fd4cd8cde22a7482021e0fa57a63b315 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
# Lifter002: TODO
# Lifter007: TODO
# Lifter003: TODO
# Lifter010: TODO
/*
rss.php - Ausgabe der persšnlcihen News als rss-Feed
Copyright (C) 2005  Philipp HŸgelmeyer <phuegelm@uni-osnabrueck.de>

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

require '../lib/bootstrap.php';

ob_end_clean();
ob_start();
require_once('lib/showNews.inc.php');
if (Config::get()->NEWS_RSS_EXPORT_ENABLE){
    $range = StudipNews::GetRangeFromRssID(Request::option('id'));
    if (is_array($range)){
        Metrics::increment('core.news.rss_fetched');

        show_rss_news($range['range_id'], $range['range_type']);
    } else {
        header("Content-type: text/xml; charset=utf-8");
        echo "<?xml version=\"1.0\"?>\n<rss version=\"2.0\">\n</rss>\n";
    }
}   
ob_end_flush();