OSDN Git Service

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