News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

K-Detection: Detect OS & Browser Version

Started by Nikola_, October 07, 2006, 08:15:24 PM

Previous topic - Next topic

Sabre™

Quote from: villasg on November 29, 2008, 03:06:50 PM
I want to know the 2.2 work in the smf 1.1.7

No

Quote from: villasg on November 29, 2008, 03:06:50 PM
and this http://mods.simplemachines.org/index.php?mod=487 have all the previus inside ( chrome , vista etc ? )

No

Quote from: villasg on November 29, 2008, 03:06:50 PM
can someone upload the last mod ..

Someone may upload an updated version with the added edits.
I have to fix a few things on my board, then I will apply this to my new site.
If noone has uploaded an updated package, then I will add mine until asked to remove it.
It may be tomorrow.

Quote from: villasg on November 29, 2008, 03:06:50 PM
Thanks

No probs :)


Quote from: X3mE on November 29, 2008, 03:12:43 PM
Just to inform you that I have created a mod which does the same thing as K-Detection, but for SMF 2.0, though it's still waiting to be approved. All the latest detections are included (Chrome, the new Ubuntu, etc).

AWESOME!!
Good job X3mE.
I was hoping someone would carry this over.
+k
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


X3mE

Quote from: Sabre™ on November 29, 2008, 03:16:54 PM
Quote from: X3mE on November 29, 2008, 03:12:43 PM
Just to inform you that I have created a mod which does the same thing as K-Detection, but for SMF 2.0, though it's still waiting to be approved. All the latest detections are included (Chrome, the new Ubuntu, etc).

AWESOME!!
Good job X3mE.
I was hoping someone would carry this over.
+k

Hehe, thanks :)

I desperately wanted this on my forums, so I decided to do it myself instead of waiting for an update (an there hasn't been one for a long time).
Kids, you tried your best and you failed miserably. The lesson is - never try.

My mods:
OS & Browser Detection (1.5 is out!) | Skype Profile Field | GTalk Profile Field | AllCaps Blocker | SMF Syntax Highlighter (Beta) + 2 in development!

Personal websites:
Mobilize.rs (and forum) | Lolmao.info



Sabre™

Yeah brilliant.
Many people will be glad you've done so.
Could you possibly add the Ubuntu and chrome edits here(if chrome is different to what I added on the previous page), so I can add it to the 1.1.7 package Im going to upload?
Or even better, if you have more time than I, could you add an updated 1.1.7 package here?

If you cannot at this time, its all good mate.
Cheers if you can do either :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


X3mE

Here is Chrome:

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


And here is the complete if-else structure for Linux (including Ubuntu versions):

    // Linux
    if(preg_match('/linux/si', $user_agent) && !$client_data['system'])
      {
      $client_data['system'] = "Linux";
      $client_data['system_icon'] = "linux";
      if(preg_match('/mdk/si', $user_agent))
        {
        $client_data['system'] .= " (Mandrake)";
        $client_data['system_icon'] = "mandrake";
        }
      elseif(preg_match('/kanotix/si', $user_agent))
        {
        $client_data['system'] .= " (Kanotix)";
        $client_data['system_icon'] = "kanotix";
        }
      elseif(preg_match('/lycoris/si', $user_agent))
        {
        $client_data['system'] .= " (Lycoris)";
        $client_data['system_icon'] = "lycoris";
        }
      elseif(preg_match('/knoppix/si', $user_agent))
        {
        $client_data['system'] .= " (Knoppix)";
        $client_data['system_icon'] = "knoppix";
        }
      elseif(preg_match('/centos/si', $user_agent))
        {
        $client_data['system'] .= " (CentOS)";
        $client_data['system_icon'] = "centos";
        }
      elseif(preg_match('/gentoo/si', $user_agent))
        {
        $client_data['system'] .= " (Gentoo)";
        $client_data['system_icon'] = "gentoo";
        }
      elseif(preg_match('/fedora/si', $user_agent))
        {
        $client_data['system'] .= " (Fedora)";
        $client_data['system_icon'] = "fedora";
        }
      elseif(preg_match('/ubuntu/si', $user_agent))
        {
        // Which *ubuntu do we have?
        if(preg_match('/kubuntu/si', $user_agent))
          {
          $client_data['system'] .= " (Kubuntu";
          $client_data['system_icon'] = "kubuntu";
          }
        elseif(preg_match('/xubuntu/si', $user_agent))
          {
          $client_data['system'] .= " (Xubuntu";
          $client_data['system_icon'] = "xubuntu";
          }
else
          {
          $client_data['system'] .= " (Ubuntu";
          $client_data['system_icon'] = "ubuntu";
          }
        // Try to detect version
        if(preg_match('/intrepid/si', $user_agent))
          {
          $client_data['system'] .= " 8.10 Intrepid)";
          }
        elseif(preg_match('/hardy/si', $user_agent))
          {
          $client_data['system'] .= " 8.04 LTS Hardy Heron)";
          }
        elseif(preg_match('/gutsy/si', $user_agent))
          {
          $client_data['system'] .= " 7.10 Gutsy Gibbon)";
          }
        elseif(preg_match('/ubuntu.feist/si', $user_agent))
          {
          $client_data['system'] .= " 7.04 Feisty Fawn)";
          }
        elseif(preg_match('/ubuntu.edgy/si', $user_agent))
          {
          $client_data['system'] .= " 6.10 Edgy Eft)";
          }
        elseif(preg_match('/ubuntu.dapper/si', $user_agent))
          {
          $client_data['system'] .= " 6.06 LTS Dapper Drake)";
          }
        elseif(preg_match('/ubuntu.breezy/si', $user_agent))
          {
          $client_data['system'] .= " 5.10 Breezy Badger)";
          }
        else
  {
          $client_data['system'] .= ")";
  }
        }
      elseif(preg_match('/slackware/si', $user_agent))
        {
        $client_data['system'] .= " (Slackware)";
        $client_data['system_icon'] = "slackware";
        }
      elseif(preg_match('/suse/si', $user_agent))
        {
        $client_data['system'] .= " (Suse)";
        $client_data['system_icon'] = "suse";
        }
      elseif(preg_match('/redhat/si', $user_agent))
        {
        $client_data['system'] .= " (Redhat)";
        $client_data['system_icon'] = "redhat";
        }
      elseif(preg_match('/debian/si', $user_agent))
        {
        $client_data['system'] .= " (Debian)";
        $client_data['system_icon'] = "debian";
        }
      elseif(preg_match('/PLD\/([0-9.]*) \(([a-z]{2})\)/si', $user_agent, $tmp_array))
        {
        $client_data['system'] .= " (PLD".($tmp_array[1] ? " ".$tmp_array[1] : "").($tmp_array[2] ? " ".$tmp_array[2] : "").")";
        $client_data['system_icon'] = "pld";
        }
      elseif(preg_match('/PLD\/([a-zA-Z.]*)/si', $user_agent, $tmp_array))
        {
        $client_data['system'] .= " (PLD".($tmp_array[1] ? " ".$tmp_array[1] : "").")";
        $client_data['system_icon'] = "pld";
        }
      }


Variable names are different because I used the original Web Browser Identifier script made by Marcin Krol.

I'm a little short with time right now (I have an exam tomorrow, lol :D), but if no one creates an updated package I'll do it the day after tomorrow.
Kids, you tried your best and you failed miserably. The lesson is - never try.

My mods:
OS & Browser Detection (1.5 is out!) | Skype Profile Field | GTalk Profile Field | AllCaps Blocker | SMF Syntax Highlighter (Beta) + 2 in development!

Personal websites:
Mobilize.rs (and forum) | Lolmao.info



Sabre™

Brilliant mate.
I'll just wait for your updated package then lol
Im pretty swamped as it is myself.

Good luck on your exam  8)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


X3mE

Ok, I wasn't planing to implement 1.1.7 support (as all my boards are now on 2.0b4), but I'll do it as part of my mod. Hope it will be approved in the meantime, so I could add it to the mods site as well (it's been more than 10 days since submission).


Quote from: Sabre™ on November 29, 2008, 03:45:10 PM
Good luck on your exam  8)

Thanks, I'll definitely need it :D
Kids, you tried your best and you failed miserably. The lesson is - never try.

My mods:
OS & Browser Detection (1.5 is out!) | Skype Profile Field | GTalk Profile Field | AllCaps Blocker | SMF Syntax Highlighter (Beta) + 2 in development!

Personal websites:
Mobilize.rs (and forum) | Lolmao.info



brianjw

#186
Glad to see this mod is being taken over. I think this K-Detection should be put in the archived mod sections soon. Doesn't seem like the mod author is coming back anytime soon and from my opinion, no permissions should need to be asked to port this to 2.0.

EDIT: The mod author isn't even using SMF anymore on his site. Looks like he's using vB

X3mE

Kids, you tried your best and you failed miserably. The lesson is - never try.

My mods:
OS & Browser Detection (1.5 is out!) | Skype Profile Field | GTalk Profile Field | AllCaps Blocker | SMF Syntax Highlighter (Beta) + 2 in development!

Personal websites:
Mobilize.rs (and forum) | Lolmao.info



Ashdaw

Was good that you took on the Update for this mod. I have it (K Detection) on Version 1.1.7 and it seems to work ok but when I tried to put your one on it refused to allow me to. :(
You are more than welcome to visit my site.
Greycastle

Sabre™

Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


caryb

My site was hacked the only damage is if you hover over the K_Detection link it brings up a porn site! I cant uninstall it either! My SMF version is 1.1.7 & SMF v2.0 What is my best recourse?


Cary

X3mE

You can't uninstall K-Detection or can't remove the link? The link should be in BoardIndex or Display.template.php...
Kids, you tried your best and you failed miserably. The lesson is - never try.

My mods:
OS & Browser Detection (1.5 is out!) | Skype Profile Field | GTalk Profile Field | AllCaps Blocker | SMF Syntax Highlighter (Beta) + 2 in development!

Personal websites:
Mobilize.rs (and forum) | Lolmao.info



brianjw

Quote from: caryb on January 20, 2009, 12:47:27 AM
My site was hacked the only damage is if you hover over the K_Detection link it brings up a porn site! I cant uninstall it either! My SMF version is 1.1.7 & SMF v2.0 What is my best recourse?


Cary
Just upload SMF Large Upgrade over your current website. Doing this will wipe out ALL mods. So you will have to reinstall them. However, doing this will also keep your Members, Posts, Boards, and DATA safe. ;)

This topic might as well be locked as there is a new mod replacing its function. Could a moderator possibly lock this topic as an outdated mod?

Advertisement: