home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 April / PCWorld_2005-04_cd.bin / akce / web / phpnuke / PHP-Nuke-7.5.exe / html / backend.php < prev    next >
PHP Script  |  2004-03-25  |  3KB  |  56 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. /* Additional security checking code 2003 by chatserv                   */
  16. /* http://www.nukefixes.com -- http://www.nukeresources.com             */
  17. /************************************************************************/
  18.  
  19. include("mainfile.php");
  20. global $prefix, $db, $nukeurl;
  21. header("Content-Type: text/xml");
  22.     $cat = intval($cat);
  23. if ($cat != "") {
  24.     $catid = $db->sql_fetchrow($db->sql_query("SELECT catid FROM ".$prefix."_stories_cat WHERE title LIKE '%$cat%' LIMIT 1"));
  25.     if ($catid == "") {
  26.     $result = $db->sql_query("SELECT sid, title FROM ".$prefix."_stories ORDER BY sid DESC LIMIT 10");
  27.     } else {
  28.     $catid = intval($catid);
  29.     $result = $db->sql_query("SELECT sid, title FROM ".$prefix."_stories WHERE catid='$catid' ORDER BY sid DESC LIMIT 10");
  30.     }
  31. } else {
  32.     $result = $db->sql_query("SELECT sid, title FROM ".$prefix."_stories ORDER BY sid DESC LIMIT 10");
  33. }
  34.  
  35. echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n\n";
  36. echo "<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS 0.91//EN\"\n";
  37. echo " \"http://my.netscape.com/publish/formats/rss-0.91.dtd\">\n\n";
  38. echo "<rss version=\"0.91\">\n\n";
  39. echo "<channel>\n";
  40. echo "<title>".htmlspecialchars($sitename)."</title>\n";
  41. echo "<link>$nukeurl</link>\n";
  42. echo "<description>".htmlspecialchars($backend_title)."</description>\n";
  43. echo "<language>$backend_language</language>\n\n";
  44.  
  45. while ($row = $db->sql_fetchrow($result)) {
  46.     $rsid = intval($row['sid']);
  47.     $rtitle = $row['title'];
  48.     echo "<item>\n";
  49.     echo "<title>".htmlspecialchars($rtitle)."</title>\n";
  50.     echo "<link>$nukeurl/modules.php?name=News&file=article&sid=$rsid</link>\n";
  51.     echo "</item>\n\n";
  52. }
  53. echo "</channel>\n";
  54. echo "</rss>";
  55.  
  56. ?>