Showing posts sorted by relevance for query HawHaw. Sort by date Show all posts
Showing posts sorted by relevance for query HawHaw. Sort by date Show all posts

Friday, October 20, 2006

Using HawHaw as a redirect

HawHaw is a toolkit to create universal mobile applications using PHP libraries. It's very good at simplifying the creation of mobile pages for multiple platforms and allows you to preview those pages via your desktop browser which can simplifies testing. For details see www.hawhaw.de

However if you are providing your sites from the same server and want to havesignificantly different sites for your mobile vs. wired users then you don'twant to be limited by the HawHaw emulator for the desktop clients. The following simple approach allows a switch between pages to be made dependanton the client's capabilities. It does not rely on BrowseCap.ini or GetBrowserfunction to work. Thanks to Norbert Huffschmid for explaining what I was doing wrong with my experiments.

1) Create a page for HTML (in my case it was simply the old Index.html) and rename it to index2.html. You can't use index.htm as that would be used first.

2) Create a page for mobiles clients, either manually or via HawHaw. In this case it's called index.wml.php

3) Create a page index.wml as below. This will be the page that all clients will be routed through. It will do a simple detection of the facilities of your browser and switch to the appropriate pages. (see separate article for setting up the index page correctly)


require_once("hawhaw.inc.php");
$myPage = new HAW_deck("Test desk");
if $myPage->ml == HAW_HTML & & $myPage->pureHTML)
{
header("Location: /index2.html");
die;
}
else
{
include "index.wml.php";
}
?>

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();

Thursday, January 17, 2008

IPhone Emulator



Whilst testing the Aficionado.mobi site against an Iphone, we realised that it was not properly detecting that the IPhone was a smaller mobile device and it was showing the full screen version as above. I digged out the logs and saw that it was reporting as:
Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A93 Safari/419.3
I looked at the HawHaw site and saw that there was a new version available that supported IPhone so I installed this on the site.
Also whilst looking at this I spotted that there's a couple of emulators for the Windows Mobile and Mac platforms.

Friday, November 07, 2008

iPhones and RSS

doYouFeed turns any RSS feed into one that's friendly for the iPhone.

It allows you to select a series of properties for the feed such as title, theme, update period, date format and then it generates a tinyURL for easy navigation to your new site. If you navigate to the URL using a regular machine then it kindly shows your site in a skinned preview similar to HawHaw.

Here's the feed for Its a load of WAP