[ PHPXref.com ] [ Generated: Sun Jul 20 16:40:17 2008 ] [ BLOG:CMS 4.1.3 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> xml-rss.php (source)

   1  <?php 
   2  /**

   3    * BLOG:CMS: PHP/MySQL Personal Content Management System (CMS)

   4    * http://blogcms.com/

   5    * ----------------------------------------------------------------

   6    *

   7    * Copyright (C) 2003-2005 Radek HULÁN

   8    * http://hulan.cz/contact/

   9    *

  10    * Based on: 

  11    * ----------------------------------------------------------------

  12    * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) 

  13    * Copyright (C) 2002-2003 The Nucleus Group

  14    *

  15    * ----------------------------------------------------------------

  16    * This program is free software; you can redistribute it and/or

  17    * modify it under the terms of the GNU General Public License

  18    * as published by the Free Software Foundation; either version 2

  19    * of the License, or (at your option) any later version.

  20  **/
  21  
  22  header("Pragma: no-cache");
  23  include('cfg.php');
  24  if (!$CONF['DisableSite']) {
  25      // get feed into $feed

  26      ob_start();
  27      selectSkin('xmlrss');
  28      selector();
  29      $feed = ob_get_contents();
  30      ob_end_clean();
  31      
  32      // create ETAG (hash of feed)

  33      // (HTTP_IF_NONE_MATCH has quotes around it)

  34      $eTag = '"'.md5($feed).'"';
  35      header('Etag: '.$eTag);
  36      
  37      // compare Etag to what we got

  38      if ($eTag == serverVar('HTTP_IF_NONE_MATCH')) {    
  39          header("HTTP/1.0 304 Not Modified");
  40          header('Content-Length: 0');
  41      } else {
  42          // dump feed

  43          echo $feed;
  44      }
  45          
  46  } else {
  47      echo '<' . '?xml version="1.0" encoding="utf-8"?' . '>';
  48  ?>
  49      <!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">
  50      <rss version="0.91">
  51        <channel>
  52          <title><?php echo htmlspecialchars($CONF['SiteName'])?></title>
  53          <link><?php echo htmlspecialchars($CONF['IndexURL'])?></link>
  54          <description></description>
  55          <docs>http://backend.userland.com/rss091</docs>
  56         </channel>
  57      </rss>    
  58  <?php 
  59   }
  60  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]