vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Browser on Who's Online (https://vborg.vbsupport.ru/showthread.php?t=103996)

derekivey 12-28-2005 10:00 PM

Browser on Who's Online
 
Browser on Who's Online
Developers: derekivey
Version: 1.0.2
vBulletin Version: 3.5.5 (3.6.0 version available here)
File Edits: 2
Template Edits: 1
New Phrases: 8
Uses Plugins: Yes
Difficulty: Easy

Description: This hack will show each user's browser in the Who's Online Box beside their name. It supports IE, Firefox, Opera, Camino, Safari, Konqueror, and Netscape. If the user is using a browser that is unsupported with this hack, it will show a Question mark icon, which means its an Unknown browser.

*** I Strongly Recommend That You Backup Before Installing/Upgrading This Hack! ***

Planned features for a later release:
  • Add support for more browsers.
  • Add browser to online.php
  • Show only 1 image for each browser when there is more than 1 person with that browser.
  • Whatever is suggested.
Features/Changes in Version 1.0.2:
  • Fixed SQL bug
Features/Changes in Version 1.0.1:
  • Moved browsers to session table.
  • Removed 'Unknown' from being stored in database, replaced it with Psionic Vision's suggestion.
This was a hack request by ReadOrDie.

Note: If you are using vBadvanced CMPS, please follow 350Chevy's post to get this hack working on it, if you want to show their browser on the CMPS' Who's Online.

I have added screen shots of this hack in action below.

Please click https://vborg.vbsupport.ru/ If you installed this hack.

Thanks!

Impreza04 12-29-2005 08:45 PM

Wow.. nice idea

I'll give this a go in a minute :)

derekivey 12-29-2005 08:51 PM

Thanks, let me know if you have any problems. I tested it on my public site and my test board and it works for me.

akanevsky 12-29-2005 08:58 PM

This hack has poor code for the following reasons:
- It does not treat strings as strings, rather as constants. PHP, however, will only show an error if there is an E_NOTICE error reporting turned on.
- It is completely unnecessary to alter user table and save browser informations.
- Addslashes() is deprected in vbulletin 3.5. Use $db->escape_string() instead.
- There is no point in the "unknown" value. That value will just take up db space. Why not make a default empty string which will return false when accessed. E.g. you can change <if condition="$loggedin[browser] == unknown"> to <if condition="!$loggedin[browser]"> if you do that.

That said, I like the idea. Only, I think I've seen the same thing released a couple of days ago. Maybe I have hallucations, Idk :(

derekivey 12-29-2005 09:02 PM

What do you mean it treats them as constants? Can I see an example of what you mean please?

Also, how would you suggest that I store the browsers then??

akanevsky 12-29-2005 09:06 PM

Quote:

What do you mean it treats them as constants?
A string must be wrapped in single or double quotes.
When you call is_browser(ie), it looks for a constant IE. Because PHP is a very non-restrictive language, it then treats ie as a string, even though it is not; it will only display an error if E_NOTICE is enabled. But since vBulletin error reporting is E_ALL ^ E_NOTICE, you don't see the error.

The right way would be using is_browser('ie').

Quote:

Also, how would you suggest that I store the browsers then??
I would store browser information in the session table, because there it is temporary and deleted automatically when the user leaves the board.

derekivey 12-29-2005 09:12 PM

Ok, I fixed the first thing. I'll take a look at the rest later. I uploaded a new zip file.

akanevsky 12-29-2005 09:20 PM

Nice. Also, you can get a list of all vbulletin-detectable browser from the is_browser function itself :)

PHP Code:

        $is = array(
            
'opera' => 0,
            
'ie' => 0,
            
'mozilla' => 0,
            
'firebird' => 0,
            
'firefox' => 0,
            
'camino' => 0,
            
'konqueror' => 0,
            
'safari' => 0,
            
'webkit' => 0,
            
'webtv' => 0,
            
'netscape' => 0,
            
'mac' => 0
        
); 


swa 12-29-2005 09:21 PM

nice idea!

derekivey 12-29-2005 09:46 PM

Ok, zip file has been updated. I changed addslashes to $db->escape_string.


All times are GMT. The time now is 04:02 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.01207 seconds
  • Memory Usage 1,748KB
  • 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
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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