OSDN Git Service

This commit was generated by cvs2svn to compensate for changes in r4,
[nucleus-jp/nucleus-jp-ancient.git] / utf8 / xml-rss2.php
1 <?php\r
2 \r
3 /**\r
4   * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) \r
5   * Copyright (C) 2002-2004 The Nucleus Group\r
6   *\r
7   * This program is free software; you can redistribute it and/or\r
8   * modify it under the terms of the GNU General Public License\r
9   * as published by the Free Software Foundation; either version 2\r
10   * of the License, or (at your option) any later version.\r
11   * (see nucleus/documentation/index.html#license for more info)\r
12   *\r
13   * Nucleus RSS syndication channel skin\r
14   */\r
15 \r
16 header("Pragma: no-cache");\r
17 \r
18 $CONF = array();\r
19 $CONF['Self'] = "xml-rss2.php";\r
20 \r
21 include('./config.php');\r
22 \r
23 if (!$CONF['DisableSite']) {\r
24         // get feed into $feed\r
25         ob_start();\r
26                 selectSkin('feeds/rss20');\r
27                 selector();\r
28         $feed = ob_get_contents();\r
29         ob_end_clean();\r
30         \r
31         // create ETAG (hash of feed)\r
32         // (HTTP_IF_NONE_MATCH has quotes around it)\r
33         $eTag = '"'.md5($feed).'"';\r
34         header('Etag: '.$eTag);\r
35         \r
36         // compare Etag to what we got\r
37         if ($eTag == serverVar('HTTP_IF_NONE_MATCH')) { \r
38                 header("HTTP/1.0 304 Not Modified");\r
39                 header('Content-Length: 0');\r
40         } else {\r
41                 header("Content-Type: application/xml");\r
42                 // dump feed\r
43                 echo $feed;\r
44         }\r
45                 \r
46 } else {\r
47         // output empty RSS file...\r
48         // (because site is disabled)\r
49         \r
50         echo '<' . '?xml version="1.0" encoding="ISO-8859-1"?' . '>';\r
51         \r
52         ?>\r
53         <rss version="2.0">\r
54           <channel>\r
55             <title><?php echo htmlspecialchars($CONF['SiteName'])?></title>\r
56             <link><?php echo htmlspecialchars($CONF['IndexURL'])?></link>\r
57             <description></description>\r
58             <docs>http://backend.userland.com/rss</docs>\r
59           </channel>\r
60         </rss>  \r
61         <?php\r
62 }\r
63 \r
64 ?>\r