OS & Browser Detection (version 1.5 is out) [20. 09. 2010.]

Started by Branko., December 06, 2008, 05:23:42 AM

Previous topic - Next topic

Sandmansa

Seems to be a new issue.  Since the release of IE 11, OSBD 1.5 is showing IE 11 as "Mozilla compatible".  Is there any way to fix that?

Arantor

The mod hasn't been updated in 3 years, I doubt they will update it now.

The reason for this is because Microsoft, for the first time ever, decided it would be great to remove 'MSIE' from the browser identification.

cieplutki





.

cieplutki

Added before:
    // Catchall for all other windozez

// Windows Mobile
    if(preg_match('/windows phone ([0-9\.]+).*/si', $user_agent, $tmp_array) || preg_match('/phone([0-9\.]+).*/si', $user_agent, $tmp_array) && !$client_data['system'])
      {
      $client_data['system'] = "Windows Phone";
      $client_data['system_icon'] = "win_phone";
      }


and it looks like in the attach




.

Sandmansa


cieplutki

Quote
So is there any way to detect IE 11?

also want to know




.

cieplutki





.

SD-X

We really need to start compiling all of these updates into one post and update the mod. :P

Arantor

The mod hasn't been updated in over 3 years, the author's site is no more, and if you did update it we'd have to remove it for being updated without appropriate permissions as far as I can see :(

Needs someone to take it by the horns and write a fresh one.

SD-X

The author's last online date:
"Last Active: November 17, 2013, 04:40:40 PM"

Seems we are just being ignored. :(

cieplutki

hello,

who can test the BlackBerry OS

find:
// SonyEricsson & Ericsson
add before:
//Blackberry
if(preg_match('/blackberry/si', $user_agent))
      {
      $client_data['system'] = "BlackBerry OS";
      $client_data['system_icon'] = "blackberry";
      if(preg_match('/blackberry ([0-9.]+).*/si', $user_agent, $tmp_array))
        {
        $client_data['system'] = "BlackBerry OS" . ($tmp_array[1] ? " ".$tmp_array[1] : "");
        }


currently no icon.




.

SD-X

I tried my best to compile the new detections, (no code changes/translations), that were made since the final release stated by this topic's title. The icons included are attached to this post, directly from the quoted locations. Both versions of the Microsoft Windows 8 icons are included too. Enjoy:

Quote from: #Pascal on September 28, 2011, 06:49:16 AM
Patch for detecting Android and iOS

// Android
    if(preg_match('/android ([0-9.]+).*/si', $user_agent, $tmp_array))
      {
      $client_data['system'] = "Android" . ($tmp_array[1] ? " ".$tmp_array[1] : "");
      $client_data['system_icon'] = "android";
      }

  // iOS
     if((preg_match('/iphone|ipad/si', $user_agent)) && (preg_match('/OS ([0-9_]+).*/si', $user_agent, $tmp_array)))
      {
      $tmp_array = str_replace("_", ".", $tmp_array);
      $client_data['system'] = "iOS" . ($tmp_array[1] ? " ".$tmp_array[1] : "");
      $client_data['system_icon'] = "iphone";
      }


Quote from: Grimm.CSF. on September 28, 2011, 05:26:06 PM
Quote from: Eclipse16V on September 28, 2011, 02:11:06 PM
Quote from: PascalCX on September 28, 2011, 06:49:16 AM
Patch for detecting Android and iOS

// Android
    if(preg_match('/android ([0-9.]+).*/si', $user_agent, $tmp_array))
      {
      $client_data['system'] = "Android" . ($tmp_array[1] ? " ".$tmp_array[1] : "");
      $client_data['system_icon'] = "android";
      }

  // iOS
     if((preg_match('/iphone|ipad/si', $user_agent)) && (preg_match('/OS ([0-9_]+).*/si', $user_agent, $tmp_array)))
      {
      $tmp_array = str_replace("_", ".", $tmp_array);
      $client_data['system'] = "iOS" . ($tmp_array[1] ? " ".$tmp_array[1] : "");
      $client_data['system_icon'] = "iphone";
      }

Doesn´t work with Android.
Display Linux and not Android.

It work's for me :s

In Sources/os_browser_detection.php
Find:
    // Samsung
    if(preg_match('/samsung\-([0-9a-zA-Z\+\-\.]+){0,1}\//si', $user_agent, $tmp_array))
      {
      if(!$client_data['system'])
        {
$client_data['system'] = "Samsung" . ($tmp_array[1] ? " ".$tmp_array[1] : "");
$client_data['system_icon'] = "mobile";
}
      else
        {
$client_data['system'] .= " / Samsung" . ($tmp_array[1] ? " ".$tmp_array[1] : "");
}
      }


Add After:
    // Android
    if(preg_match('/android ([0-9.]+).*/si', $user_agent, $tmp_array))
      {
      $client_data['system'] = "Android" . ($tmp_array[1] ? " ".$tmp_array[1] : "");
      $client_data['system_icon'] = "android";
      }

    // iOS
     if((preg_match('/iphone|ipad/si', $user_agent)) && (preg_match('/OS ([0-9_]+).*/si', $user_agent, $tmp_array)))
      {
      $tmp_array = str_replace("_", ".", $tmp_array);
      $client_data['system'] = "iOS" . ($tmp_array[1] ? " ".$tmp_array[1] : "");
      $client_data['system_icon'] = "iphone";
      }


Upload the icon_iphone.png + icon_android.php to Themes/default/images/os_browser_detection.

If it's okay with everyone I could upload the package.

Quote from: #Pascal on October 01, 2011, 01:08:34 PM
Android detection(fixed)


// Android
    if(preg_match('/android/si', $user_agent))
    {
    $client_data['system'] = "Android";
    $client_data['system_icon'] = "android";
    if(preg_match('/android ([0-9.]+).*/si', $user_agent, $tmp_array))
      {
      $client_data['system'] = "Android" . ($tmp_array[1] ? " ".$tmp_array[1] : "");
      }
    }


Quote from: Grimm.CSF. on October 10, 2011, 05:11:59 AM
Quote from: French on October 10, 2011, 04:15:01 AM
Still looking to get system_icon LinuxMint in Mod OS & Browser.
edit this line   elseif(preg_match('/linuxmint/si', $user_agent))
        {
        $client_data['system'] .= " (Linuxmint)";
        $client_data['system_icon'] = "linuxmint"

in os_browser_detection.php,but unfortunately the system icon didn´t change
Info My User Agent.
Your User Agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20100101 Firefox/7.0.1

Also looking for the same issue when using Bodhi Linux (Waiting for User Agent info by one of the Bodhi Linux users)


I'm sure I got this right
      elseif(preg_match('/mint/si', $user_agent))
        {
      $client_data['system'] = " (Linux Mint)";
      $client_data['system_icon'] = "mint";
        }


Attached is the icon that goes in /Themes/default/images/os_browser_detection/
Also attached is the full package that includes the changes.

Quote from: villasg on October 31, 2012, 04:57:16 PM
Quote from: cieplutki on October 26, 2012, 01:02:06 PM
Windows 8 out and my suggestion
on os_browser_detection.php find
      if($tmp_array[1] == "6.1")
        {
        $client_data['system'] = "Windows 7/Server 2008 R2";
        $client_data['system_icon'] = "vista";
        }  

replace
      if($tmp_array[1] == "6.2")
        {
        $client_data['system'] = "Windows 8/Server 2012";
        $client_data['system_icon'] = "Win8";
        }  
      elseif($tmp_array[1] == "6.1")
        {
        $client_data['system'] = "Windows 7/Server 2008 R2";
        $client_data['system_icon'] = "vista";
        }  


the correct is :
replace
      if($tmp_array[1] == "6.2")
        {
        $client_data['system'] = "Windows 8/Server 2012";
        $client_data['system_icon'] = "win8";
        }  
      elseif($tmp_array[1] == "6.1")
        {
        $client_data['system'] = "Windows 7/Server 2008 R2";
        $client_data['system_icon'] = "vista";
        }  


because the $client_data['system_icon'] = "win8"; is with small w not capital

Quote from: lukaszuk1995 on August 31, 2013, 04:13:01 AM
My update for Windows 8.1 & Windows 8 :
Find:
      if($tmp_array[1] == "6.1")
        {
        $client_data['system'] = "Windows 7/Server 2008 R2";
        $client_data['system_icon'] = "vista";
        }  

Replace with:
{if($tmp_array[1] == "6.3")
        {
        $client_data['system'] = "Windows 8.1";
        $client_data['system_icon'] = "win81";
        }
      elseif($tmp_array[1] == "6.2")
        {
        $client_data['system'] = "Windows 8";
        $client_data['system_icon'] = "win8";
        }  
        elseif($tmp_array[1] == "6.1")
        {
        $client_data['system'] = "Windows 7";
        $client_data['system_icon'] = "win7";
        }


Quote from: cieplutki on December 08, 2013, 06:02:46 AM
Added before:
    // Catchall for all other windozez

// Windows Mobile
    if(preg_match('/windows phone ([0-9\.]+).*/si', $user_agent, $tmp_array) || preg_match('/phone([0-9\.]+).*/si', $user_agent, $tmp_array) && !$client_data['system'])
      {
      $client_data['system'] = "Windows Phone";
      $client_data['system_icon'] = "win_phone";
      }


and it looks like in the attach

Quote from: cieplutki on January 01, 2014, 05:40:42 AM
hello,

who can test the BlackBerry OS

find:
// SonyEricsson & Ericsson
add before:
//Blackberry
if(preg_match('/blackberry/si', $user_agent))
      {
      $client_data['system'] = "BlackBerry OS";
      $client_data['system_icon'] = "blackberry";
      if(preg_match('/blackberry ([0-9.]+).*/si', $user_agent, $tmp_array))
        {
        $client_data['system'] = "BlackBerry OS" . ($tmp_array[1] ? " ".$tmp_array[1] : "");
        }


currently no icon.

Quote from: cieplutki on January 01, 2014, 06:59:49 AM
blackberry icon on attach
and who check Linux Mint
find:
elseif(preg_match('/mdk/si', $user_agent))
        {
        $client_data['system'] .= " (Mandrake)";
        $client_data['system_icon'] = "mandriva";
        }

add before:
elseif(preg_match('/mint/si', $user_agent))
        {
$client_data['system'] = " (Linux Mint)";
$client_data['system_icon'] = "mint";
        }


I will be grateful for checking if it works  8)

cieplutki

blackberry icon on attach
and who check Linux Mint
find:
elseif(preg_match('/mdk/si', $user_agent))
        {
        $client_data['system'] .= " (Mandrake)";
        $client_data['system_icon'] = "mandriva";
        }

add before:
elseif(preg_match('/mint/si', $user_agent))
        {
$client_data['system'] = " (Linux Mint)";
$client_data['system_icon'] = "mint";
        }


I will be grateful for checking if it works  8)




.

SD-X

Quote from: cieplutki on January 01, 2014, 06:59:49 AM
blackberry icon on attach
and who check Linux Mint
find:
elseif(preg_match('/mdk/si', $user_agent))
        {
        $client_data['system'] .= " (Mandrake)";
        $client_data['system_icon'] = "mandriva";
        }

add before:
elseif(preg_match('/mint/si', $user_agent))
        {
$client_data['system'] = " (Linux Mint)";
$client_data['system_icon'] = "mint";
        }


I will be grateful for checking if it works  8)
Added to my massive post for future referencing. :)

Sandmansa


SD-X


lukaszuk1995

#437
Quote from: cieplutki on January 01, 2014, 05:40:42 AM
hello,

who can test the BlackBerry OS

find:
// SonyEricsson & Ericsson
add before:
//Blackberry
if(preg_match('/blackberry/si', $user_agent))
      {
      $client_data['system'] = "BlackBerry OS";
      $client_data['system_icon'] = "blackberry";
      if(preg_match('/blackberry ([0-9.]+).*/si', $user_agent, $tmp_array))
        {
        $client_data['system'] = "BlackBerry OS" . ($tmp_array[1] ? " ".$tmp_array[1] : "");
        }


currently no icon.
It doesn't work for me, I have syntax error, also Windows Phone useragent detect only WP 8.

cieplutki





.


Advertisement: