Monday, October 23, 2006

PHP-Nuke and HawHaw

I wanted to quickly mobile enable a site based on PHP Nuke so I created the following index.wml file:

require_once("mainfile.php");
require("hawhaw.inc.php");
$myPage = new HAW_deck("PSTOIC - The Alumi Association of the Student Television of Imperial College");

$myTitle = new HAW_text("Latest news from PSTOIC", HAW_TEXTFORMAT_BOLD);
$myTitle->set_br(1);
$myPage->add_text($myTitle);

//Example from news/index.php
$result = $db->sql_query("SELECT sid, catid, aid, title, time, hometext, bodytext, comments, counter, topic, informant, notes, acomm, score, ratings FROM ".$prefix."_stories $qdb $querylang ORDER BY sid DESC limit 5");
while ($row = $db->sql_fetchrow($result)) {

$title = filter($row['title'], "nohtml");
$time = $row['time'];
$mobitext = substr(filter($row['hometext'], "nohtml"),0,50);
$myText1 = new HAW_text("* " . $title . " - " . $mobitext );
$myText1->set_br(1);
$myPage->add_text($myText1);

}

$myText1 = new HAW_text("---");
$myText1->set_br(1);
$myPage->add_text($myText1);
$myPage->create_page();

No comments: