home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 May / INTERNET103.ISO / pc / software / windows / building / php_nuke / html / backend.php < prev    next >
Encoding:
PHP Script  |  2002-09-16  |  2.2 KB  |  49 lines

  1. <?php
  2.  
  3. /************************************************************************/
  4. /* PHP-NUKE: Advanced Content Management System                         */
  5. /* ============================================                         */
  6. /*                                                                      */
  7. /* Copyright (c) 2002 by Francisco Burzi                                */
  8. /* http://phpnuke.org                                                   */
  9. /*                                                                      */
  10. /* This program is free software. You can redistribute it and/or modify */
  11. /* it under the terms of the GNU General Public License as published by */
  12. /* the Free Software Foundation; either version 2 of the License.       */
  13. /************************************************************************/
  14.  
  15. include("mainfile.php");
  16.  
  17. header("Content-Type: text/xml");
  18. if ($cat != "") {
  19.     $result = sql_query("SELECT catid from ".$prefix."_stories_cat where title LIKE '%$cat%' limit 1", $dbi);
  20.     list ($catid) = sql_fetch_row($result, $dbi);
  21.     if ($catid == "") {
  22.     $result = sql_query("SELECT sid, title FROM ".$prefix."_stories ORDER BY sid DESC limit 10", $dbi);
  23.     } else {
  24.     $result = sql_query("SELECT sid, title FROM ".$prefix."_stories WHERE catid='$catid' ORDER BY sid DESC limit 10", $dbi);
  25.     }
  26. } else {
  27.     $result = sql_query("SELECT sid, title FROM ".$prefix."_stories ORDER BY sid DESC limit 10", $dbi);
  28. }
  29.  
  30. echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n\n";
  31. echo "<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS 0.91//EN\"\n";
  32. echo " \"http://my.netscape.com/publish/formats/rss-0.91.dtd\">\n\n";
  33. echo "<rss version=\"0.91\">\n\n";
  34. echo "<channel>\n";
  35. echo "<title>".htmlspecialchars($sitename)."</title>\n";
  36. echo "<link>$nukeurl</link>\n";
  37. echo "<description>".htmlspecialchars($backend_title)."</description>\n";
  38. echo "<language>$backend_language</language>\n\n";
  39.  
  40. while (list($sid, $title) = sql_fetch_row($result, $dbi)) {
  41.     echo "<item>\n";
  42.     echo "<title>".htmlspecialchars($title)."</title>\n";
  43.     echo "<link>$nukeurl/modules.php?name=News&file=article&sid=$sid</link>\n";
  44.     echo "</item>\n\n";
  45. }
  46. echo "</channel>\n";
  47. echo "</rss>";
  48.  
  49. ?>