Archive for October 2008
Wednesday, 29th October 2008
More on Mobile sites
I was left a comment on a previous post about mobile sites about how to make a site for Nokia 6610.
Well rather than leaving a long comment, I thought a follow up post would be easier for me to write!
So to answer the comment, mowser is a good place to start and those sites should open on a Nokia 6610. And you could use a meta link as stated in the original post.
The people who run mowser also run these two sites:
http://ready.mobi/
http://mobiforge.com/
which can also help you get a mobile site going.
Since I wrote the post, I’ve actually made a custom mobile site for my church, Minehead Baptist Church at http://m.minehead-baptist.com
Please feel free to ‘borrow’ any of the html/css if you like (but not the logo cos that’s copyrighted!!!)
It’s got basic into on and loads really nicely on mobile devises and iPhones! I was inspired to make it by this post on digital.leadnet.
Some of the sites on the digital.leadnet post auto detected if you’re on a mobile devise and I wanted a way of doing that with my Church site as well! So after a google I found:
http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/
which gave me a nice php script.
If your site uses php, just pop it in at the top of the page (above the doctype) and tada it works! My church site is run on wordpress, so I put it in at the top of the wp header.php template file.
So the full php code I’m using is:
<?php
if(checkmobile()) header(”Location:http://m.minehead-baptist.com”);function checkmobile(){
if(isset($_SERVER["HTTP_X_WAP_PROFILE"])) return true;
if(preg_match(”/wap\.|\.wap/i”,$_SERVER["HTTP_ACCEPT"])) return true;
if(isset($_SERVER["HTTP_USER_AGENT"])){
$uamatches = array(”midp”, “j2me”, “avantg”, “docomo”, “novarra”, “palmos”, “palmsource”, “240×320″, “opwv”, “chtml”, “pda”, “windows\ ce”, “mmp\/”, “blackberry”, “mib\/”, “symbian”, “wireless”, “nokia”, “hand”, “mobi”, “phone”, “cdm”, “up\.b”, “audio”, “SIE\-”, “SEC\-”, “samsung”, “HTC”, “mot\-”, “mitsu”, “sagem”, “sony”, “alcatel”, “lg”, “erics”, “vx”, “NEC”, “philips”, “mmm”, “xx”, “panasonic”, “sharp”, “wap”, “sch”, “rover”, “pocket”, “benq”, “java”, “pt”, “pg”, “vox”, “amoi”, “bird”, “compal”, “kg”, “voda”, “sany”, “kdd”, “dbt”, “sendo”, “sgh”, “gradi”, “jb”, “\d\d\di”, “moto”);
foreach($uamatches as $uastring){
if(preg_match(”/”.$uastring.”/i”,$_SERVER["HTTP_USER_AGENT"])) return true;
}}
return false;
}?>
I’ve also found that on the iPhone, if you give links to feeds (I’ve got feedburner ones for the church), it opens/reads them nicely and you can even listen to mp3/podcast content straight on the iPhone!
by james in Tech, Work, html & css | 1 Comment »


