<?php
/* version 0.5
home http://wapnuke.org
author Antonio Terreno
email [email protected]
*/
######################################################################
# PHP-NUKE: Web Portal System: Wap Add-on
# ===========================================
#
# This module is to view your last news items via wap enabled devices
# This program is free software. You can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License.
#
# Copyright (c) 2002 by Antonio Terreno - http://java2me.org
######################################################################
if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>\n"
."<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">"
."<wml>\n\n"
."<card id=\"Card01\" title=\"Latest news\">\n"
."<p>\n";
$result = sql_query("SELECT sid, title, time FROM ".$prefix."_stories ORDER BY sid DESC limit 10", $dbi);
if (!result) {
echo "An error occured";
} else {
echo "\t<br/>\r\n"
."\t<b>$sitename</b><br />\r\n"
.""
."\t\t\t\r\n";
for ($m=0; $m < sql_num_rows($result, $dbi); $m++) {
list($sid, $title, $time) = sql_fetch_row($result, $dbi);
echo "::<a href=\"$nukeurl/modules.php?name=$module_name&file=print&sid=$sid\">$title</a> - "
."- \t\t\t<b>$time</b><br/>\r\n";
}
}
echo "</p>"
."</card>\n"
."</wml>";
include ("includes/counter.php");
?>