vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Miscellaneous Hacks - Display OS and Browser Information on Postbit (https://vborg.vbsupport.ru/showthread.php?t=219687)

cbiweb 09-29-2009 12:36 AM

Installed.
Doesn't show any icons
No settings in ACP or anywhere!
UNINSTALLED.

bollie 10-09-2009 03:46 PM

opdate please for windows 7

smokin1337 10-10-2009 02:56 PM

1 Attachment(s)
I added windows 7 but had to delete windows 98 from the xml to make it work. To do it go into Plugins->Manage Plugins->Display OS and Browser->save on new post

Repalce ALL with:
Code:

$useragent = $_SERVER ? $_SERVER['HTTP_USER_AGENT'] : $HTTP_SERVER_VARS['HTTP_USER_AGENT'];
        $ua = strtolower($useragent);
        $ua_browser = 'unknown';
        $ua_os = 'unknown';

        // Browser detection:
        if (strpos($ua, 'firefox') !== false) $ua_browser = 'firefox';
        else if (strpos($ua, 'msie') !== false) $ua_browser = 'ie';
        else if (strpos($ua, 'opera') !== false)
        {
                if (strpos($ua, 'opera mini ') === false) $ua_browser = 'opera';
                else $ua_browser = 'operamini';
        }
        else if (strpos($ua, 'mozilla') !== false && strpos($ua, 'rv:') !== false) $ua_browser = 'mozilla';
        else if (strpos($ua, 'netscape') !== false) $ua_browser = 'netscape';
        else if (strpos($ua, 'safari') !== false) $ua_browser = 'safari';
        else if (strpos($ua, 'epiphany') !== false) $ua_browser = 'epiphany';
        else if (strpos($ua, 'galeon') !== false) $ua_browser = 'galeon';
        else if (strpos($ua, 'konqueror') !== false) $ua_browser = 'konqueror';
        else if (strpos($ua, 'firebird') !== false) $ua_browser = 'firebird';
        else if (strpos($ua, 'avant browser') !== false) $ua_browser = 'avant';
        else if (strpos($ua, 'maxthon') !== false || strpos($ua, 'myie') !== false) $ua_browser = 'maxthon';
        else if (strpos($ua, 'slimbrowser') !== false) $ua_browser = 'slimbrowser';
  else if (strpos($ua, 'chrome') !== false) $ua_browser = 'gc';



        // OS detection:

  if (strpos($ua, 'windows nt 6.1') !== false) $ua_os = 'win_7';
        else if (strpos($ua, 'windows nt 5.0') !== false) $ua_os = 'windows_98_nt_2000';
        else if (strpos($ua, 'windows 95') !== false) $ua_os = 'windows_98_nt_2000';
        else if (strpos($ua, 'windows me') !== false) $ua_os = 'windows_me';
        else if (strpos($ua, 'windows 98') !== false) $ua_os = 'windows_98_nt_2000';
        else if (strpos($ua, 'windows nt 5.2') !== false || strpos($ua, 'windows nt 5.1') !== false) $ua_os = 'windows_xp_2003';
        else if (strpos($ua, 'windows nt 6.0') !== false) $ua_os = 'windows_vista';
       

else if (strpos($ua, 'linux') !== false)
        {
                if (strpos($ua, 'debian') !== false) $ua_os = 'linuxdebian';
                else if (strpos($ua, 'fedora') !== false) $ua_os = 'linuxfedora';
                else if (strpos($ua, 'gentoo') !== false) $ua_os = 'linuxgentoo';
                else if (strpos($ua, 'kateos') !== false || strpos($ua, 'kate os') !== false) $ua_os = 'linuxkateos';
                else if (strpos($ua, 'knoppix') !== false) $ua_os = 'linuxknoppix';
                else if (strpos($ua, 'kubuntu') !== false) $ua_os = 'linuxkubuntu';
                else if (strpos($ua, 'mandriva') !== false || strpos($ua, 'mandrake') !== false) $ua_os = 'linuxmandriva';
                else if (strpos($ua, 'redhat') !== false || strpos($ua, 'red hat') !== false) $ua_os = 'linuxredhat';
                else if (strpos($ua, 'slackware') !== false) $ua_os = 'linuxslackware';
                else if (strpos($ua, 'suse') !== false) $ua_os = 'linuxsuse';
                else if (strpos($ua, 'ubuntu') !== false) $ua_os = 'linuxubuntu';
                else if (strpos($ua, 'arch') !== false) $ua_os = 'linuxarch';
                else $ua_os = 'linux';
        }
        if (strpos($ua, 'iPhone') !== false) $ua_os = 'ipod';
       
        else if (strpos($ua, 'mac os x') !== false) $ua_os = 'macos';


        else if (strpos($ua, 'amiga') !== false) $ua_os = 'amiga';
        else if (strpos($ua, 'beos; ') !== false) $ua_os = 'beos';
        else if (strpos($ua, 'freebsd') !== false) $ua_os = 'freebsd';
        else if (strpos($ua, 'netbsd') !== false) $ua_os = 'netbsd';
        else if (strpos($ua, 'sunos') !== false || strpos($ua, 'solaris') !== false) $ua_os = 'solaris';
        else if (strpos($ua, 'symbian') !== false) $ua_os = 'symbian';
        else if (strpos($ua, 'unix') !== false) $ua_os = 'unix';


$browser = $ua_browser;
$os = $ua_os;

$vbulletin->db->query_write("INSERT INTO " . TABLE_PREFIX . "postinfo (postid, OS, browser) VALUES (" . $post['postid'] . ",'$os' ,'$browser')");

Then edit Display the information on postbit:

Find:
Code:

$osname = array(
Add after:
Code:

'win_7' => "Windows 7",
Then i used this icon (leave it named what it is) Add it to images/useragent:

bollie 10-10-2009 03:05 PM

Quote:

Originally Posted by smokin1337 (Post 1897608)
I added windows 7 but had to delete windows 98 from the xml to make it work. To do it go into Plugins->Manage Plugins->Display OS and Browser->save on new post

Repalce ALL with:
Code:

$useragent = $_SERVER ? $_SERVER['HTTP_USER_AGENT'] : $HTTP_SERVER_VARS['HTTP_USER_AGENT'];
        $ua = strtolower($useragent);
        $ua_browser = 'unknown';
        $ua_os = 'unknown';

        // Browser detection:
        if (strpos($ua, 'firefox') !== false) $ua_browser = 'firefox';
        else if (strpos($ua, 'msie') !== false) $ua_browser = 'ie';
        else if (strpos($ua, 'opera') !== false)
        {
                if (strpos($ua, 'opera mini ') === false) $ua_browser = 'opera';
                else $ua_browser = 'operamini';
        }
        else if (strpos($ua, 'mozilla') !== false && strpos($ua, 'rv:') !== false) $ua_browser = 'mozilla';
        else if (strpos($ua, 'netscape') !== false) $ua_browser = 'netscape';
        else if (strpos($ua, 'safari') !== false) $ua_browser = 'safari';
        else if (strpos($ua, 'epiphany') !== false) $ua_browser = 'epiphany';
        else if (strpos($ua, 'galeon') !== false) $ua_browser = 'galeon';
        else if (strpos($ua, 'konqueror') !== false) $ua_browser = 'konqueror';
        else if (strpos($ua, 'firebird') !== false) $ua_browser = 'firebird';
        else if (strpos($ua, 'avant browser') !== false) $ua_browser = 'avant';
        else if (strpos($ua, 'maxthon') !== false || strpos($ua, 'myie') !== false) $ua_browser = 'maxthon';
        else if (strpos($ua, 'slimbrowser') !== false) $ua_browser = 'slimbrowser';
  else if (strpos($ua, 'chrome') !== false) $ua_browser = 'gc';



        // OS detection:

  if (strpos($ua, 'windows nt 6.1') !== false) $ua_os = 'win_7';
        else if (strpos($ua, 'windows nt 5.0') !== false) $ua_os = 'windows_98_nt_2000';
        else if (strpos($ua, 'windows 95') !== false) $ua_os = 'windows_98_nt_2000';
        else if (strpos($ua, 'windows me') !== false) $ua_os = 'windows_me';
        else if (strpos($ua, 'windows 98') !== false) $ua_os = 'windows_98_nt_2000';
        else if (strpos($ua, 'windows nt 5.2') !== false || strpos($ua, 'windows nt 5.1') !== false) $ua_os = 'windows_xp_2003';
        else if (strpos($ua, 'windows nt 6.0') !== false) $ua_os = 'windows_vista';
       

else if (strpos($ua, 'linux') !== false)
        {
                if (strpos($ua, 'debian') !== false) $ua_os = 'linuxdebian';
                else if (strpos($ua, 'fedora') !== false) $ua_os = 'linuxfedora';
                else if (strpos($ua, 'gentoo') !== false) $ua_os = 'linuxgentoo';
                else if (strpos($ua, 'kateos') !== false || strpos($ua, 'kate os') !== false) $ua_os = 'linuxkateos';
                else if (strpos($ua, 'knoppix') !== false) $ua_os = 'linuxknoppix';
                else if (strpos($ua, 'kubuntu') !== false) $ua_os = 'linuxkubuntu';
                else if (strpos($ua, 'mandriva') !== false || strpos($ua, 'mandrake') !== false) $ua_os = 'linuxmandriva';
                else if (strpos($ua, 'redhat') !== false || strpos($ua, 'red hat') !== false) $ua_os = 'linuxredhat';
                else if (strpos($ua, 'slackware') !== false) $ua_os = 'linuxslackware';
                else if (strpos($ua, 'suse') !== false) $ua_os = 'linuxsuse';
                else if (strpos($ua, 'ubuntu') !== false) $ua_os = 'linuxubuntu';
                else if (strpos($ua, 'arch') !== false) $ua_os = 'linuxarch';
                else $ua_os = 'linux';
        }
        if (strpos($ua, 'iPhone') !== false) $ua_os = 'ipod';
       
        else if (strpos($ua, 'mac os x') !== false) $ua_os = 'macos';


        else if (strpos($ua, 'amiga') !== false) $ua_os = 'amiga';
        else if (strpos($ua, 'beos; ') !== false) $ua_os = 'beos';
        else if (strpos($ua, 'freebsd') !== false) $ua_os = 'freebsd';
        else if (strpos($ua, 'netbsd') !== false) $ua_os = 'netbsd';
        else if (strpos($ua, 'sunos') !== false || strpos($ua, 'solaris') !== false) $ua_os = 'solaris';
        else if (strpos($ua, 'symbian') !== false) $ua_os = 'symbian';
        else if (strpos($ua, 'unix') !== false) $ua_os = 'unix';


$browser = $ua_browser;
$os = $ua_os;

$vbulletin->db->query_write("INSERT INTO " . TABLE_PREFIX . "postinfo (postid, OS, browser) VALUES (" . $post['postid'] . ",'$os' ,'$browser')");

Then edit Display the information on postbit:

Find:
Code:

$osname = array(
Add after:
Code:

'win_7' => "Windows 7",
Then i used this icon (leave it named what it is) Add it to images/useragent:

Thanks ;)

Joshkrz 10-27-2009 02:38 PM

Quote:

Originally Posted by smokin1337 (Post 1897608)
I added windows 7 but had to delete windows 98 from the xml to make it work. To do it go into Plugins->Manage Plugins->Display OS and Browser->save on new post

Repalce ALL with:
Code:

$useragent = $_SERVER ? $_SERVER['HTTP_USER_AGENT'] : $HTTP_SERVER_VARS['HTTP_USER_AGENT'];
    $ua = strtolower($useragent);
    $ua_browser = 'unknown';
    $ua_os = 'unknown';

    // Browser detection:
    if (strpos($ua, 'firefox') !== false) $ua_browser = 'firefox';
    else if (strpos($ua, 'msie') !== false) $ua_browser = 'ie';
    else if (strpos($ua, 'opera') !== false)
    {
        if (strpos($ua, 'opera mini ') === false) $ua_browser = 'opera';
        else $ua_browser = 'operamini';
    }
    else if (strpos($ua, 'mozilla') !== false && strpos($ua, 'rv:') !== false) $ua_browser = 'mozilla';
    else if (strpos($ua, 'netscape') !== false) $ua_browser = 'netscape';
    else if (strpos($ua, 'safari') !== false) $ua_browser = 'safari';
    else if (strpos($ua, 'epiphany') !== false) $ua_browser = 'epiphany';
    else if (strpos($ua, 'galeon') !== false) $ua_browser = 'galeon';
    else if (strpos($ua, 'konqueror') !== false) $ua_browser = 'konqueror';
    else if (strpos($ua, 'firebird') !== false) $ua_browser = 'firebird';
    else if (strpos($ua, 'avant browser') !== false) $ua_browser = 'avant';
    else if (strpos($ua, 'maxthon') !== false || strpos($ua, 'myie') !== false) $ua_browser = 'maxthon';
    else if (strpos($ua, 'slimbrowser') !== false) $ua_browser = 'slimbrowser';
  else if (strpos($ua, 'chrome') !== false) $ua_browser = 'gc';



    // OS detection:

  if (strpos($ua, 'windows nt 6.1') !== false) $ua_os = 'win_7';
    else if (strpos($ua, 'windows nt 5.0') !== false) $ua_os = 'windows_98_nt_2000';
    else if (strpos($ua, 'windows 95') !== false) $ua_os = 'windows_98_nt_2000';
    else if (strpos($ua, 'windows me') !== false) $ua_os = 'windows_me';
    else if (strpos($ua, 'windows 98') !== false) $ua_os = 'windows_98_nt_2000';
    else if (strpos($ua, 'windows nt 5.2') !== false || strpos($ua, 'windows nt 5.1') !== false) $ua_os = 'windows_xp_2003';
    else if (strpos($ua, 'windows nt 6.0') !== false) $ua_os = 'windows_vista';
   

else if (strpos($ua, 'linux') !== false)
    {
        if (strpos($ua, 'debian') !== false) $ua_os = 'linuxdebian';
        else if (strpos($ua, 'fedora') !== false) $ua_os = 'linuxfedora';
        else if (strpos($ua, 'gentoo') !== false) $ua_os = 'linuxgentoo';
        else if (strpos($ua, 'kateos') !== false || strpos($ua, 'kate os') !== false) $ua_os = 'linuxkateos';
        else if (strpos($ua, 'knoppix') !== false) $ua_os = 'linuxknoppix';
        else if (strpos($ua, 'kubuntu') !== false) $ua_os = 'linuxkubuntu';
        else if (strpos($ua, 'mandriva') !== false || strpos($ua, 'mandrake') !== false) $ua_os = 'linuxmandriva';
        else if (strpos($ua, 'redhat') !== false || strpos($ua, 'red hat') !== false) $ua_os = 'linuxredhat';
        else if (strpos($ua, 'slackware') !== false) $ua_os = 'linuxslackware';
        else if (strpos($ua, 'suse') !== false) $ua_os = 'linuxsuse';
        else if (strpos($ua, 'ubuntu') !== false) $ua_os = 'linuxubuntu';
        else if (strpos($ua, 'arch') !== false) $ua_os = 'linuxarch';
        else $ua_os = 'linux';
    }
    if (strpos($ua, 'iPhone') !== false) $ua_os = 'ipod';
   
        else if (strpos($ua, 'mac os x') !== false) $ua_os = 'macos';


    else if (strpos($ua, 'amiga') !== false) $ua_os = 'amiga';
    else if (strpos($ua, 'beos; ') !== false) $ua_os = 'beos';
    else if (strpos($ua, 'freebsd') !== false) $ua_os = 'freebsd';
    else if (strpos($ua, 'netbsd') !== false) $ua_os = 'netbsd';
    else if (strpos($ua, 'sunos') !== false || strpos($ua, 'solaris') !== false) $ua_os = 'solaris';
    else if (strpos($ua, 'symbian') !== false) $ua_os = 'symbian';
    else if (strpos($ua, 'unix') !== false) $ua_os = 'unix';


$browser = $ua_browser;
$os = $ua_os;

$vbulletin->db->query_write("INSERT INTO " . TABLE_PREFIX . "postinfo (postid, OS, browser) VALUES (" . $post['postid'] . ",'$os' ,'$browser')");

Then edit Display the information on postbit:

Find:
Code:

$osname = array(
Add after:
Code:

'win_7' => "Windows 7",
Then i used this icon (leave it named what it is) Add it to images/useragent:


There isn't a "$osname = array(" anywhere.

smokin1337 10-27-2009 07:10 PM

This is the entire plugin Display information on postbit with win 7 added:

Code:

$os = $post['OS'];
$browser = $post['browser'];

iF (!empty($os) && !empty($browser)) {
  $browsername = array(
                  'firefox' => "Mozilla Firefox",
                  'ie' => "Windows Internet Explorer",
                  'opera' => "Opera",
                  'operamini' => "Opera Mini",
                  'mozilla' => "Mozilla",
                  'netscape' => "Netscape Navigator",
                  'safari' => "Safari",
                  'epiphany' => "Epiphany",
                  'galeon' => "Galeon",
                  'konqueror' => "Konqueror",
                  'firebird' => "Mozilla Firebird",
                  'avant' => "Avant Browser",
                  'maxthon' => "Maxthon",
                  'slimbrowser' => "SlimBrowser",
                  'gc' => "Google Chrome"
                  );

  $osname = array(
            'win_7' => "Windows 7",
            'windows_xp_2003' => "Windows XP/2003",
            'windows_vista' => "Windows Vista",
            'linuxdebian' => "Debian",
            'linuxfedora' => "Fedora",
            'linuxgentoo' => "Gentoo Linux",
            'linuxkateos' => "KateOS",
            'linuxknoppix' => "knoppix",
            'linuxkubuntu' => "Kubuntu",
            'linuxmandriva' => "Mandriva Linux",
            'linuxredhat' => "Red Hat Linux",
            'linuxslackware' => "Slackware",
            'linuxsuse' => "OpenSUSE",
            'linuxubuntu' => "Ubuntu",
            'linuxarch' => "Arch Linux",
            'linux' => "Linux",
            'macos' => "Mac OS",
            'amiga' => "Amiga",
            'beos' => "BeOS",
            'freebsd' => "FreeBSD",
            'netbsd' => "NetBSD",
            'solaris' => "Solaris",
            'symbian' => "Symbian OS",
            'unix' => "Unix",
            'windows_98_nt_2000' => "Windows 98/NT/2000",
            'windows_me' => "Windows ME"
            );

  $os_name = $osname[$os];
  $os_name = empty($os_name) ? $os : $os_name;
  $browser_name = $browsername[$browser];
  $browser_name = empty($browser_name) ? $browser : $browser_name;

  $template_hook['postbit_userinfo_right'] .= "<img src='images/useragent/icon_$os.gif' alt='$os_name' /> <img src='images/useragent/icon_$browser.gif' alt='$browser_name' />";
}


tomalla 10-29-2009 03:12 PM

Again Windows7
I've installed today this product. Information about Windows7 doesn't displayed. How to add Windows 7 icon and correct displaying info about windows 7. Actually windows 7 is displayed as windows nt,2000

bollie 10-29-2009 03:30 PM

I have code matched

Look http://www.pctuts.be/f182/installere...spyware-32690/ work for windows 7

samdu 04-16-2010 06:22 PM

I got Windows 7 working pretty easily. Now Chrome on the other hand, not so much. I added a line in the Detect Browser section that should work and uploaded a matching icon to the proper location, but Chrome on MacOS still shows up as Safari. Is this a Chrome thing or something I'm missing in the Mod?

samdu 04-16-2010 06:26 PM

Update: Chrome shows up as Safari in Windows as well.

lav0s 09-15-2010 03:08 AM

any hope of seeing this on 4?

prologe60 10-03-2010 08:34 PM

Good morning, I love this plugin you've adapted to vbulletin. But I have a problem is that every time I post on my forum with Google Chrome I get the Safari icon. I added the line mentioned above but I still have the same problem. If you can fix it please post the solution.

Greetings

bollie 12-05-2010 01:50 PM

Look @ http://www.pctuts.be/f3/forum-bezoekers-37675/

Georgio H 01-07-2011 03:04 PM

Mhm, it's a nice plugin i love it but it doesn't work that well..

I run windows 7 and it shows that i run windows 98? hahaha :P

Anything that's wrong?

Thanks.

danyxxx 09-18-2011 06:55 AM

Is not working on 3.8.7 ...

EliasAlucard 04-29-2012 11:56 AM

Quote:

Originally Posted by Georgio H (Post 2145464)
Mhm, it's a nice plugin i love it but it doesn't work that well..

I run windows 7 and it shows that i run windows 98? hahaha :P

Anything that's wrong?

Thanks.

No, nothing wrong. The original author of this plugin did not include Windows 7. I've added Windows 7, Android and other operating systems in my modified version.

Quote:

Originally Posted by X-or (Post 2145370)
I am looking for a similar product but showing OS browser name too, not just icons.
This mod flaw is that not everyone can figure out the icons meaning.

I've added more diversified icons for each specific operating system version. I'll continue improving this plugin, perhaps I'll upload my modified version later as a new plugin once I'm finished.

Quote:

Originally Posted by X-or (Post 2147441)
Is it possible to have something that resemble that:
http://www.emulab.it/forum/index.php?topic=422

That's a bit difficult to implement with my current coding skills, although it's an interesting challenge I'm willing to take on.

Quote:

Originally Posted by danyxxx (Post 2247420)
Is not working on 3.8.7 ...

It works fine here on 3.8.7 so you must have done something wrong. Has anyone tried this plugin with vB4 by the way?

EliasAlucard 05-10-2012 02:03 PM

Anyone here knows if this plugin works with vB4?

EliasAlucard 07-11-2012 09:24 AM

Here's my more up to date replacement, UADisplay:

https://vborg.vbsupport.ru/showthread.php?t=285373

sadiq6210 08-08-2012 05:18 PM

I need it for vb4 =(

EliasAlucard 08-08-2012 10:00 PM

Quote:

Originally Posted by sadiq6210 (Post 2355604)
I need it for vb4 =(

Here's my update, works on vB4:

https://vborg.vbsupport.ru/showthread.php?t=285373


All times are GMT. The time now is 03:30 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01467 seconds
  • Memory Usage 1,844KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (10)bbcode_code_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (20)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete