The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Display OS and Browser Information on Postbit Details »» | |||||||||||||||||||||||||||||||
Display OS and Browser Information on Postbit
Developer Last Online: Sep 2011
Hey all,
First plugin, so I hope I'm doing this right! As requested here, it'll display a small icon for both the users operating system and browser on the postbit. Install steps: 1. Upload the Product 2. upload icon images for each os/browser to images/useragent in the form icon_(browser/os).gif - Sample Icons attached Thanks to this mybb mod for the sample images and some of the browser detection code. Screenshot: Thanks and let me know if you have any problems! Download Now
Show Your Support
|
Comments |
#82
|
|||
|
|||
Installed.
Doesn't show any icons No settings in ACP or anywhere! UNINSTALLED. |
#83
|
||||
|
||||
opdate please for windows 7
|
#84
|
|||
|
|||
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')"); Find: Code:
$osname = array( Code:
'win_7' => "Windows 7", |
#85
|
||||
|
||||
Quote:
|
#86
|
|||
|
|||
Quote:
There isn't a "$osname = array(" anywhere. |
#87
|
|||
|
|||
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' />"; } |
#88
|
|||
|
|||
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 |
#89
|
||||
|
||||
|
#90
|
|||
|
|||
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?
|
#91
|
|||
|
|||
Update: Chrome shows up as Safari in Windows as well.
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|