4 * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
5 * Copyright (C) 2002-2013 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)
14 header('Pragma: no-cache');
17 $CONF['Self'] = 'xml-rss2.php';
19 include('./config.php');
21 if (!$CONF['DisableSite']) {
23 // get feed into $feed
25 selectSkin('feeds/rss20');
27 $feed = ob_get_contents();
30 // create ETAG (hash of feed)
31 // (HTTP_IF_NONE_MATCH has quotes around it)
32 $eTag = '"' . md5($feed) . '"';
33 header('Etag: ' . $eTag);
35 // compare Etag to what we got
36 if ($eTag == serverVar('HTTP_IF_NONE_MATCH') ) {
37 header('HTTP/1.0 304 Not Modified');
38 header('Content-Length: 0');
40 if (strtolower(_CHARSET) != 'utf-8') {
41 $feed = mb_convert_encoding($feed, "UTF-8", _CHARSET);
43 header("Content-Type: application/xml");
49 // output empty RSS file...
50 // (because site is disabled)
52 echo '<' . '?xml version="1.0" encoding="' . _CHARSET . '"?' . '>';
57 <title><?php echo htmlspecialchars($CONF['SiteName']); ?></title>
58 <link><?php echo htmlspecialchars($CONF['IndexURL']); ?></link>
59 <description></description>
60 <docs>http://backend.userland.com/rss</docs>