Decisions made when designing a website can cause a lot of work later on
Judging by the emails I receive, quite a few readers are clearly interested in mobile websites.
We’ve talked about how to optimise sites in various ways, along with some of the dos and don’ts.
One aspect of mobile site optimisation is whether or not you should do it at all – a topic that’s discussed in ‘To mobi or not to mobi?’ below.
Arguments can be made either way, but below I’ll be looking at how to handle the practical aspects of updating your site.
Where we are
The particular set of pages that I’m considering updating allow visitors to my
site to remotely program their digital TV recorder, either to search the EPG
(electronic programme guide) for a specific programme or to set a recording for
a specific date, time and duration. It’s the only section of the site that’s
designed for mobile use, because it’s the section most likely to be used when
you’re mobile.
The site’s coded in PHP and all the pages in the section rely on a function that’s in a library file called moblib.php, which is where I’ve put things relating to mobile access.
But iPhone users need something a bit more sophisticated; the text links might not be so easy to see and, further down the screen, larger options on the form will be useful as well.
How do we get this far? Well, this is part of what’s in our mobile library:
function isMobile() {
returnpreg_match(‘/Symbian|MIDP|Nokia|SonyEriccson|UP.Browser|Smartphone|iPod/’,$_SERVER[‘HTTP_USER_AGENT’])
;
}
function brokenMobileBrowser() {
// some browsers don’t seem to populate hidden form fields
returnpreg_match(‘/SEMC-Browser/’,$_SERVER[‘HTTP_USER_AGENT’]) ;
}
In the pages within this section of the site there are a few simple tests. The isMobile function is used to choose which style sheet to load, and reversed to turn on the
Related articles
Q.How do I stop Windows 7 search?
Q.Is it a genuine call from Microsoft?
Q.How can I turn Autoplay back on?
We ask why ebooks readers have no embedded fonts or easily accessible footnotes and how typographical errors not in the original book appear
Basic Input Output System. Essential software built into every PC that connects the vital components....
|
|
|
|
|
Nikon Coolpix S570 BlackPrice: £66.99 |
Computeractive Ultimate Guide - Storage, Sharing & BackupPrice: £5.99 |
Back Issue CD-Rom 13 (2010)Price: £9.99 |
Hallmark Card Studio DeluxePrice: £15.31 |
Marine AquariumPrice: £15.41 |