OSDN Git Service

CHANGE: Adminクラスの整理
[nucleus-jp/nucleus-next.git] / atom.php
1 <?php\r
2 /*\r
3  * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)\r
4  * Copyright (C) 2002-2012 The Nucleus Group\r
5  *\r
6  * This program is free software; you can redistribute it and/or\r
7  * modify it under the terms of the GNU General Public License\r
8  * as published by the Free Software Foundation; either version 2\r
9  * of the License, or (at your option) any later version.\r
10  * (see nucleus/documentation/index.html#license for more info)\r
11  */\r
12 \r
13 /**\r
14  * Nucleus Atom Syndication\r
15  * @license http://nucleuscms.org/license.txt GNU General Public License\r
16  * @copyright Copyright (C) 2002-2012 The Nucleus Group\r
17  * @version $Id: atom.php 1388 2009-07-18 06:31:28Z shizuki $\r
18  */\r
19 \r
20 header('Pragma: no-cache');\r
21 \r
22 $CONF = array();\r
23 include('./config.php');\r
24 \r
25 if ( !$CONF['DisableSite'] )\r
26 {\r
27         // get feed into $feed\r
28         ob_start();\r
29         selectSkin('feeds/atom');\r
30         selector();\r
31         $feed = ob_get_contents();\r
32         ob_end_clean();\r
33         \r
34         // create ETAG (hash of feed)\r
35         // (HTTP_IF_NONE_MATCH has quotes around it)\r
36         $eTag = '"' . md5($feed) . '"';\r
37         header('Etag: ' . $eTag);\r
38         \r
39         // compare Etag to what we got\r
40         if ( $eTag == serverVar('HTTP_IF_NONE_MATCH') )\r
41         {\r
42                 header('HTTP/1.0 304 Not Modified');\r
43                 header('Content-Length: 0');\r
44         }\r
45         else\r
46         {\r
47                 echo $feed;\r
48         }\r
49 }\r