Logo Search packages:      
Sourcecode: dacode version File versions  Download package

news.php3

<?php
/* daCode http://www.dacode.org/
 * htdocs/pda/news.php3
 * Jerome Kerdreux <jerome.kerdreux@finix.eu.org>
 * ripped from wap code by
 * Fabien Penso <penso@linuxfr.org>
 * $Id: news.php3,v 1.7.2.7 2002/08/10 22:04:09 pterjan Exp $
 *
 * This is used to make a Palm/Avantgo version
 */

      // HTTP_SERVER_VARS['news_id'] ?!?
      if (isset($HTTP_SERVER_VARS) && $HTTP_SERVER_VARS['news_id'] == "" &&
                  !ereg("^[0-9]+$",$HTTP_GET_VARS['news_id'])) {
            exit;
      }

      $topdir = '..';
      require $topdir.'/dacode.php3';
      $news = LoadClass('News');

      $ret = '<html><head>'.
            '<meta http-equiv="Cache-Control" content="max-age=0" />'.
            '<title>'.$config->name.' - Mobile</title>'.
            '<meta http-equiv="Content-Type" content="text/html; '.
            'charset='.$config->encodingcharset.'" />'."\n".
            '</head><body>';

      $tmp = $news->get_news(1,0,0,1,1,$HTTP_GET_VARS['news_id'],1,0);

      if (gettype($tmp) == 'array') {
            reset($tmp);
            while(current($tmp)) {
                  $cur = current($tmp);

                  $ret .= '<p align="center"><b><u>'.htmlentities($cur['title']).
                        "</u></b></p>\n".'<p align="left"><small>';
                  if ($cur['content_type'] == 'text/html') {
                        $ret .= $cur['body'];
                  } else {
                        $ret .= nl2br(htmlentities($cur['body']));
                  }
                  $ret .= "</small></p>\n";

                  next($tmp);
            }
      }

      $ret .= '<p align="center">'."\n".
            '<a href="./">'.lecho("back").'</a>'.
            "\n</p>\n\n</body></html>\n";

      echo $ret;

?>

Generated by  Doxygen 1.6.0   Back to index