4 * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
5 * Copyright (C) 2002-2005 The Nucleus Group
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)
13 * Nucleus Atom Syndication
16 header("Pragma: no-cache");
19 $CONF['Self'] = 'atom.php';
21 include('./config.php');
23 if (!$CONF['DisableSite']) {
24 // get feed into $feed
26 selectSkin('feeds/atom');
28 $feed = ob_get_contents();
31 // create ETAG (hash of feed)
32 // (HTTP_IF_NONE_MATCH has quotes around it)
33 $eTag = '"'.md5($feed).'"';
34 header('Etag: '.$eTag);
36 // compare Etag to what we got
37 if ($eTag == serverVar('HTTP_IF_NONE_MATCH')) {
38 header("HTTP/1.0 304 Not Modified");
39 header('Content-Length: 0');
41 $feed = mb_convert_encoding($feed, "UTF-8", "EUC-JP");
42 header("Content-Type: application/xml");