00001 <?php 00002 /* 00003 * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) 00004 * Copyright (C) 2002-2007 The Nucleus Group 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * (see nucleus/documentation/index.html#license for more info) 00011 */ 00012 00021 header('Pragma: no-cache'); 00022 00023 $CONF = array(); 00024 $CONF['Self'] = 'atom.php'; 00025 00026 include('./config.php'); 00027 00028 if (!$CONF['DisableSite']) { 00029 // get feed into $feed 00030 ob_start(); 00031 selectSkin('feeds/atom'); 00032 selector(); 00033 $feed = ob_get_contents(); 00034 ob_end_clean(); 00035 00036 // create ETAG (hash of feed) 00037 // (HTTP_IF_NONE_MATCH has quotes around it) 00038 $eTag = '"' . md5($feed) . '"'; 00039 header('Etag: ' . $eTag); 00040 00041 // compare Etag to what we got 00042 if ($eTag == serverVar('HTTP_IF_NONE_MATCH') ) { 00043 header('HTTP/1.0 304 Not Modified'); 00044 header('Content-Length: 0'); 00045 } else { 00046 header("Content-Type: application/xml"); 00047 // dump feed 00048 echo $feed; 00049 } 00050 00051 } 00052 00053 ?>