home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 May / INTERNET103.ISO / pc / software / windows / building / php_nuke / html / modules / avantgo / index.php next >
Encoding:
PHP Script  |  2002-09-16  |  2.0 KB  |  57 lines

  1. <?php
  2.  
  3. ######################################################################
  4. # PHP-NUKE: Web Portal System: AvantGo Add-on
  5. # ===========================================
  6. #
  7. # This module is to view your last news items via Palm or Windows CE
  8. # devices, using AvantGo software or compatible palm device browsers
  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. # Copyright (c) 2000 by Tim Litwiller - http://linux.made-to-order.net
  15. ######################################################################
  16.  
  17. if (!eregi("modules.php", $PHP_SELF)) {
  18.     die ("You can't access this file directly...");
  19. }
  20.  
  21. require_once("mainfile.php");
  22. $module_name = basename(dirname(__FILE__));
  23. get_lang($module_name);
  24.  
  25. header("Content-Type: text/html");
  26. echo "<html>\n"
  27.     ."<head>\n"
  28.     ."<title>$sitename - AvantGo</title>\n"
  29.     ."<meta name=\"HandheldFriendly\" content=\"True\">\n"
  30.     ."</head>\n"
  31.     ."<body>\n\n\n"
  32.     ."<div align=\"center\">\n";
  33. $result = sql_query("SELECT sid, title, time FROM ".$prefix."_stories ORDER BY sid DESC limit 10", $dbi);
  34. if (!result) {
  35.     echo "An error occured";
  36. } else {
  37.     echo "\t<a href=\"$nukeurl\"><img src=\"images/logo.gif\" alt=\"$slogan\" title=\"$slogan\" border=\"0\"></a><br>\r\n"
  38.     ."\t<h1>$sitename</h1>\r\n"
  39.     ."\t<table border=\"0\" align=\"center\">\r\n"
  40.     ."\t\t<tr>\r\n"
  41.     ."\t\t\t<td bgcolor=\"#efefef\">"._TITLE."</td>\r\n"
  42.     ."\t\t\t<td bgcolor=\"#efefef\">"._DATE."</td>\r\n"
  43.     ."\t\t</tr>\r\n";
  44.     for ($m=0; $m < sql_num_rows($result, $dbi); $m++) {
  45.     list($sid, $title, $time) = sql_fetch_row($result, $dbi);
  46.     echo "\t\t<tr>\r\n"
  47.         ."\t\t\t<td><a href=\"$nukeurl/modules.php?name=$module_name&file=print&sid=$sid\">$title</a></td>\r\n"
  48.         ."\t\t\t<td>$time</td>\r\n"
  49.         ."\t\t</tr>\r\n";
  50.     }
  51.     echo"\t</table>\r\n";
  52. }
  53. echo "</body>\n"
  54.     ."</html>";
  55. include ("includes/counter.php");
  56.  
  57. ?>