Location: PHPKode > projects > ProNuke. Postnuke To Oracle > postnuke/html/backend.php
<?php
// File: $Id: backend.php,v 1.20 2001/11/25 23:51:50 niceguyeddie Exp $ $Name:  $
// ----------------------------------------------------------------------
// POST-NUKE Content Management System
// Copyright (C) 2001 by the Post-Nuke Development Team.
// http://www.postnuke.com/
// ----------------------------------------------------------------------
// Based on:
// PHP-NUKE Web Portal System - http://phpnuke.org/
// Thatware - http://thatware.org/
// ----------------------------------------------------------------------
// LICENSE
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License (GPL)
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// To read the license please visit http://www.gnu.org/copyleft/gpl.html
// ----------------------------------------------------------------------
// Original Author of file: Francisco Burzi
// Purpose of file: 
// ----------------------------------------------------------------------

include 'mainfile.php';

header("Content-Type: text/xml");

global $pntable, $dbconn;
$column = &$pntable['stories_column'];
$sql = "SELECT $column[sid], $column[title] FROM $pntable[stories] ORDER BY $column[sid] DESC";
$result = $dbconn->SelectLimit($sql,10);

/* fifers - no need for a count var.  just use a while loop */
// fifers - should we spit out an error XML doc?
if ($result === false) {
// proca must we die or not? if so uncomment next line
    PN_DBMsgError($dbconn, __FILE__, __LINE__, "Error accesing to the database");

    echo "<font class=\"pn-normal\">An error occured</font>";
} else {
    echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n\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";

    global $typocode;
    $myts = new MyTextSanitizer;
    $myts->typeCoding = $typocode;

    // convert to ISO-8859-1 character set 
    $title = htmlspecialchars($sitename);
    $link = htmlspecialchars($nukeurl);
    $description = htmlspecialchars($backend_title);

    echo "<title>$title</title>\n";
    echo "<link>$link</link>\n";
    echo "<description>$description</description>\n";
    echo "<language>$backend_language</language>\n\n";

// FTO Check EOF and databse error

    while(!$result->EOF) {

        list($sid, $title) = $result->fields;

        $title = $myts->makeTboxData4Show($title);
        // convert to ISO-8859-1 character set 
        $title = htmlspecialchars($title);
        $link = htmlspecialchars("$nukeurl/modules.php?op=modload&name=News&file=article&sid=$sid");

        echo "<item>\n";
        echo "<title>$title</title>\n";
        echo "<link>$link</link>\n";
        echo "</item>\n\n";
        $result->MoveNext();
    }

    unset($myts);

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

?>
Return current item: ProNuke. Postnuke To Oracle