First steps:
1) Set up a
wap server (better into the same server where the
PN site resides, for further wap-postnuke interlacing).
<VirtualHost wap.yoursite.com>
ServerName wap.yoursite.com
DocumentRoot /home/httpd/vhtdocs/yoursite/wap
<Directory />
AddType text/vnd.wap.wml wml
AddType image/vnd.wap.wbmp wbmp
AddType text/vnd.wap.wmlscript wmls
AddType application/vnd.wap.wmlc wmlc
AddType application/vnd.wap.wmlscriptc wmlsc
</Directory>
</VirtualHost>
2) Allow the wap server run
PHP scripts into .wml pages:
AddType application/x-httpd-php .php .phtml .wml
3) Prepare some plain .wml pages to test the wap server:
<?xml version="1.0"?>
<!DOCTYPE wml public "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="imagicweb" title="imagicWAP">
<p>Demo select
<br />
<select multiple="true" name="devices" title="devices">
<option value="celular">Celular</option>
<option value="pda">PDA</option>
<option value="emulador">Emulador</option>
<option value="other">Other</option>
</select>
</p>
</card>
</wml>
4) Connect to the wap server from your mobile phone, and test the wap page. (Opera browser for Mac
OS X offers a very good wap emulator).
5) Write a
PHP script (into the .wml pages) that read -or write!- some PostNuke database content (News ?) and parses it to the wap (I'm trying this, I'll post if I success ;) )
This will read and print to WAP the last 10 story titles published (or not):
<?
include ('wml_header.php');
include ('connect_to_pn_database.php');
echo [62] "<card id=\"imagicweb\" title=\"Reading Data\">\n";
// reading last 10 (newest) story titles
$result = mysql_query [63]("SELECT * FROM _stories ORDER BY pn_sid DESC LIMIT 10",$db);
while ($row = mysql_fetch_array [64]($result))
{
$pn_sid = $row["pn_sid"];
$pn_title = $row["pn_title"];
$pn_hometext = $row["pn_hometext"];
$pn_bodytext = $row["pn_bodytext"];
$pn_topic = $row["pn_topic"];
$pn_informant = $row["pn_informant"];
$pn_ihome = $row["pn_ihome"];
$pn_format_type = $row["pn_format_type"];
echo [65] "<p>\n";
echo [66] $pn_title;
echo [67] "\n</p>\n\n";
}
echo [68] "</card>";
include ('wml_footer.php');
?>
It works for me...
Reading is the first and innocuous step, writing maybe difficult and risky... but how about actualizing your postnuke from the mobile phone? or reading new stories published when you're at the sea side?
To be continued... (any contributions, welcome ! )