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

X3mE

Thanks for the suggestion, I always tend to search for smaller blocks, but this was my first mod, so there's definitely room for improvement there. I'll make sure to fix that.


Btw, can someone post some user agents from the new Ubuntu?
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



Mystery?

Can you set permissions to who can see the OS and Browser info? If not... why not add that feature?
Join my NEW website that I just created and be a big part of it (July 30, 2010): http://www.gamerstatic.net

ysNoi

Quote from: X3mE on April 27, 2009, 12:59:51 PM
Btw, can someone post some user agents from the new Ubuntu?

Hello X3me, good day....

Here is my check system on Linux...How do I add a new version of Ubuntu on it, i.e., (Ubuntu 9.04 Jaunty)...?

// 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";
        }
      }

See here : PHF
"Don't fix it if it ain't broken, don't break it if you can't fix it."

X3mE

Quote from: Mystery? on April 28, 2009, 12:00:01 PM
Can you set permissions to who can see the OS and Browser info? If not... why not add that feature?

It is planned and will be implemented.

Quote from: ysNoi on April 28, 2009, 07:02:53 PM
Quote from: X3mE on April 27, 2009, 12:59:51 PM
Btw, can someone post some user agents from the new Ubuntu?

Hello X3me, good day....

Here is my check system on Linux...How do I add a new version of Ubuntu on it, i.e., (Ubuntu 9.04 Jaunty)...?

There will be a revision coming out today, with Jaunty support. Stay tuned :)
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



X3mE

Okay people, new version out: 1.4. Changelog:

* version 1.4 (29. 04. 2009.)
- Added a membergroup permission to view detected information
- Ubuntu 9.04 Jaunty detection added
- Installation code reorganized

I would also like to ask the translators to update translations, as there are 3 new strings:

$txt['permissiongroup_simple_view_os_browser'] = 'View detected OS & Browser in posts';
$txt['permissionname_view_os_browser'] = 'View detected OS & Browser in posts';
$txt['permissionhelp_view_os_browser'] = 'If enabled, the member will see the detected OS & Browser for each post, if they are detected.';



P.S. By default all membergroups will be able to view the info. You can turn it off for whichever membergroup you want in the Admin Control Panel.
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



Cal O'Shaw

Quote from: X3mE on April 29, 2009, 01:41:13 PM
P.S. By default all membergroups will be able to view the info. You can turn it off for whichever membergroup you want in the Admin Control Panel.

And WHERE is that control in AdminCP?  I couldn't find it anywhere.  I checked Membergroups and General Features.

Would you consider setting the default as hidden instead of showing everyone?  I just yanked it from my site when I couldn't find the

ysNoi

Quote from: X3mE on April 29, 2009, 09:29:07 AM
Quote from: Mystery? on April 28, 2009, 12:00:01 PM
Can you set permissions to who can see the OS and Browser info? If not... why not add that feature?

It is planned and will be implemented.

Quote from: ysNoi on April 28, 2009, 07:02:53 PM
Quote from: X3mE on April 27, 2009, 12:59:51 PM
Btw, can someone post some user agents from the new Ubuntu?

Hello X3me, good day....

Here is my check system on Linux...How do I add a new version of Ubuntu on it, i.e., (Ubuntu 9.04 Jaunty)...?

There will be a revision coming out today, with Jaunty support. Stay tuned :)

Okey bro, I'll check it out...! Thanks for the hands..!
"Don't fix it if it ain't broken, don't break it if you can't fix it."

X3mE

Quote from: Cal O'Shaw on April 29, 2009, 04:55:16 PM
Quote from: X3mE on April 29, 2009, 01:41:13 PM
P.S. By default all membergroups will be able to view the info. You can turn it off for whichever membergroup you want in the Admin Control Panel.

And WHERE is that control in AdminCP?  I couldn't find it anywhere.  I checked Membergroups and General Features.

Would you consider setting the default as hidden instead of showing everyone?  I just yanked it from my site when I couldn't find the

Admin - Permissions - Modify desired group - View detected OS & Browser in posts
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



ysNoi

Update successful....!

Quote from: X3mE on April 29, 2009, 01:41:13 PM
- Added a membergroup permission to view detected information

Confirmed...! Thanks for the updates X3mE..!
"Don't fix it if it ain't broken, don't break it if you can't fix it."

blanix

My SMF: 1.1.9

Cal O'Shaw

Hello,

Everything appears to be fine with the install, but I did find this error in my logs, and thought you might want to know about it.

Code (Error Log Entry) Select
http://---.org/forum/index.php?action=packages;sa=install2;package=OS_Browser_Detection_v1.4_SMF_1.x_SMF_2.x.zip

2: mysql_free_result(): supplied argument is not a valid MySQL result resource
File: /home/---/public_html/forum/Packages/temp/install_1.php
Line: 85


Thank you for the MOD.  It's going to be very helpful in troubleshooting.  Grazie!

Eclipse16V

Here is the German

$txt['OS_Browser_Compatible'] = 'kompatibel';
$txt['OS_Browser_OS'] = 'Betriebssystem';
$txt['OS_Browser_Unknown'] = 'Unbekannt';
$txt['OS_Browser_Browser'] = 'Browser';
$txt['permissiongroup_simple_view_os_browser'] = 'Betriebssystem & Browser im Beitrag anzeigen';
$txt['permissionname_view_os_browser'] = 'Betriebssystem & Browser im Beitrag anzeigen';
$txt['permissionhelp_view_os_browser'] = 'Wenn diese Funktion aktiv ist, kann man im Beitrag sehen welches Betriebssystem und welchen Browser der User nutzt.';
I worked with:
SMF 2 in German

Shop:
SID Giessen

Aleksi "Lex" Kilpinen

Code (Modifications.finnish.php) Select

$txt['OS_Browser_Compatible'] = 'yhteensopiva';
$txt['OS_Browser_OS'] = 'Käyttöjärjestelmä';
$txt['OS_Browser_Unknown'] = 'Tuntematon';
$txt['OS_Browser_Browser'] = 'Selain';
$txt['permissiongroup_simple_view_os_browser'] = 'Näkee järjestelmä- ja selaintiedot viesteissä';
$txt['permissionname_view_os_browser'] = ''Näkee järjestelmä- ja selaintiedot viesteissä'';
$txt['permissionhelp_view_os_browser'] = 'Mikäli sallittu, käyttäjä näkee havaitut järjestelmän ja selaimen tiedot kaikissa viesteissä, joissa tiedot on saatavilla.';
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

X3mE

Quote from: ysNoi on April 29, 2009, 10:12:50 PM
Update successful....!

Quote from: X3mE on April 29, 2009, 01:41:13 PM
- Added a membergroup permission to view detected information

Confirmed...! Thanks for the updates X3mE..!

;)

Quote from: blanix on April 30, 2009, 12:00:44 AM
any chance to show the browser-resolution ?

That kind of information isn't stored in the user agent string. Although there are other ways to find it out, it would only complicate the mod. I actually don't see why this should be displayed next to posts, you can use Google Analytics or something if you want to track that, while OS & Browser could have a lot of useful usage scenarios.

Quote from: Cal O'Shaw on April 30, 2009, 01:18:33 AM
Hello,

Everything appears to be fine with the install, but I did find this error in my logs, and thought you might want to know about it.

Code (Error Log Entry) Select
http://---.org/forum/index.php?action=packages;sa=install2;package=OS_Browser_Detection_v1.4_SMF_1.x_SMF_2.x.zip

2: mysql_free_result(): supplied argument is not a valid MySQL result resource
File: /home/---/public_html/forum/Packages/temp/install_1.php
Line: 85


Thank you for the MOD.  It's going to be very helpful in troubleshooting.  Grazie!

Thank you, I'll check it out. As far as I can see, this could only happen during install and won't bother your error log no more, and won't affect installing either, but I'll make sure to sort it out.

@Eclipse16V & LexArma

Thanks ;)

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



CrazyHorse80

Here is the Italian translation:

Quote
//OS & Browser detection
$txt['OS_Browser_Compatible'] = 'compatibile';
$txt['OS_Browser_OS'] = 'OS';
$txt['OS_Browser_Unknown'] = 'Sconosciuto';
$txt['OS_Browser_Browser'] = 'Browser';
$txt['permissiongroup_simple_view_os_browser'] = 'Visualizza OS & Browser rilevati nei posts';
$txt['permissionname_view_os_browser'] = 'Visualizza OS & Browser rilevati nei posts';
$txt['permissionhelp_view_os_browser'] = 'Se abilitato, l\'utente vedrà OS & Browser rilevati per ogni post.';

Thank for your great job!
Bye,
PS

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



mulat

Hi!

I have a problem with mod, i don't see icons :( I've checked icon folder and all is fine.
In my Display.template.php i found:
//OS & Browser Detection
if (allowedTo('view_os_browser')){
if ($message['ua_os'] || $message['ua_browser']){ //Do not display if both are unknown

if ($message['ua_os']) {
echo '
<b>', $txt['OS_Browser_OS'], ':</b>
<br /><img src="', $settings['images_url'], '/os_browser_detection/icon_', $message['ua_os_icon'], '.png" align="top" alt="','" /> ', $message['ua_os'], '<br />';
} else {
echo '
<b>', $txt['OS_Browser_OS'], ':</b>
<br /><img src="', $settings['images_url'], '/os_browser_detection/icon_unknown.png" align="top" alt="','" /> ', $txt['OS_Browser_Unknown'], '<br />';
}

if ($message['ua_browser']) {
echo '
<b>', $txt['OS_Browser_Browser'], ':</b>
<br /><img src="', $settings['images_url'], '/os_browser_detection/icon_', $message['ua_browser_icon'], '.png" align="top" alt="', '" /> ', $message['ua_browser'], '<br /><br />';
} else {
echo '
<b>', $txt['OS_Browser_Browser'], ':</b>
<br /><img src="', $settings['images_url'], '/os_browser_detection/icon_unknown.png" align="top" alt="', '" /> ', $txt['OS_Browser_Unknown'], '<br /><br />';
}

}
}


Any ideas?

X3mE

Open the page source and check if the image URLs are correct.
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



mulat

Quote from: X3mE on May 13, 2009, 09:47:40 AM
Open the page source and check if the image URLs are correct.
SOLVED! Mod using source from my style not default style!

Thanks!

Cal O'Shaw

One of my moderators found a problem.

I have the OS / Browser info set to be seen ONLY by Admins by going through each group and unchecking the option to show the info.

However, my moderator found that she can see the info on the board she moderates.  And the Moderator group has no way to disable seeing the OS info.


Would you consider setting the default on showing info to OFF?  Could you see how to disable showing info to the Moderator group.

Grazie,

Cal

Advertisement: