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