View Full Version : Forum Display Enhancements - UADisplay
EliasAlucard
07-09-2012, 10:00 PM
UADisplay is an abbreviation of User Agent Display. This is my modification (or update if you will) of Fighter1405's original plugin:
https://vborg.vbsupport.ru/showthread.php?t=219687
Because he hasn't made a post since 2009, I decided to update his useful plugin with the latest operating systems and browsers in mind (which were lacking in his version), and also I've added a lot of other operating systems (Windows 7, Android, iOS, various Linux distributions, *BSDs, etc.) and other obscure and rarely used browsers, among other user agents. I also redid the icons completely, this time with a height of 24 pixels (previously it was 18 pixels).
If you've been using Fighter's old version, I'd recommend to uninstall his plugin before you install my version, since it's not possible to have them both installed.
I intend to add OS and browser version numbering too, kind of like you can see here:
http://www.emulab.it/forum/index.php?topic=422
This one is a bit complicated though, as it requires a lot of code and I'm not sure if this is even supported by vBulletin 3. I know it works in vBulletin 4 however. If you want to give me a helping hand and suggestions with the code, I could add this faster, as I'm newbie programmer and still learning.
What this plugin does is to add two icons in the postbit of operating system and browser. An example of what it looks like, using Android 4 Ice Cream Sandwich:
https://vborg.vbsupport.ru/external/2014/12/7.png
Install steps:
1. Upload the icon folder to images/useragent
2. Import the XML file through Manage Products in admincp
EliasAlucard
07-10-2012, 09:16 PM
Those of you who have downloaded it and installed it, I'd appreciate any feedback from you, what you think can be improved and updated and added or removed. Any browser or operating system you think should be included? All user agent strings (complete at that, from the server logs and not from the who's online php page) are welcome.
tommydamic68
07-10-2012, 10:16 PM
any instructions? i have uploaded folder with icons to www.mysite/images/useragent and uploaded the xml file. no icons though.
EliasAlucard
07-10-2012, 10:20 PM
any instructions? i have uploaded folder with icons to www.mysite/images/useragent and uploaded the xml file. no icons though.No instructions are needed. You need to import the XML file in admincp, and then the plugin should work.
tommydamic68
07-10-2012, 10:24 PM
nope, uploaded folder, installed xml no icons. using 3.8.7
tommydamic68
07-10-2012, 10:30 PM
Maybe a post bit legacy issue?
EliasAlucard
07-10-2012, 10:34 PM
nope, uploaded folder, installed xml no icons. using 3.8.7I'm using 3.8.7 and it's working just fine.
Maybe a post bit legacy issue?Yeah, could be. Do you have any other postbit plugins installed? It could be that you've tampered with your postbit using other plugins or something. It's difficult to say what your problem is. It would be nice if someone else could duplicate your problem.
tommydamic68
07-10-2012, 10:49 PM
yeah, i do have some other template mods. oh well, worth a try.
thanks,
EliasAlucard
07-11-2012, 05:28 AM
yeah, i do have some other template mods. oh well, worth a try.
thanks,Could you try temporarily disabling those mods to see if it works?
cheech47
07-11-2012, 06:16 AM
Works perfect for me on 3.8.7, I Had an old plugin that was similar but this new one is ace :D
Hornstar
07-11-2012, 09:45 AM
yeah, i do have some other template mods. oh well, worth a try.
thanks,
Maybe your missing a needed hook.
EliasAlucard
07-11-2012, 11:07 AM
Here's a good site for you to check your user agent string (for the more unusual browsers and operating systems) and give it to me so I can add it:
http://id.furud.net/
Also, I could need some help from a skilled developer in adding the version number next to the icons. All help is appreciated.
EliasAlucard
08-02-2012, 12:29 AM
I've tested it with vBulletin 4.2 now, and it works just as good as on 3.8.7. I'll upload the 1.1 version soon.
Gadget_Guy
08-05-2012, 12:58 AM
It's working for me on all new posts. Doesn't seem to affect posts made previous to install.
However... I would like to change the alignment of the icons.
See my screen shot.... How can I align them to the left?
D.
EliasAlucard
08-06-2012, 03:31 PM
It's working for me on all new posts. Doesn't seem to affect posts made previous to install.
However... I would like to change the alignment of the icons.
See my screen shot.... How can I align them to the left?
D.No, it doesn't work on older posts because the posts that were made before you installed the plugin, never saved a user agent.
Next thing I'm going to work on (aside from adding new user agents and icons) is adding version number and operating system/browser name as descriptive text. Once that is done, I'll try to add icon positioning. I'm also going to release a vB4 version.
Gadget_Guy
08-06-2012, 10:30 PM
Just wanted to say that my users love this addition to our forum.
Nice work!
D.
Gadget_Guy
08-08-2012, 11:36 PM
If I could make a suggestion.....
If people use TapaTalk - Nothing displayed or Forum Runner - two question marks.
Not sure how hard it would be to identify users that use these programs but it would be neat.
D.
S@NL - BlackBik
08-14-2012, 04:56 PM
Thanks for this mod. I've installed without problems.
But... as you would guess, there are users that don't like all the information in the postbit. They like their forums lean and mean.
So I've made the showing of the OS and browser icons optional.
This is how I did it.
- First I've created a new single-selection radio buttons userfield (see attachment)
- Then I've changed the plugin “Display the information on postbit”. The code in red are my additions:
global $vbulletin;
$os = $post['OS'];
$browser = $post['browser'];
if ($vbulletin->userinfo['field29'] != "No") {
if($os != "" && $browser != "") {
$template_hook['postbit_userinfo_right'] .= "<img src='images/useragent/icon_$os.png' alt='$os' /><img src='images/useragent/icon_$browser.png' alt='$browser' />";
}
}
"field29" should be replaced by the number of the userfield you've created.
That's all. Feel free to use this addition anyway you like.
S@NL - BlackBik
08-18-2012, 01:08 PM
On vBulletin 4.2 there is a problem with the feature that prevents doubleposting.
When posting in the same thread twice within the time the administrator has set to merge the posts, you get a database error on the second post. The postid already exists in the browerosinfo table.
I've corrected this problem by adding some code to the "save on new post" plugin of this product (new code is bold and red):
global $db;
$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, 'epiphany') !== false) $ua_browser = 'epiphany';
else if (strpos($ua, 'galeon') !== false) $ua_browser = 'galeon';
code deleted just to make this post readable. Do not delete this code in the plugin!!!
else if (strpos($ua, 'macintosh') !== false || strpos($ua, 'mac') !== false) $ua_os = 'macos';
$browser = $ua_browser;
$os = $ua_os;
$double = $db->query_first("
SELECT postid
FROM " . TABLE_PREFIX . "browserosinfo
WHERE postid =" . $post['postid']
);
if (empty($double))
{
$vbulletin->db->query_write("INSERT INTO " . TABLE_PREFIX . "browserosinfo (postid, OS, browser) VALUES (" . $post['postid'] . ",'$os' ,'$browser')");
}
EliasAlucard
08-19-2012, 06:18 AM
^^ Excellent additions S@NL - BlackBiker, I'll include this code of yours into the plugin if you don't mind.
By the way, is it possible that I release this plugin under the GNU GPL v3? Fighter1405 based his plugin on this phpBB plugin (http://community.mybb.com/showthread.php?tid=20953), and that plugin doesn't have a license, but it says:
"I used pieces of code and icons I found somewhere by Google... hopefully I didn't break any copirights."
S@NL - BlackBik
08-19-2012, 12:53 PM
I don't mind. That's why I posted it here ;)
I'm not a coder and my knowledge of copyright is minuscule. I'm sorry to say I can't answer that question.
home9000
09-23-2012, 09:57 AM
I need to display icons from another url out side my website
What should I hav to change ?
S@NL - BlackBik
09-25-2012, 10:45 AM
You will have to change de url to the image in the plugin "Display the information on postbit".
But this only works when the base url is the same for every image and the image names must be equal to the names that are used in this add-on.
home9000
09-25-2012, 05:22 PM
You will have to change de url to the image in the plugin "Display the information on postbit".
But this only works when the base url is the same for every image and the image names must be equal to the names that are used in this add-on.
I did it but still give me the local url + the new url
Dan49
10-06-2012, 10:45 PM
Thank you for this modification.
I want the browser and OS information visible to administrators only. It would be nice to have this as an option in admincp, but I'll be happy with instructions on which code to edit too. I must wait for this before installing.
EliasAlucard
03-02-2013, 11:27 AM
Hi guys, sorry for the lack of updates on this plugin, but I've moved on to vB4, and I've released a vB4 hack similar to this plugin, but much better. I'll be working on it from now on:
https://vborg.vbsupport.ru/showthread.php?t=295667
This plugin is now in the graveyard.
Chris8
06-23-2013, 01:45 PM
Where is the file? :) Is vb4 one compatible with vb3?
d0zer
12-27-2014, 06:09 PM
files ?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.