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

Branko.

Arantor, if you have the ability for this board, please remove previous attachment (OS & Browser Detection Mod - for SMF 2.1)
Strong people don't put others down, they lift them up.
A clever person solves a problem. A wise person avoids it.

Arantor

I don't have the ability. I was under the impression this was all good now though?

NanoSector

My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Branko.

Strong people don't put others down, they lift them up.
A clever person solves a problem. A wise person avoids it.

gemchug74


villasg



snoopy_virtual

Another possible user agent to add for MSIE 11:


    if(preg_match('/Windows-RSS.*IE ([0-9a-z\+\-\.]+).*/si', $user_agent, $tmp_array) && !$client_data['browser'])
      {
      $client_data['browser'] = "MS Internet Explorer" . ($tmp_array[1] ? " ".$tmp_array[1] : "");
      $client_data['browser_icon'] = 'msie';
      }

El verdadero sabio es aquel que lo ve todo, lo estudia todo, lo analiza todo y molesta poco.
A true wise man is he who sees everything, studies everything, analyses everything and hardly ever annoys.

snoopy_virtual

Quote from: snoopy_virtual on June 13, 2015, 03:09:39 PM
Another possible user agent to add for MSIE 11:

That was because I saw a visitor in one of my forums with this user agent: Windows-RSS-Platform/2.0 (IE 11.0; Windows NT 6.1) and this mod didn't catch it.

Reading this page: https://msdn.microsoft.com/library/ms537503.aspx I sow what it was. That's why I recommended to add that code inside the MSIE 11 area.

Today I have seen another visitor not recognized by the mod with this user agent: Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)

It is obviously Baidu robot, so we should add inside the section Various robots...:


    // Baiduspider
    if(preg_match('/Baiduspider\/([0-9a-z\+\-\.]+).*/s', $user_agent, $tmp_array) && !$client_data['browser'])
      {
      $client_data['browser'] = "Baiduspider" . ($tmp_array[1] ? " ".$tmp_array[1] : "");
      $client_data['browser_icon'] = 'robot';
      }

El verdadero sabio es aquel que lo ve todo, lo estudia todo, lo analiza todo y molesta poco.
A true wise man is he who sees everything, studies everything, analyses everything and hardly ever annoys.

cieplutki

Add windows 10 and Egde broweser (internet explorer) who check




.

snoopy_virtual

Wonderful. We were needing that icon. I can see a few W 10 every day already in my sites.




El verdadero sabio es aquel que lo ve todo, lo estudia todo, lo analiza todo y molesta poco.
A true wise man is he who sees everything, studies everything, analyses everything and hardly ever annoys.



villasg

Quote from: cieplutki on August 10, 2015, 02:41:37 PM
Add windows 10 and Egde broweser (internet explorer) who check

Receive errors in my smf 2.0.10
2: preg_match() [<a href='function.preg-match'>function.preg-match</a>]: No ending delimiter '/' found
in /**/**/Sources/os_browser_detection.php  line 691

This is line 691

if(preg_match('/Edge\/12.0', $user_agent, $tmp_array) && !$client_data['browser'])


i think the correct are ( adding one / in '/Edge\/12.0 ) :

if(preg_match('/Edge\/12.0/', $user_agent, $tmp_array) && !$client_data['browser'])


Any idea please ?

cieplutki

if(preg_match('/Edge\/12.0', $user_agent, $tmp_array) && !$client_data['browser'])
replece
if(preg_match('/Edge\/12.0/', $user_agent, $tmp_array) && !$client_data['browser'])
should help




.

snoopy_virtual

Depending on your server, sometimes it sees all the letters lowercase, so I would put it as:


if(preg_match('/Edge\/12.0/i', $user_agent, $tmp_array) && !$client_data['browser'])


Adding the "i" to make it case insensitive.

That way it would match both "Edge" or "edge".

El verdadero sabio es aquel que lo ve todo, lo estudia todo, lo analiza todo y molesta poco.
A true wise man is he who sees everything, studies everything, analyses everything and hardly ever annoys.

snoopy_virtual

Even better


// EDGE 
if(preg_match('/Edge\/([0-9a-z\+\-\.]+).*/si', $user_agent, $tmp_array) && !$client_data['browser'])
      {
      $client_data['browser'] = "Edge" . ($tmp_array[1] ? " ".$tmp_array[1] : "");
      $client_data['browser_icon'] = 'msie';
      }


Just in case they change the number 12.0 in a couple of weeks  8)

El verdadero sabio es aquel que lo ve todo, lo estudia todo, lo analiza todo y molesta poco.
A true wise man is he who sees everything, studies everything, analyses everything and hardly ever annoys.

villasg

Quote from: cieplutki on August 10, 2015, 02:41:37 PM
Add windows 10 and Egde broweser (internet explorer) who check

Hi again

Edge 20.10240.16384.0 recognized as "42.0.2311.135 Chrome 42.0.2311.135"

Quote from: snoopy_virtual on August 13, 2015, 12:15:10 AM
Even better


// EDGE 
if(preg_match('/Edge\/([0-9a-z\+\-\.]+).*/si', $user_agent, $tmp_array) && !$client_data['browser'])
      {
      $client_data['browser'] = "Edge" . ($tmp_array[1] ? " ".$tmp_array[1] : "");
      $client_data['browser_icon'] = 'msie';
      }


Just in case they change the number 12.0 in a couple of weeks  8)

the same happened with this opinion .......

Any solution please ?


And Edge icon attached

cieplutki

Try this
// EDGE
if(preg_match('/Edge\/12.0/', $user_agent, $tmp_array) && !$client_data['browser'])
      {
      $client_data['browser'] = "Edge" . ($tmp_array[1] ? " ".$tmp_array[1] : "");
      $client_data['browser_icon'] = 'edge';
      }

put  icon edge to Themes\default\images\os_browser_detection




.

villasg

Quote from: cieplutki on August 14, 2015, 09:53:26 AM
Try this
// EDGE
if(preg_match('/Edge\/12.0/', $user_agent, $tmp_array) && !$client_data['browser'])
      {
      $client_data['browser'] = "Edge" . ($tmp_array[1] ? " ".$tmp_array[1] : "");
      $client_data['browser_icon'] = 'edge';
      }

put  icon edge to Themes\default\images\os_browser_detection

This is the first thing have try ( the os_browser_detection.php  from your post ) and report before DO NOT WORK

Advertisement: