<?php
/* daCode http://www.dacode.org
 * htdocs/wap/news.php3
 * Fabien Penso <penso@linuxfr.org>
 * $Id: news.php3,v 1.8 2001/07/12 09:48:15 penso Exp $
 *
 * This is used to make a WML/WAP version
*/
	$topdir = '..';
	require $topdir."/dacode.php3";

	if (empty($news_id)) {
		exit;
	}

	$news = LoadClass('News');

	header("Content-Type: text/vnd.wap.wml");
	echo "<?xml version=\"1.0\"?>\n";

	echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"".
		"\"http://www.wapforum.org/DTD/wml_1.1.xml\">\n";
	echo "<wml>\n";
	echo "<head>\n";
	echo "<meta http-equiv=\"Cache-Control\" content=\"max-age=0\">\n";
	echo "</head>\n";
	echo "<card id=\"card1\" title=\"".$config->name.">\n";

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

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

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

			echo "<p align=\"center\"><u>$cur[title]</u></p>\n";
			echo "<p align=\"left\"><small>$cur[body]</small></p>\n";


			next($tmp);
		}
	}

	echo "<p align=\"center\">\n";
	echo "<do type=\"prev\" label=\"".lecho("back")."\"><prev/></do>\n";
	echo "</p>\n\n";

	echo "</card>\n";
	echo "</wml>\n";
?>
