home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 April / PCWorld_2005-04_cd.bin / akce / web / unitednuke / unitednuke.exe / html / modules / AvantGo / index.php next >
PHP Script  |  2004-07-12  |  3KB  |  67 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", $_SERVER['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. global $sitename, $slogan, $db, $prefix, $locale, $site_logo;
  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.     ."<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset="._CHARSET."\">\n"
  31.     ."</head>\n"
  32.     ."<body>\n\n\n"
  33.     ."<div align=\"center\">\n";
  34. $result = $db->sql_query("SELECT sid, title, time FROM ".$prefix."_stories ORDER BY sid DESC LIMIT 10");
  35. if (!result) {
  36.     echo "An error occured";
  37. } else {
  38.     echo "\t<a href=\"index.php\"><img src=\"images/$site_logo\" alt=\"$slogan\" title=\"$slogan\" border=\"0\"></a><br>\r\n"
  39.         ."\t<h1>$sitename</h1>\r\n"
  40.         ."\t<table border=\"0\" align=\"center\">\r\n"
  41.         ."\t\t<tr>\r\n"
  42.         ."\t\t\t<td bgcolor=\"#efefef\">"._TITLE."</td>\r\n"
  43.         ."\t\t\t<td bgcolor=\"#efefef\">"._DATE."</td>\r\n"
  44.         ."\t\t</tr>\r\n";
  45.     setlocale(LC_TIME, $locale); //nastavime locale
  46.     for ($m=0; $m < $db->sql_numrows($result); $m++) {
  47.         $row = $db->sql_fetchrow($result);
  48.     $sid = intval($row['sid']);
  49.     $title = $row['title'];
  50.     $time = $row['time'];
  51.  
  52.     $new_date_by_locale = strtotime($time); //nacteme mesic slovne
  53.     $new_date_by_locale = strftime(translate(avantgo), $new_date_by_locale);
  54.     $time = $new_date_by_locale;
  55.  
  56.         echo "\t\t<tr>\r\n"
  57.         ."\t\t\t<td><a href=\"modules.php?name=$module_name&file=print&sid=$sid\">$title</a></td>\r\n"
  58.             ."\t\t\t<td>$time</td>\r\n"
  59.             ."\t\t</tr>\r\n";
  60.     }
  61.     setlocale(LC_TIME, ''); //nastavime zpet locale na vychozi systemovou hodnotu
  62.     echo "\t</table>\r\n";
  63. }
  64. echo "</body>\n"
  65.     ."</html>";
  66. include ("includes/counter.php");
  67. ?>