11.07.06
Hacking WordPress to Automatically Generate WML for WAP Devices
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/spryken/www/www/blog/wp-content/plugins/wpg2/wpg2embed.inc on line 1229
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/spryken/www/www/blog/wp-content/plugins/wpg2/wpg2embed.inc on line 1245
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/spryken/www/www/blog/wp-content/plugins/stats/stats.php on line 371
I was exploring some plug-ins for WordPress, looking for a Post Hit Counter or a stats plug-in, when I ran across wp-wap by GaMerZ. It provides WordPress with the ability to deliver pages in WML for WAP enabled Mobile Devices. Great I thought. I will make A Scout’s Campfire wap friendly. I created a sub-domain and put a redirect php script in it, pointing to the wp-wap.php. Since I don’t have WAP enabled mobile device, I contacted my buddy Bob Porter. Both he and I got prompted to save the file wp-wap.php when we hit the new sub-domain in FireFox and IE. Puzzled, I suggested he try with his smartphone. Lo and behold, it worked correctly.
We deduced that both FF and IE could not handle the mime type WML. A little digging on the web revealed ways to detect WAP enabled devices and redirect accordingly. WAP and domain names, provide a starting point for me to build a replacement for index.php in WordPress. Using information from that site and IEMobile Team Log, I was able to modify the index.php to query for WAP devices and redirect to wp-wap.php while allowing any other devices to process normally.
At least I think that’s what I did. Bob is off-line currently, so I can’t test the WAP device, but FF is working correctly. I have enabled this on this site only. If further testing holds up, then I will be adding it to A Scout’s Campfire.
Look for an update tomorrow.
Permalink 1,428 views