OSDN Git Service

FIX:$manager->notify()の第二引数に変数を渡すように修正。
[nucleus-jp/nucleus-next.git] / xml-rss2.php
1 <?php
2
3 /*
4  * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
5  * Copyright (C) 2002-2009 The Nucleus Group
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  * (see nucleus/documentation/index.html#license for more info)
12  */
13
14 /**
15  * Nucleus RSS syndication channel skin
16  * @license http://nucleuscms.org/license.txt GNU General Public License
17  * @copyright Copyright (C) 2002-2009 The Nucleus Group
18  * @version $Id: xml-rss2.php 1721 2012-03-31 10:18:25Z sakamocchi $
19  */
20
21 header('Pragma: no-cache');
22
23 $CONF = array();
24 include('./config.php');
25
26 if ( !$CONF['DisableSite'] )
27 {
28         // get feed into $feed
29         ob_start();
30         selectSkin('feeds/rss20');
31         selector();
32         $feed = ob_get_contents();
33         ob_end_clean();
34         
35         /*
36          * create ETAG (hash of feed)
37          * (HTTP_IF_NONE_MATCH has quotes around it)
38          */
39         $eTag = '"' . md5($feed) . '"';
40         header('Etag: ' . $eTag);
41         
42         // compare Etag to what we got
43         if ( $eTag == serverVar('HTTP_IF_NONE_MATCH') )
44         {
45                 header('HTTP/1.0 304 Not Modified');
46                 header('Content-Length: 0');
47         }
48         else
49         {
50                 echo $feed;
51         }
52 }
53 // site is disabled, output empty RSS file
54 else
55 {
56         echo '<?xml version="1.0" encoding="' . i18n::get_current_charset() . '"?>' . "\n";
57         echo "<rss version=\"2.0\">\n";
58         echo "<channel>\n";
59         echo '<title>' . Entity::hsc($CONF['SiteName']) . "</title>\n";
60         echo "<link>" . Entity::hsc($CONF['IndexURL']) . "</link>\n";
61         echo "<description></description>\n";
62         echo "<docs>http://backend.userland.com/rss</docs>\n";
63         echo "</channel>\n";
64         echo "</rss>\n";
65 }