Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard

Reply
 
Thread Tools
UADisplay Details »»
UADisplay
Version: 1.00, by EliasAlucard EliasAlucard is offline
Developer Last Online: Jul 2020 Show Printable Version Email this Page

Category: Forum Display Enhancements - Version: 3.8.7 Rating:
Released: 07-09-2012 Last Update: Never Installs: 7
DB Changes Uses Plugins Auto-Templates
Re-useable Code Additional Files  
No support by the author.

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:



Install steps:
1. Upload the icon folder to images/useragent
2. Import the XML file through Manage Products in admincp

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 07-11-2012, 09:45 AM
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Location: Australia
Posts: 2,469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tommydamic68 View Post
yeah, i do have some other template mods. oh well, worth a try.

thanks,
Maybe your missing a needed hook.
Reply With Quote
  #13  
Old 07-11-2012, 11:07 AM
EliasAlucard's Avatar
EliasAlucard EliasAlucard is offline
 
Join Date: Nov 2009
Location: Sweden
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #14  
Old 08-02-2012, 12:29 AM
EliasAlucard's Avatar
EliasAlucard EliasAlucard is offline
 
Join Date: Nov 2009
Location: Sweden
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #15  
Old 08-05-2012, 12:58 AM
Gadget_Guy Gadget_Guy is offline
 
Join Date: Jun 2010
Posts: 271
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #16  
Old 08-06-2012, 03:31 PM
EliasAlucard's Avatar
EliasAlucard EliasAlucard is offline
 
Join Date: Nov 2009
Location: Sweden
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Gadget_Guy View Post
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.
Reply With Quote
  #17  
Old 08-06-2012, 10:30 PM
Gadget_Guy Gadget_Guy is offline
 
Join Date: Jun 2010
Posts: 271
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just wanted to say that my users love this addition to our forum.

Nice work!

D.
Reply With Quote
  #18  
Old 08-08-2012, 11:36 PM
Gadget_Guy Gadget_Guy is offline
 
Join Date: Jun 2010
Posts: 271
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #19  
Old 08-14-2012, 04:56 PM
S@NL - BlackBik's Avatar
S@NL - BlackBik S@NL - BlackBik is offline
 
Join Date: Jul 2004
Location: Netherlands
Posts: 307
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:

Code:
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.
Reply With Quote
  #20  
Old 08-18-2012, 01:08 PM
S@NL - BlackBik's Avatar
S@NL - BlackBik S@NL - BlackBik is offline
 
Join Date: Jul 2004
Location: Netherlands
Posts: 307
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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):

Code:
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')");
}
Reply With Quote
  #21  
Old 08-19-2012, 06:18 AM
EliasAlucard's Avatar
EliasAlucard EliasAlucard is offline
 
Join Date: Nov 2009
Location: Sweden
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

^^ 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, 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."
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:00 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.06608 seconds
  • Memory Usage 2,307KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete