Index: mythplugins/mythweb/includes/skin.php
===================================================================
--- mythplugins/mythweb/includes/skin.php	(revision 18641)
+++ mythplugins/mythweb/includes/skin.php	(working copy)
@@ -17,7 +17,7 @@
     if (isMobileUser()) {
     // Browser is mobile but does it accept HTML?
     // @TODO Need to fail more gracefully...
-        $_SESSION['tmpl'] = 'wap';
+        $_SESSION['tmpl'] = getMobileUserAgent();
     // Make sure the skin is set to the appropriate phone-template type
         $_SESSION['skin'] = $_SESSION['tmpl'];
         define('skin', $_SESSION['skin']);
Index: mythplugins/mythweb/includes/mobile.php
===================================================================
--- mythplugins/mythweb/includes/mobile.php	(revision 18641)
+++ mythplugins/mythweb/includes/mobile.php	(working copy)
@@ -41,25 +41,11 @@
  * @return true or false
  */
 function isMobileUser() {
-  return (getScreenSize() === false) ? false : true;
+  return (getMobileUserAgent() === null) ? false : true;
 }
 
+function getMobiles() {
 
-/**
- * Return the screen size of the mobile user agent. This can be used to do very
- * detailed modifications to the web site's layout for the mobile user agents.
- * If the user is not regocnized to be a mobile device then return false. If the
- * user is a known mobile device but the screen size is unknown then return
- * an empty array. Mobile users are detected based on $_SERVER['HTTP_USER_AGENT']
- * and a list of known mobile user agent identification strings.
- *
- * @return array(width, height) or false
- */
-function getScreenSize() {
-  static $isChecked = false;
-  static $screen = false;
-
-  if (!$isChecked) {
     /*
      * The $mobiles array contains a list of known mobile phone user agent
      * identification strings. Each key of the array is a substring of the
@@ -75,6 +61,8 @@
      * an empty array or approximate dimensions.
      */
     $mobiles = array(
+                /* Apple's iPhone */
+                    'iPhone'     => array('width' => 320, 'height' => 480),
                 /* Phones using the Series 60 platform, e.g. Nokia 3650 and 6600. */
                     'Series 60'  => array('width' => 176, 'height' => 208),
                     'Series60'   => array('width' => 176, 'height' => 208),
@@ -141,25 +129,48 @@
                      //'Opera' => array('width' => 176, 'height' => 208)
              );
 
+   return $mobiles;
+}
+
+
+/**
+ * Return the mobile user agent. If the user agent is not regocnized to be
+ * a known mobile device then return null. Mobile users are detected based
+  * on $_SERVER['HTTP_USER_AGENT'] and a list of known mobile user agent
+  * identification strings.
+  *
+  * @return array(width, height) if known or null
+  */
+function getMobileUserAgent() {
+  static $isChecked = false;
+  static $userAgent = null;
+
+  $mobiles = getMobiles();
+
+  if (!$isChecked) {
+
     /* Scan through $mobiles and try to find matching user agent. */
     foreach (array_keys($mobiles) as $needle) {
       /* Check if user agent matches this screen size key. */
       if (strpos($_SERVER['HTTP_USER_AGENT'], $needle) !== false) {
-        $screen = $mobiles[$needle];
+        $userAgent = $needle;
         break;
       }
     }
 
-// If the user agent was not in our list, check if the terminal accepts WAP.
-    if ($screen === false) {
-      if (browserAcceptsMediaType(array('WAP'))) {
-        $screen = array();
-      }
+    /* If the user agent was not in our list, check media type */
+    if ($userAgent === null) {
+
+      if (browserAcceptsMediaType(array('text/html', '\*/\*')))
+        if (browserAcceptsMediaType(array('WAP')))
+            $userAgent = 'wap';
+
     }
 
     $isChecked = true;
   }
-  return $screen;
+
+  return $userAgent;
 }
 
 
@@ -182,6 +193,25 @@
 
 
 /**
+ * Return the screen size of the mobile user agent. This can be used to do very
+ * detailed modifications to the web site's layout for the mobile user agents.
+ * Meant to be called if isMobileUser() returns true.
+ *
+ * @return array(width, height) if known or null
+ */
+function getScreenSize() {
+
+  $screen = null;
+  $mobiles = getMobiles();
+  $userAgent = getMobileUserAgent();
+
+  $screen = $mobiles[$userAgent];
+
+  return $screen;
+}
+
+
+/**
  * Return the width of the screen in pixels. Meant to be called if isMobileUser()
  * returns true. See also getScreensize().
  *
