<?php

if ( ! @include_once( './mainfile.php' ) ) { exit( '!! INCLUDE ERROR. ACCESS DENIED !!' ); }
error_reporting( _E_VALUE );


/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | myPHPNuke Version 188_8 RC2                                          |
// +----------------------------------------------------------------------+
// | License: GNU/GPL - http://www.gnu.org/copyleft/gpl.html              |
// +----------------------------------------------------------------------+
// | Support: http://myphpnuke.com/                                       |
// +----------------------------------------------------------------------+
// | Author: myPHPNuke Dev Team                                           |
// +----------------------------------------------------------------------+
// | Copyright: © 2001-2004 myPHPNuke Dev Team                            |
// +----------------------------------------------------------------------+
// $Id: backend.php,v 1.6.2.2 2004/04/18 12:45:25 ajvwaay Exp $




/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2001 by Francisco Burzi (fburzi@ncc.org.ve)            */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

//include("extention.inc");
//include("mainfile.$phpEx");
header("Content-Type: text/xml");
$result = mysql_query("SELECT sid, title, time FROM ".$mpnTables['stories']." ORDER BY sid DESC limit 10");
if ($result === false)
{
    echo "An error occured";
}
else
{
    echo "<?xml version=\"1.0\"?>\n";
    echo "<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS 0.91//EN\"\n";
    echo "           \"http://my.netscape.com/publish/formats/rss-0.91.dtd\">\n\n";
    echo "<rss version=\"0.91\">\n\n";
      echo "  <channel>\n";
    echo "       <title>" . htmlspecialchars($sitename, ENT_QUOTES, 'UTF-8') . "</title>\n";
    echo "       <link>" . _MPN_ROOT_URI . "</link>\n";
    echo "       <description>" . htmlspecialchars($backend_title, ENT_QUOTES, 'UTF-8') . "</description>\n";
    echo "       <language>$backend_language</language>\n\n";
    echo "    <image>\n";
    echo "       <title>" . htmlspecialchars($sitename, ENT_QUOTES, 'UTF-8') . "</title>\n";
    echo "       <url>$backend_image</url>\n";
    echo "       <link>" . _MPN_ROOT_URI . "</link>\n";
    echo "       <description>" . htmlspecialchars($slogan, ENT_QUOTES, 'UTF-8') . "</description>\n";
    echo "       <width>$backend_width</width>\n";
    echo "       <height>$backend_height</height>\n";
    echo "    </image>\n\n";
    for ($m=0; $m < mysql_num_rows($result); $m++)
    {
        list($sid, $title, $time) = mysql_fetch_row($result);
        echo "    <item>\n";
        echo "       <title>" . htmlspecialchars($title, ENT_QUOTES, 'UTF-8') . "</title>\n";
        echo "       <link>" . _MPN_ROOT_URI . "article.$phpEx?sid=$sid</link>\n";
        echo "    </item>\n\n";
    }

    echo "  </channel>\n\n";
    echo "</rss>";
}

?>
