a6e6s / slimstat

Automatically exported from code.google.com/p/slimstat
GNU General Public License v2.0
1 stars 0 forks source link

Mobile devices #33

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Android

What is the expected output? What do you see instead?
Less than optimal interface

What version of the product are you using? On what operating system?
Android 2.1

Please provide any additional information below.

 function is_handheld() {
-       return strstr( $_SERVER['HTTP_USER_AGENT'], 'iPhone' ) || strstr(
$_SERVER['HTTP_USER_AGENT'], 'MobileSafari' );
+       return strstr( $_SERVER['HTTP_USER_AGENT'], 'iPhone' ) || strstr(
$_SERVER['HTTP_USER_AGENT'], 'MobileSafari' ) || strstr(
$_SERVER['HTTP_USER_AGENT'], 'Android' );
 }

And

                        $browser['platform'] = 'Windows';
                } elseif ( preg_match( '/iPhone/', $_ua ) ) {
                        $browser['platform'] = 'iPhone';
+               } elseif ( preg_match( '/Android/', $_ua ) ) {
+                       $browser['platform'] = 'Android';
                } elseif ( preg_match( '/Symbian/', $_ua ) ) {
                        $browser['platform'] = 'Symbian';
                } elseif ( preg_match( '/Nintendo Wii/', $_ua ) ) {

Related to issue 31, and also the is_handheld() should probably use the
function in _parse_user_agent and have _parse_user_agent tell if it is
mobile device or not.

Original issue reported on code.google.com by dfens...@gmail.com on 29 Jan 2010 at 6:16

GoogleCodeExporter commented 9 years ago
Get an iPhone! ;)

But seriously, I presume it works fine in Android since it's also powered by 
WebKit.

I've added iPod and iPad to the detection too, patch coming up.

That is not a bad idea about the is_handheld() function. We don't currently 
distinguish in the stats between 
handheld and normal browsers, which might be worth doing in future.

Original comment by step...@wettone.com on 1 Feb 2010 at 9:35

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r88.

Original comment by step...@wettone.com on 1 Feb 2010 at 9:36