Changeset 1288 for branches

Show
Ignore:
Timestamp:
02/17/06 19:16:07 (3 years ago)
Author:
kdz13
Message:

more mobile agent detection... any device reporting that one of the dimensions of it's screen is less than 600 pixels will be flagged as a mobile
device.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/new-themes-model/rss/util.php

    r1283 r1288  
    11921192                || strpos($ua, 'EPOC') !== FALSE 
    11931193                || strpos($ua, 'Opera Mini') !== FALSE 
    1194                 || strpos($ua_lwr, 'j2me') !== FALSE; 
     1194                || strpos($ua_lwr, 'j2me') !== FALSE 
     1195                || strpos($ua, 'Netfront') !== FALSE; 
     1196            // if none of those matched, let's have a gander at grabbing the resolution... 
     1197            if (!$ret && eregi( "([0-9]{3})x([0-9]{3})", $ua, $matches ) ) { 
     1198                if ($matches[1]>600 || $matches[2]>600) { 
     1199                    $ret = 1; //one of the screen dimensions is less than 600 - we'll call it a mobile device 
     1200                } 
     1201            } 
    11951202        }  
    11961203    }