vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Miscellaneous Hacks - Display OS and Browser Information on Postbit (https://vborg.vbsupport.ru/showthread.php?t=219687)

Fighter1405 07-28-2009 10:00 PM

Display OS and Browser Information on Postbit
 
1 Attachment(s)
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:
http://img18.imageshack.us/img18/738/browsershow.jpg

Thanks and let me know if you have any problems!

Deceptor 07-29-2009 12:44 AM

Nice for a first modification :) I'd suggest the following change so it doesn't clash/break other mods:
Code:

$hook_query_joins = "LEFT JOIN " . TABLE_PREFIX . "postinfo AS postinfo ON (post.postid=postinfo.postid)";
$hook_query_fields = ", postinfo.browser AS browser, postinfo.OS as OS";

To:
Code:

$hook_query_joins .= "LEFT JOIN " . TABLE_PREFIX . "postinfo AS postinfo ON (post.postid=postinfo.postid)";
$hook_query_fields .= ", postinfo.browser AS browser, postinfo.OS as OS";

Basically change = to .= :)

Fighter1405 07-29-2009 12:49 AM

Thanks for the feedback :) I made the change you suggested, makes sense to me :)

erel34 07-29-2009 01:33 AM

Thanks to all

KevinL 07-29-2009 01:35 AM

Nice mod...but how many queries will this add?

bollie 07-29-2009 05:14 AM

Work not for me.
Show not icon_(browser/os).gif

dartho 07-29-2009 07:03 AM

Quote:

Originally Posted by KevinL (Post 1857582)
Nice mod...but how many queries will this add?

Looks like it will add a single query when a post is created.

onlyfree 07-29-2009 09:42 AM

hey nice feature,
but is there a chance to get the possebility for users to turn on/off these icons?

Farman 07-29-2009 10:39 AM

Not working here even, Please give proper instruction, where to upload!

Fighter1405 07-29-2009 10:50 AM

Quote:

Originally Posted by bollie (Post 1857682)
Work not for me.
Show not icon_(browser/os).gif

Quote:

Originally Posted by Farman (Post 1857763)
Not working here even, Please give proper instruction, where to upload!

An example icon name would be "icon_firefox.gif" and that should be in the images/useragent folder, what do you have in that folder?

Quote:

Originally Posted by dartho (Post 1857701)
Looks like it will add a single query when a post is created.

That is correct, it loads the information back through the use of a left join so no extra queries are needed on showthread.

Quote:

Originally Posted by onlyfree (Post 1857742)
hey nice feature,
but is there a chance to get the possebility for users to turn on/off these icons?

You'd like it turned off on a post by post basis or for the user to set it globally on the UCP?

Charlie98902 07-29-2009 11:18 AM

I am using the opposite postbit style you are using and it isn't showing on my board.

onlyfree 07-29-2009 12:53 PM

Quote:

Originally Posted by Charlie98902 (Post 1857775)
I am using the opposite postbit style you are using and it isn't showing on my board.

Go on postbit or postbit_legacy template and put this where you want to have these stats
Code:


$template_hook[postbit_userinfo_right]


@developer. it would be nice if the user could block his os and browser generally for all his posts in his UCP :)

1320Nation 07-29-2009 12:58 PM

Not working....

Database error in vBulletin 3.7.3:

Invalid SQL:
CREATE TABLE `board_postinfo` (
`postid` INT( 6 ) NOT NULL ,
`os` VARCHAR( 20 ) NOT NULL ,
`browser` VARCHAR( 20 ) NOT NULL
) ENGINE = MYISAM ;;

MySQL Error : Table 'board_postinfo' already exists
Error Number : 1050
Request Date : Wednesday, July 29th 2009 @ 10:55:42 AM
Error Date : Wednesday, July 29th 2009 @ 10:55:42 AM
Script : http://www.*****.com/forums/admincp/...=productimport
Referrer : http://www.*****.com/forums/admincp/...?do=productadd
IP Address : ***.****
Username :********
Classname : vB_Database
MySQL Version : 5.0.45

Charlie98902 07-29-2009 01:14 PM

Quote:

Originally Posted by onlyfree (Post 1857803)
Go on postbit or postbit_legacy template and put this where you want to have these stats
Code:


$template_hook[postbit_userinfo_right]


@developer. it would be nice if the user could block his os and browser generally for all his posts in his UCP :)

Nope it is a not go. :(

Fighter1405 07-29-2009 02:03 PM

1 Attachment(s)
Quote:

Originally Posted by Charlie98902 (Post 1857775)
I am using the opposite postbit style you are using and it isn't showing on my board.

Quote:

Originally Posted by onlyfree (Post 1857803)
Go on postbit or postbit_legacy template and put this where you want to have these stats
Code:


$template_hook[postbit_userinfo_right]


That hook does already exist on the new postbit anyway, it should appear right under the post count. Does anything display there? Remember that if you are using quick reply it won't display until you refresh the page.

Quote:

Originally Posted by onlyfree (Post 1857803)
@developer. it would be nice if the user could block his os and browser generally for all his posts in his UCP :)

I'll take a look at implementing that later today :)

Quote:

Originally Posted by psychobike (Post 1857811)
Not working....

Database error in vBulletin 3.7.3:

Invalid SQL:
CREATE TABLE `board_postinfo` (
`postid` INT( 6 ) NOT NULL ,
`os` VARCHAR( 20 ) NOT NULL ,
`browser` VARCHAR( 20 ) NOT NULL
) ENGINE = MYISAM ;;

MySQL Error : Table 'board_postinfo' already exists
Error Number : 1050
Request Date : Wednesday, July 29th 2009 @ 10:55:42 AM
Error Date : Wednesday, July 29th 2009 @ 10:55:42 AM
Script : http://www.*****.com/forums/admincp/...=productimport
Referrer : http://www.*****.com/forums/admincp/...?do=productadd
IP Address : ***.****
Username :********
Classname : vB_Database
MySQL Version : 5.0.45

Sounds like you already have another mod that creates the postinfo table, try the version attached to this post that creates a 'browserosinfo' table instead.

1320Nation 07-29-2009 02:10 PM

No luck...same issue.

Database error in vBulletin 3.7.3:

Invalid SQL:
ALTER TABLE `browserosinfo` ADD PRIMARY KEY ( `postid` );

MySQL Error : Table 'vbulletin.browserosinfo' doesn't exist
Error Number : 1146
Request Date : Wednesday, July 29th 2009 @ 12:07:35 PM
Error Date : Wednesday, July 29th 2009 @ 12:07:35 PM
Script : http://*****.com/forums/admincp/plug...=productimport
Referrer : http://*****.com/forums/admincp/plug...?do=productadd
IP Address : ****
Username : ***
Classname : vB_Database
MySQL Version : 5.0.45

Fighter1405 07-29-2009 02:16 PM

1 Attachment(s)
Quote:

Originally Posted by psychobike (Post 1857858)
No luck...same issue.

Database error in vBulletin 3.7.3:

Invalid SQL:
ALTER TABLE `browserosinfo` ADD PRIMARY KEY ( `postid` );

MySQL Error : Table 'vbulletin.browserosinfo' doesn't exist
Error Number : 1146
Request Date : Wednesday, July 29th 2009 @ 12:07:35 PM
Error Date : Wednesday, July 29th 2009 @ 12:07:35 PM
Script : http://*****.com/forums/admincp/plug...=productimport
Referrer : http://*****.com/forums/admincp/plug...?do=productadd
IP Address : ****
Username : ***
Classname : vB_Database
MySQL Version : 5.0.45

Sorry, that's just me being silly and not testing the version I changed for you. Missing the TABLE_PREFIX. Try this version I uploaded now, and we'll see if we have better luck this time :p

apiasto 07-29-2009 02:27 PM

i tried (5) on 3.8.3 and got this error

MySQL Error : Unknown column 'browserosinfo.browser' in 'field list'
Error Number : 1054

Charlie98902 07-29-2009 02:36 PM

I got the original to work and the new one you just posted to create a table gives me a database error.

Charlie98902 07-29-2009 02:42 PM

Fighter1405

I did notice from the original plugin that if you use the quick reply it won't show the OS to you until you hit f5. Also the other thing I have noticed is that it doesn't update older posts. Can this be accomplished?

Charlie98902 07-29-2009 02:57 PM

Also I know that it isn't released yet but those using Win 7 shows the 98/nt/2000 icon win 7 will be the same as vista's icon I believe?

1320Nation 07-29-2009 02:58 PM

Still no luck...

Invalid SQL:
CREATE TABLE `board_browserosinfo` (
`postid` INT( 6 ) NOT NULL ,
`os` VARCHAR( 20 ) NOT NULL ,
`browser` VARCHAR( 20 ) NOT NULL
) ENGINE = MYISAM ;;

MySQL Error : Table 'board_browserosinfo' already exists
Error Number : 1050
Request Date : Wednesday, July 29th 2009 @ 12:56:05 PM
Error Date : Wednesday, July 29th 2009 @ 12:56:05 PM
Script : http://www.******.com/forums/admincp...=productimport
Referrer : http://www.*******.com/forums/adminc...?do=productadd
IP Address : ******
Username : *****
Classname : vB_Database
MySQL Version : 5.0.45

Fighter1405 07-29-2009 03:29 PM

Quote:

Originally Posted by Charlie98902 (Post 1857869)
Fighter1405

I did notice from the original plugin that if you use the quick reply it won't show the OS to you until you hit f5. Also the other thing I have noticed is that it doesn't update older posts. Can this be accomplished?

I'm afraid it can't be changed retrospectively as the none of the information has been saved for previous posts =/

Quote:

Originally Posted by Charlie98902 (Post 1857881)
Also I know that it isn't released yet but those using Win 7 shows the 98/nt/2000 icon win 7 will be the same as vista's icon I believe?

I'll have a look into that

Quote:

Originally Posted by psychobike (Post 1857885)
Still no luck...

Invalid SQL:
CREATE TABLE `board_browserosinfo` (
`postid` INT( 6 ) NOT NULL ,
`os` VARCHAR( 20 ) NOT NULL ,
`browser` VARCHAR( 20 ) NOT NULL
) ENGINE = MYISAM ;;

MySQL Error : Table 'board_browserosinfo' already exists
Error Number : 1050
Request Date : Wednesday, July 29th 2009 @ 12:56:05 PM
Error Date : Wednesday, July 29th 2009 @ 12:56:05 PM
Script : http://www.******.com/forums/admincp...=productimport
Referrer : http://www.*******.com/forums/adminc...?do=productadd
IP Address : ******
Username : *****
Classname : vB_Database
MySQL Version : 5.0.45

Did you install 4 then 5? That could explain that.

Charlie98902 07-29-2009 03:35 PM

Quote:

I did notice from the original plugin that if you use the quick reply it won't show the OS to you until you hit f5.
What about this?

Fighter1405 07-29-2009 03:45 PM

Quote:

Originally Posted by Charlie98902 (Post 1857919)
What about this?

That probably can be resolved, but it'll need a little figuring out. Users generally don't need to see their own OS and browser anyway, it is more for the benefit of other members :p

1320Nation 07-29-2009 04:07 PM

Quote:

Originally Posted by Fighter1405 (Post 1857914)
I'm afraid it can't be changed retrospectively as the none of the information has been saved for previous posts =/



I'll have a look into that



Did you install 4 then 5? That could explain that.

From what I can see the mod is not installing at all. When importing the product it stops and gives the error's I listed above.

Charlie98902 07-29-2009 04:17 PM

v4 then v5 gave me database errors so I am using the original xml plugin and no errors.

Fighter1405 07-29-2009 04:20 PM

1 Attachment(s)
Quote:

Originally Posted by psychobike (Post 1857937)
From what I can see the mod is not installing at all. When importing the product it stops and gives the error's I listed above.

My guess is that the first time you tried installing number 4 it did part of the installation and then failed, try using the attached file instead (sorry for all this).

Note: No one else should use this file, some of the installation code is missing from it.

1320Nation 07-29-2009 04:25 PM

Quote:

Originally Posted by Fighter1405 (Post 1857944)
My guess is that the first time you tried installing number 4 it did part of the installation and then failed, try using the attached file instead (sorry for all this).

Note: No one else should use this file, some of the installation code is missing from it.

That just crashed my board. [S]How do I uninstall it?[/S] I figured out the uninstall.

Fighter1405 07-29-2009 04:28 PM

Quote:

Originally Posted by psychobike (Post 1857945)
That just crashed my board. How do I uninstall it?

That just crashed your board? I'm very sorry then, although I have no idea why. The standard uninstall function from the admincp should do it. Is the board giving any particular errors?

1320Nation 07-29-2009 04:32 PM

Quote:

Originally Posted by Fighter1405 (Post 1857950)
That just crashed your board? I'm very sorry then, although I have no idea why. The standard uninstall function from the admincp should do it. Is the board giving any particular errors?

The board returned to normal once the uninstall was completed. I can give you more info if needed.

Fighter1405 07-29-2009 04:33 PM

If you could that would be great, I'd like to figure out why it happened. Do you remember what error you were getting?

1320Nation 07-29-2009 04:44 PM

Quote:

Originally Posted by Fighter1405 (Post 1857954)
If you could that would be great, I'd like to figure out why it happened. Do you remember what error you were getting?

Here was the common error:

Invalid SQL:

SELECT
post.*, post.username AS postusername, post.ipaddress AS ip, IF(post.visible = 2, 1, 0) AS isdeleted,
user.*, userfield.*, usertextfield.*,
icon.title as icontitle, icon.iconpath,
avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline,customavatar.width AS avwidth,customavatar.height AS avheight,


editlog.userid AS edit_userid, editlog.username AS edit_username, editlog.dateline AS edit_dateline,
editlog.reason AS edit_reason, editlog.hashistory,
postparsed.pagetext_html, postparsed.hasimages,
sigparsed.signatureparsed, sigparsed.hasimages AS sighasimages,
sigpic.userid AS sigpic, sigpic.dateline AS sigpicdateline, sigpic.width AS sigpicwidth, sigpic.height AS sigpicheight,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid
, '' AS field9, '' AS field11
, gcache.ids as gcacheids, gcache.dateline as gcachedateline, browserosinfo.browser AS browser, browserosinfo.OS as OS
FROM board_post AS post
LEFT JOIN board_user AS user ON(user.userid = post.userid)
LEFT JOIN board_userfield AS userfield ON(userfield.userid = user.userid)
LEFT JOIN board_usertextfield AS usertextfield ON(usertextfield.userid = user.userid)
LEFT JOIN board_icon AS icon ON(icon.iconid = post.iconid)
LEFT JOIN board_avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN board_customavatar AS customavatar ON(customavatar.userid = user.userid)


LEFT JOIN board_editlog AS editlog ON(editlog.postid = post.postid)
LEFT JOIN board_postparsed AS postparsed ON(postparsed.postid = post.postid AND postparsed.styleid = 3 AND postparsed.languageid = 1)
LEFT JOIN board_sigparsed AS sigparsed ON(sigparsed.userid = user.userid AND sigparsed.styleid = 3 AND sigparsed.languageid = 1)
LEFT JOIN board_sigpic AS sigpic ON(sigpic.userid = post.userid)
LEFT JOIN board_gal_cache as gcache ON (post.postid = gcache.postid)LEFT JOIN board_browserosinfo AS postinfo ON (post.postid=browserosinfo.postid)
WHERE post.postid IN (0,263014,263123,263177,263763,263821)
ORDER BY post.dateline;

MySQL Error : Unknown column 'browserosinfo.browser' in 'field list'
Error Number : 1054
Request Date : Wednesday, July 29th 2009 @ 02:22:43 PM
Error Date : Wednesday, July 29th 2009 @ 02:22:43 PM
Script : http://******/forums/garage-sale/255...1-150-tyd.html
Referrer : http://******/forums/garage-sale/
IP Address : *******
Username : slo poke
Classname : vB_Database
MySQL Version :

Fighter1405 07-29-2009 04:48 PM

I see the problem, thanks for copying the error :) Are you interested in a fixed version or not? I don't blame you if you aren't after all the problems you've had with it :p

1320Nation 07-29-2009 04:54 PM

Quote:

Originally Posted by Fighter1405 (Post 1857963)
I see the problem, thanks for copying the error :) Are you interested in a fixed version or not? I don't blame you if you aren't after all the problems you've had with it :p

I appreciate your dedication to your support. Yes after all this I would like to use a working version if possible.

Fighter1405 07-29-2009 04:57 PM

Quote:

Originally Posted by psychobike (Post 1857967)
I appreciate your dedication to your support. Yes after all this I would like to use a working version if possible.

Just before I write it can we do one check so I don't break your board again? Can you load up phpmyadmin (or similar) and check that there is no table on the vbulletin database called 'board_browserosinfo'?

SupraGame 07-30-2009 01:42 AM

im using the original xml and i installed it and have the gifs in the useragent folder, but the images arent displaying. theyre just showing up as

windows_xp_2003firefox for example.

is there something wrong in the template? or do i need to use (4) and (5)?

EDIT: it might be a browser issue or from my computer. not sure. some users can see it apparently

bollie 07-30-2009 07:00 AM

1 Attachment(s)
Quote:

Originally Posted by bollie
Work not for me.
Show not icon_(browser/os).gif
Originally Posted by Farman
Not working here even, Please give proper instruction, where to upload!
An example icon name would be "icon_firefox.gif" and that should be in the images/useragent folder, what do you have in that folder?
images/useragent/

Charlie98902 07-30-2009 10:09 AM

IE7 seems to do this according to my moderator that has that installed. But Chrime/Firefix/IE8 has no issues.

1320Nation 07-30-2009 10:39 AM

Quote:

Originally Posted by Fighter1405 (Post 1857968)
Just before I write it can we do one check so I don't break your board again? Can you load up phpmyadmin (or similar) and check that there is no table on the vbulletin database called 'board_browserosinfo'?

After checking there is NO 'board_browserosinfo' table.


All times are GMT. The time now is 12:36 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.03766 seconds
  • Memory Usage 1,856KB
  • 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
  • (5)bbcode_code_printable
  • (27)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