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

index.php3

<?php
/* daCode http://www.dacode.org
 * htdocs/wap/index.php3
 * Fabien Penso <penso@linuxfr.org>
 * $Id: index.php3,v 1.16.2.1 2002/01/02 12:36:00 netsabes Exp $
 *
 * This is used to make a WML/WAP version
 */

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

      header("Content-Type: text/vnd.wap.wml");
      $ret = '<?xml version="1.0" encoding="'.$config->encodingcharset.'"?>'."\n";

      $ret .= '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" '.
            '"http://www.wapforum.org/DTD/wml_1.1.xml">'."\n".
            "<wml>\n".
            "<head>\n".
            '<meta http-equiv="Content-Type" content="text/html; '.
            'charset='.$config->encodingcharset.'" />'.
            "\n</head>\n".
            '<card id="top" title="'.$config->name.'">'."\n";

      $tmp = $news->get_news(10,0,0,1,1,0,0,0);

      if (gettype($tmp) == "array") {

            $ret .= '<p align="left">'."\n";

            while(current($tmp)) {
                  $cur = current($tmp);

                  $cur['title'] = htmlspecialchars($cur['title']);
                  $cur['title'] = preg_replace("/\\\$/", "\\\$\\\$", $cur['title']);

                  $ret .= '<a href="news.'.$config->php.
                        '?news_id='.$cur['id'].'">'.$cur['title'].'</a><br />'."\n";

                  next($tmp);
            }

            $ret .= "</p>\n";

      }

      $ret .= "</card></wml>\n";

      echo $ret;

?>

Generated by  Doxygen 1.6.0   Back to index