home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 March / PCWorld_2001-03_cd.bin / KOMUNIK / progweb / progweb.exe / phpnuke / html / backend.php < prev    next >
PHP Script  |  2000-12-05  |  2KB  |  50 lines

  1. <?php
  2.  
  3. ######################################################################
  4. # PHP-NUKE: Web Portal System
  5. # ===========================
  6. #
  7. # Copyright (c) 2000 by Francisco Burzi (fburzi@ncc.org.ve)
  8. # http://phpnuke.org
  9. #
  10. # This modules is to syndicate your news for other sites
  11. #
  12. # This program is free software. You can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; either version 2 of the License.
  15. ######################################################################
  16.  
  17. include("mainfile.php");
  18. header("Content-Type: text/plain");
  19. $result = mysql_query("SELECT sid, title, time FROM stories ORDER BY sid DESC limit 10");
  20.         if (!result) {
  21.                 echo "An error occured";
  22.         } else {
  23.                 echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n";
  24.         echo "<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS 0.91//EN\"\n";
  25.         echo "           \"http://my.netscape.com/publish/formats/rss-0.91.dtd\">\n\n";
  26.                 echo "<rss version=\"0.91\">\n\n";
  27.         echo "  <channel>\n";
  28.                 echo "       <title>$sitename</title>\n";
  29.                 echo "       <link>$nuke_url</link>\n";
  30.                 echo "       <description>$backend_title</description>\n";
  31.         echo "       <language>$backend_language</language>\n\n";
  32.                 echo "    <image>\n";
  33.                 echo "       <title>$sitename</title>\n";
  34.         echo "       <url>$backend_image</url>\n";
  35.                 echo "       <link>$nuke_url</link>\n";        
  36.         echo "       <description>$slogan</description>\n";
  37.         echo "       <width>$backend_width</width>\n";
  38.         echo "       <height>$backend_height</height>\n";
  39.                 echo "    </image>\n\n";
  40.                 for ($m=0; $m < mysql_num_rows($result); $m++) {
  41.                         list($sid, $title, $time) = mysql_fetch_row($result);
  42.                         echo "    <item>\n";
  43.                         echo "       <title>$title</title>\n";
  44.                         echo "       <link>$nuke_url/article.php?sid=$sid</link>\n";
  45.                         echo "    </item>\n\n";
  46.                 }
  47.     echo "  </channel>\n\n";
  48.         echo "</rss>";
  49.         }
  50. ?>