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.

akanevsky 12-29-2005 09:51 PM

Ok, now if you expand the browsers list and move browser identification storage to session table, that'll be the best.

Hint: class_core.php, line 2514:
PHP Code:

$this->set('useragent'USER_AGENT); 


rb290 12-29-2005 11:05 PM

mines displays on the "Members who have visited in the last 24 hours", and shows those ones as the ? picture, also how come all the pics are bordered by a blue box ?

rb290 12-29-2005 11:09 PM

this what looks like:

http://img506.imageshack.us/img506/20/jhj7yf.jpg

derekivey 12-29-2005 11:25 PM

Add border="0" to each of the images in the conditionals. That should fix it.

rb290 12-29-2005 11:30 PM

thanks
do you know how I can make it only appear on the Whos On Line?

YOimYO 12-30-2005 11:36 AM

ok. i have problems, and need to uninstall it. but the auto uninstaller isnt working. what do i need to delete off the database to remove this. ???




Code:

Invalid SQL:
ALTER TABLE `user` DROP `browser`;;

MySQL Error  : Can't DROP 'browser'. Check that column/key exists
Error Number : 1091
Date        : Friday, December 30th 2005 @ 08:50:11 AM


YOimYO 12-30-2005 12:26 PM

ok. i have disabled it. and my forum still works. but .... what changes were made to any temlates that i need to manually cahgne back ?

derekivey 12-30-2005 01:54 PM

What kind of problem were you having? Because that uninstall error means that the browser field was never added to the user table. If you want to just uninstall my hack, all you have to do now is just revert the edited templates or if you have customized them before you can just take out the edits you made for my hack. Also you will need to take out the file edits.

YOimYO 12-30-2005 02:18 PM

Quote:

Originally Posted by derekivey
What kind of problem were you having? Because that uninstall error means that the browser field was never added to the user table. If you want to just uninstall my hack, all you have to do now is just revert the edited templates or if you have customized them before you can just take out the edits you made for my hack. Also you will need to take out the file edits.


yeah i did all that. was just wanting to make sure that it didnt do anything else that i needed to change :)


thx :)


but anyhow what i tried to do was install it on vb 3.5.0 and there is NO Skype ;)

so it gave errors, then sql erros .... but its back to norm. I would Like to try this on 3.5.0 though :)


let me know if you have a fix for the database table edits ;)



thx :)

bashy 12-30-2005 05:52 PM

Hi

I started to install this but once the manual edits were complete i checked my site and it gave a database error, so i removed all edits and now my Online Users looks like this..

a href="member.php?u=1">Bashy, a href="member.php?u=13">bezo, a href="member.php?u=4">tango232, a href="member.php?u=119">mickriss, MSNBot

Please advise ASAP as it looks a tad silly :(

Regards

Bashy
www.bashys-place.com

derekivey 12-30-2005 06:10 PM

Hi, did you import the product?

derekivey 12-30-2005 06:16 PM

Quote:

Originally Posted by YOimYO
yeah i did all that. was just wanting to make sure that it didnt do anything else that i needed to change :)


thx :)


but anyhow what i tried to do was install it on vb 3.5.0 and there is NO Skype ;)

so it gave errors, then sql erros .... but its back to norm. I would Like to try this on 3.5.0 though :)


let me know if you have a fix for the database table edits ;)



thx :)

Zip file updated. Please try now, it should work now.

derekivey 12-30-2005 06:17 PM

bashy, try reverting the templates that were changed.

bashy 12-30-2005 06:17 PM

Hi m8

No, i didnt get that far...

Quote:

Originally Posted by derekivey
Hi, did you import the product?


bashy 12-30-2005 06:26 PM

I have reverted all that i changed, i have also triple checked everything :(

Bashy

bashy 12-30-2005 06:42 PM

Heres a screen shot of the issue..

I have just checked the template and index.php edits and there deffo back to there original state!

Bashy

bashy 12-30-2005 06:56 PM

Right...

I have just reinstalled it all and the images are working fine, but i still get
a href="member.php?u=1"> in front of the usernames...
It looks like its lost the link to the members profile from that point on the
forum, so something as messed up somwhere.... and is only showing the raw code...

This is where the problem lies, somewhere in here, well, from what i can tell lol
this is my "forumhome_loggedinuser" When i removed the edits the 1st time,
did i take something else out by accident?
Code:

<if condition="$loggedin[userid]">a href="member.php?$session[sessionurl]u=$loggedin[userid]">$loggedin[musername]</a>$loggedin[invisiblemark]$loggedin[buddymark]<else />$loggedin[musername]</if>
Any ideas yet please?

What have i cocked up, what would cause this?

Bashy

derekivey 12-30-2005 07:04 PM

You are missing a < in front of a href="member.php.

bashy 12-30-2005 07:07 PM

Sounds good to me :) cheers m8, that sorted it..

It helps when ya got all the info in front of you ;)

Thanks again, great little hack.... *bashy runs to click install*

Thanks again for ya patience

Bashy

Quote:

Originally Posted by derekivey
You are missing a < in front of a href="member.php.


4number8 12-30-2005 07:25 PM

Working on 3.5.1, You don't have images for a dark type forum do you? thanks for this btw, pretty cool.

derekivey 12-30-2005 08:29 PM

Nope sorry, don't have any images for a dark forum. I just found those images on Google's Image Search and edited them so they would have a transparent background.

4number8 12-30-2005 09:21 PM

Thanks just the same, I have to admit this looks alot better with firefox than with IE

Snake 12-31-2005 12:57 PM

Sweeeeeeeeeeeeeeet!

Thanks.

Feckie (Roger) 12-31-2005 04:47 PM

Nice Addition

And thanks again for the code mod.

Clicks Installs......... :banana:

Mastar 12-31-2005 06:38 PM

Installed and working!

Xtrato 01-02-2006 03:12 AM

Nice Hack this is widely used on IPB boards

Landlord 01-02-2006 03:52 AM

i had this happen...

https://vborg.vbsupport.ru/external/2006/01/13.jpg

derekivey 01-02-2006 04:01 AM

Quote:

Originally Posted by Landlord

Make sure you have a < before your <a href="

Another user had this problem and thats what caused it, a missing < at the beginning of the a href... If you still have problems, please paste your template code here and I will look at it.

Derek

Landlord 01-02-2006 04:07 AM

i don't even see an <a href= anywhere around :rolleyes:


here is my code, and also where do i change the border to 0 at? In the template or in the index.php?




$stylevar[dirmark]<a href="member.php?$session[sessionurl]u=$loggedin[userid]"
<!-- Start: Browser on Who's Online by derekivey - Version 1.0.0 -->
<if condition="$loggedin[browser] == internet_explorer">
<img src="$stylevar[imgdir_misc]/ie.gif" alt="$vbphrase[browser_internet_explorer]" />
</if>
<if condition="$loggedin[browser] == opera">
<img src="$stylevar[imgdir_misc]/opera.gif" alt="$vbphrase[browser_opera]" />
</if>
<if condition="$loggedin[browser] == firefox">
<img src="$stylevar[imgdir_misc]/ff.gif" alt="$vbphrase[browser_firefox]" />
</if>
<if condition="$loggedin[browser] == camino">
<img src="$stylevar[imgdir_misc]/camino.gif" alt="$vbphrase[browser_camino]" />
</if>
<if condition="$loggedin[browser] == konqueror">
<img src="$stylevar[imgdir_misc]/konqueror.gif" alt="$vbphrase[browser_konqueror]" />
</if>
<if condition="$loggedin[browser] == safari">
<img src="$stylevar[imgdir_misc]/safari.gif" alt="$vbphrase[browser_safari]" />
</if>
<if condition="$loggedin[browser] == netscape">
<img src="$stylevar[imgdir_misc]/netscape.gif" alt="$vbphrase[browser_netscape]" />
</if>
<if condition="$loggedin[browser] == unknown">
<img src="$stylevar[imgdir_misc]/question_icon.gif" alt="$vbphrase[browser_unknown]" />
</if>
<!-- End: Browser on Who's Online by derekivey - Version 1.0.0 -->
rel="nofollow">$loggedin[musername]</a>$loggedin[invisiblemark]$loggedin[buddymark]

GamerJunk.net 01-02-2006 04:20 AM

What does this do for guests and spiders?


All times are GMT. The time now is 07:14 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.01738 seconds
  • Memory Usage 1,834KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_php_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
  • (40)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