[ Index ]

PHP Cross Reference of Nucleus CMS 3.32

title

Body

[close]

/ -> xml-rss2.php (source)

   1  <?php
   2  
   3  /*
   4   * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
   5   * Copyright (C) 2002-2007 The Nucleus Group
   6   *
   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)
  12   */
  13  
  14  /**
  15   * Nucleus RSS syndication channel skin
  16   * @license http://nucleuscms.org/license.txt GNU General Public License
  17   * @copyright Copyright (C) 2002-2007 The Nucleus Group
  18   * @version $Id: xml-rss2.php 1116 2007-02-03 08:24:29Z kimitake $
  19   */
  20  
  21  header('Pragma: no-cache');
  22  
  23  $CONF = array();
  24  $CONF['Self'] = 'xml-rss2.php';
  25  
  26  include ('./config.php');
  27  
  28  if (!$CONF['DisableSite']) {
  29  
  30      // get feed into $feed
  31      ob_start();
  32      selectSkin('feeds/rss20');
  33      selector();
  34      $feed = ob_get_contents();
  35      ob_end_clean();
  36  
  37      // create ETAG (hash of feed)
  38      // (HTTP_IF_NONE_MATCH has quotes around it)
  39      $eTag = '"' . md5($feed) . '"';
  40      header('Etag: ' . $eTag);
  41  
  42      // compare Etag to what we got
  43      if ($eTag == serverVar('HTTP_IF_NONE_MATCH') ) {
  44          header('HTTP/1.0 304 Not Modified');
  45          header('Content-Length: 0');
  46      } else {
  47          // dump feed
  48          echo $feed;
  49      }
  50  
  51  } else {
  52      // output empty RSS file...
  53      // (because site is disabled)
  54  
  55      echo '<' . '?xml version="1.0" encoding="' . _CHARSET . '"?' . '>';
  56  
  57      ?>
  58      <rss version="2.0">
  59          <channel>
  60              <title><?php echo htmlspecialchars($CONF['SiteName']); ?></title>
  61              <link><?php echo htmlspecialchars($CONF['IndexURL']); ?></link>
  62              <description></description>
  63              <docs>http://backend.userland.com/rss</docs>
  64          </channel>
  65      </rss>
  66      <?php
  67  }
  68  
  69  ?>


Generated: Tue Feb 12 15:34:36 2008 Cross-referenced by PHPXref 0.7