vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Forum Display Enhancements - Country Display for Who's Online (https://vborg.vbsupport.ru/showthread.php?t=151600)

mfyvie 07-06-2007 10:00 PM

Country Display for Who's Online
 
*** Staff note: The author of this modification has passed away in a diving accident. We wish his family all strength in dealing with this traggic issue. ***

Country Display for Who's Online

What does this do?

It adds another column to your Who's Online display, with the country where the user is logging on from. You can choose either the name, the flag or both. You can also decide which users can see this information.

How about a quick summary of features?

Country display can be admin/moderator only, or available for everyone to see
You can display the country name, a flag, or both. You can use alternative flag sets if you want
Adds minimal overhead, no additional queries
Works on 3.6.6, 3.6.7 and should work for future versions as well. Will not work on versions prior to this. There is a manual file hack for previous versions here (unsupported).
Country information is provided by the GLA (Geographic Location Awareness) mod. Therefore updates to GLA will automatically provide improvements to any mod using GLA.

How do I install?

1. Install GLA first. You can find it here. It's easy and takes a minute.
2. Download and install the enclosed .xml file via adminCP -> Plugins & Products -> Manage Products -> Add/Import Product -> Import.

How do I configure it?

By default it will display only the country name to admin, super moderators and moderators. You can change this under vBulletin Options -> Who's Online Options. Be sure to check these options and click "save", even if you haven't changed anything. See attached screenshots.

Before posting on this thread:

If your issue concerns questions about country detection, the accuracy of the database, etc - please post your question on the GLA thread instead. Please only post issues here concerning the Who's Online display itself.

Please click install. Support requests from people who have not clicked install may not be answered.

Version history:
V1.0 - (07.07.07) Initial release

mfyvie 07-07-2007 11:49 AM

Please note that this mod will not work if you are running vBulletin prior to 3.6.6, because these versions do not have the online_query hook.

The minimum version listed is 3.6.7 anyway, but just to make this absolutely clear, please don't ask for support or complain if this doesn't work and you are on an older version.

Other mods which use GLA may have different compatibility requirements, but the Who's Online mod will not work prior to 3.6.6.

ssslippy 07-07-2007 12:01 PM

Very Nice installed.

TTG 07-07-2007 12:47 PM

Worked straight out of the box after installing the 1st part .. thanks mfyvie.
Clicked install.

yaoren 07-07-2007 06:18 PM

Thanks, Will install later tonight :)

steven s 07-07-2007 06:27 PM

Way cool!
I have many international members.:up:

mfyvie 07-07-2007 06:33 PM

Quote:

Originally Posted by 1996 328ti (Post 1285241)
Way cool!
I have many international members.:up:

Probably more than you realised... Also many international spiders :)

mfyvie 07-07-2007 06:35 PM

Just a note to those of you who have installed. There is a suspected bug in vbulletin which I have posted here. This affects people who don't specifically save their options after installing a mod. IN the case of this mod, unless you go into your who's online options and hit save, your country data is going to be displayed publicly. If you don't want that - hit save - even if the options look the way you want them to! I'm sorry about that, totally beyond my control, but easy to fix.

If in doubt - check.

tanyeri24 07-07-2007 06:42 PM

doesnt work for me

mfyvie 07-07-2007 06:46 PM

Quote:

Originally Posted by tanyeri24 (Post 1285252)
doesnt work for me

Well since you've supplied zero information, that's about the same level as help as I'll be able to give you at this time.

tanyeri24 07-07-2007 06:51 PM

oke you've right.
country table is there but no flag no country name on WOL.
In admincp is set the show... again there is created "COUNTRY" in WOL
but no FLAG no COUNTRYNAME.
installed exact like .txt.

mfyvie 07-07-2007 07:00 PM

Quote:

Originally Posted by tanyeri24 (Post 1285267)
oke you've right.
country table is there but no flag no country name on WOL.
In admincp is set the show... again there is created "COUNTRY" in WOL
but no FLAG no COUNTRYNAME.
installed exact like .txt.

That's a bit better. You've obviously confirmed that the table "ip2country" is in your database (I take it that's what you mean by country table). The next thing you should do is check your session table, and see if the country column has been added to the session table, and if it is populated.

On the other hand, you might be saying that country table is the column for "Country" on the who's online table itself (if this is what you meant the column rather than table is the word you wanted).

Although you've improved the amount of information you've supplied, please take the time to write clearly and in detail, and I might be able to help you more. In the meantime, I take it you noticed this part in the instructions:

Quote:

Please click install. Support requests from people who have not clicked install may not be answered.

jderouen 07-07-2007 07:17 PM

Am I correct in assuming that the displays don't update until someone changes what they're doing on the forums? ie: I just installed it, but only a smattering of the 100+ people listed in the Who's Online have a flag next to their name. But as I've reloaded over the last several minutes, I've noticed some of them filling in as they moved around the board.

Is that correct, or is something wrong?

Thanks!
Joe

mfyvie 07-07-2007 07:23 PM

Quote:

Originally Posted by jderouen (Post 1285282)
Am I correct in assuming that the displays don't update until someone changes what they're doing on the forums? ie: I just installed it, but only a smattering of the 100+ people listed in the Who's Online have a flag next to their name. But as I've reloaded over the last several minutes, I've noticed some of them filling in as they moved around the board.

Is that correct, or is something wrong?

Thanks!
Joe

Hi Joe, you are correct - someone has to actually load a page before the required code will fire up for the first time. You can't expect it to work for the sessions that have been inactive since before you installed it. :) Speaking of installed. [cough] forgotten to click install?

tanyeri24 07-07-2007 07:37 PM

Quote:

Originally Posted by mfyvie (Post 1285273)
On the other hand, you might be saying that country table is the column for "Country" on the who's online table itself (if this is what you meant the column rather than table is the word you wanted).

yeah column is there on WOL but no FLAG no NAME. Thanks.

alessai 07-07-2007 07:39 PM

i'll love this if it can show up in the postbit

Xil Ze 07-07-2007 07:42 PM

i'm using 3.6.4, so that may be the issue. the database is good and everything installed correctly as far as i can tell but there's no cell for the country data on the page:

Code:

        <td class="alt1"><div class="smallfont">
                       
                                <a href="online.php?do=resolveip&amp;ipaddress=" id="resolveip_1" title="Resolve IP Address"></a>
                       
                       
                </div></td>

Flag cell should be here.
       
        <td class="alt1"></td>
                <td class="alt2" align="center" nowrap="nowrap">
                        <a href="#" onclick="imwindow('aim', '1', 400, 200); return false;"><img src="http://blogicology.com/images/misc/im_aim.gif" alt="Send a message via AIM " border="0" /></a>
                </td>

(i guess my issue is the same as the other guy's.)

mfyvie 07-07-2007 07:53 PM

Quote:

Originally Posted by Xil Ze (Post 1285304)
i'm using 3.6.4, so that may be the issue. the database is good and everything installed correctly as far as i can tell but there's no cell for the country data on the page:

Xil Ze - Bonus points for realising that this is a 3.6.7 mod, but you are running on 3.6.4.

Ok, this is the string I am targetting in both WHOSONLINE and whosonlinebit:

Code:

<if condition="$vboptions['showimicons']">
It looks like you have shown your HTML output there. If you can find the equivalent text in your whosonlinebit template and copy it here (with a couple of lines either side), I'll see what I can do about making it detect 3.6.4 as well. Please check only the standard template (not one you may have modified!). I don't have 3.6.4 so you'll have to send me an email, so I can email you back a version for you to test.

Xil Ze 07-07-2007 08:44 PM

alright, i've determined that, on my board, $userinfo[country_iso2] $userinfo[country] are invariably returned as null. though they're correct in the session table.

mfyvie 07-07-2007 08:52 PM

Quote:

Originally Posted by Xil Ze (Post 1285335)
alright, i've determined that, on my board, $userinfo[country_iso2] $userinfo[country] are invariably returned as null. though they're correct in the session table.

That sounds very strange. Try adding something to one of your templates just on a temporary basis: $session[country]. This should display YOUR country, for your own session (from GLA itself). The $userinfo variables belong to the who's online mod.

You can switch to PM's now if you like - that would help to keep all the boring stuff off the thread until we resolve this. If there's information that comes out that is useful, I'll update this thread.

jderouen 07-07-2007 09:07 PM

Just clicked install! :)

If at some point I wanted to update the database of countries from the IP-to-Country website, how would I do that? I mean, I know I'd need to download the file from that website, but what do I do after that?

Thanks!
Joe

mfyvie 07-07-2007 09:09 PM

Quote:

Originally Posted by jderouen (Post 1285345)
Just clicked install! :)

If at some point I wanted to update the database of countries from the IP-to-Country website, how would I do that? I mean, I know I'd need to download the file from that website, but what do I do after that?

That question pertain to GLA itself rather than this mod. But the answer is easy - read the instructions for GLA and that exact question is addressed.

Ahsin1 07-07-2007 09:18 PM

i got this massege when i click on import

vBulletin Message

The following dependencies were not met:
The product geo_location_awareness must be installed before this product may be installed. (Compatible starting with 1.0)

tanyeri24 07-07-2007 09:20 PM

monster mysql injection for nothing, badly. sorry but *uninstall* cause doesn't work for me.
good job anyway and enjoy.

jderouen 07-07-2007 09:22 PM

Well, I assume you haven't installed Geo Location Awareness. As it says in the description, you have to install that mod in order for this mod to work.

Quote:

Originally Posted by Ahsin1 (Post 1285356)
i got this massege when i click on import

vBulletin Message

The following dependencies were not met:
The product geo_location_awareness must be installed before this product may be installed. (Compatible starting with 1.0)


mfyvie 07-07-2007 09:27 PM

Quote:

Originally Posted by tanyeri24 (Post 1285357)
monster mysql injection for nothing, badly. sorry but *uninstall* cause doesn't work for me.
good job anyway and enjoy.

Disappointing. I offered to support you in your native language, but you never sent me a PM. Your loss.

Quote:

Originally Posted by Ahsin1 (Post 1285356)
i got this massege when i click on import

vBulletin Message

The following dependencies were not met:
The product geo_location_awareness must be installed before this product may be installed. (Compatible starting with 1.0)

As the saying goes my friend, those who can read have an advantage. You should try it.

mfyvie 07-07-2007 10:43 PM

Here's a copy of something I just edited into post #2:

Quote:

Please note that this mod will not work if you are running vBulletin prior to 3.6.6, because these versions do not have the online_query hook.

The minimum version listed is 3.6.7 anyway, but just to make this absolutely clear, please don't ask for support or complain if this doesn't work and you are on an older version.

Other mods which use GLA may have different compatibility requirements, but the Who's Online mod will not work prior to 3.6.6.
Thanks to Xil Ze for letting me know about the lack of a hook in previous versions.

JD45 07-07-2007 10:50 PM

I'm not getting anything to display for some reason. Here's what I've done:
  • Installed GLA
  • Installed this hack
  • uploaded the hacks contents
  • ran both installers and made sure they were actually installed
  • turned on the options in the admincp

I'm running 3.6.7 PL1 so it should be compatible.

Did I overlook something?

mfyvie 07-07-2007 11:01 PM

JD45 - sounds about right, except the step in the middle (upload) should be first. If the import file isn't there when you install GLA, there won't be any data for the location database. But it will warn you about this.

There is always a possibility that you have a customised template and that the replacement isn't working, but other steps to verify are:

Does your database have a table called ip2country, and is this table populated with data? (This means GLA is installed)
Look at your session table (in the database) - there should be three extra columns on it for country information. They should be populated, at least partially (unless you installed in only a few seconds before checking).

Manually hack in $session[country] somewhere into one of your templates. If GLA is running, this will show YOUR country when you load the page (then remove it again). Best way is to confirm via the session table. If the data is being written to the session table, then you should at least get it in $session[country]

mktrilogy 07-07-2007 11:51 PM

can this be integrated to postbit? that would be really cool

mfyvie 07-07-2007 11:56 PM

Quote:

Originally Posted by mktrilogy (Post 1285465)
can this be integrated to postbit? that would be really cool

That's nothing to do with the Who's Online display, but you can read my answer to the same question on the GLA thread.

tanyeri24 07-07-2007 11:59 PM

Quote:

Originally Posted by mfyvie (Post 1285364)
Disappointing. I offered to support you in your native language, but you never sent me a PM. Your loss.



As the saying goes my friend, those who can read have an advantage. You should try it.

I'm also from Switzerland. I had many plugins from here, but I followed your instructions.. And clicked then installed maybe a little late sorry for that.
Not all plugins working on all users, if there users they get it work maybe there is something wrong with my forum. It's possible, I'm not right a prof. Anyways thanks for your kind messaging and trying to help me.
Gute nacht.

Hornstar 07-08-2007 12:35 AM

Hey very nice stuff! this looks well done.

JD45 07-08-2007 02:33 AM

Quote:

Originally Posted by mfyvie (Post 1285455)

Does your database have a table called ip2country, and is this table populated with data? (This means GLA is installed)
Look at your session table (in the database) - there should be three extra columns on it for country information. They should be populated, at least partially (unless you installed in only a few seconds before checking).

Manually hack in $session[country] somewhere into one of your templates. If GLA is running, this will show YOUR country when you load the page (then remove it again). Best way is to confirm via the session table. If the data is being written to the session table, then you should at least get it in $session[country]

Ok, I do have the table called ip2country and it is populated with data. There are the three extra columns in the session table and they do have data.

Now here's the odd part. I put in $session[country] in templates like the navbar, footer, forumhome etc and it never once showed up.

Any further ideas?

SocialNetworkBuzz 07-08-2007 04:49 AM

Would love to see this coded to show flags on the forum home, who's online box inside of whats going on.

TomasDR 07-08-2007 06:22 AM

Hopefully you can help with my issue though I have read your concerns of using 3.6.6 or higher.

GLA seems to be working but something is wrong with the display of Who's online.

My last full install was 3.6.4, I patched it when the exploit was found and 3.6.5 came out.
http://www.vbulletin.com/forum/showthread.php?t=221905
Patch: A second option is to download the patch files discussed in this thread and upload them to your web server, overwriting the existing files. The patch is available from the Members' Area patch page or you can find it attached to this thread.

Then I was out of town in May and came back when 3.6.7 was released. I saw 3.6.6 was out but didn't upgrade. Instead I just used the plugin patch of 3.6.7.

http://www.vbulletin.com/forum/showthread.php?t=229950
Plugin: The plugin system built into vBulletin 3.6 allows the problem to be fixed with a simple plugin. The install file for this plugin is also attached to this thread and is the easiest way to fix the problem, as it does not require you to upload any files via FTP. The plugin will be automatically removed when you perform your next full upgrade. You can install the plugin by following the instructions here.
Plugin File: vb_calendar366_xss_fix_plugin.xml

Now I know in the perfect world a full upgrade to 3.6.7 would be best but with the number of hacks I have that is a 5+ hour project! Either way I am protected from the exploits found by the vBulletin team.

Now on to my problem with this hack.

First I checked the session table and the three additional fields country_iso2/3 & country are being populated!

Secondly I added $session[country] to a template and it did return my country properly.

Clearly the GLA product is working with a patched 3.6.4 vBulletin.

My problem is the display of Who's Online as I mentioned above.

Please see the attached screenshot. The column is being added but there is no column title nor any country information. Also note if someone does have IM information it's being placed in the new title-less column, not the IM column.

I have only one hack that modifies the WHOSONLINE template and that is a spider hack which divides up guests & spiders.

Other plugins working with any other related online.php hooks are either online_location_process or ..._unknown only.

Thanks in advance.

mfyvie 07-08-2007 06:25 AM

Quote:

Originally Posted by Stabatha (Post 1285560)
Would love to see this coded to show flags on the forum home, who's online box inside of whats going on.

That could create a huge amount of clutter. That area is designed to take text - imagine what it would look like with 300 flags in there?

Quote:

Originally Posted by JD45 (Post 1285515)
Ok, I do have the table called ip2country and it is populated with data. There are the three extra columns in the session table and they do have data.

Now here's the odd part. I put in $session[country] in templates like the navbar, footer, forumhome etc and it never once showed up.

Any further ideas?

Ok, that's odd. If you have the session columns and they are populated, then it's working. Once that table is extended, those values are loaded automatically by vb. You may be putting it in a part of the template that doesn't display?

I just went to footer, and inserted $session[host] as the very first line. This displays the IP address and should work for you - it worked for me and has nothing at all to do with this mod.

Of course there's a remote possibility that your own session has the country field blank if it couldn't look up your address. Maybe you should double check the session table to find your own entry and check.

mfyvie 07-08-2007 06:30 AM

@TomasDR - Just because you've installed some plugins which fix security issues, this is NOT the same as running 3.6.6 or higher. As I said in that information the problem is that you are missing a hook, and this won't be fixed by security patches!

I also said that GLA will work fine (which you've just confirmed), but that Who's online won't work properly.

Because the hook is missing, the mod then has no way to add those extra fields into the query which is pulling the info from the database.

I'm going to update the .xml file so that it will refuse to install on anything less than 3.6.6. I doubt that will eliminate people complaining though.

I'm afraid you'll have to bite the bullet and upgrade. 3.6.6 contains around 20 new hooks and is the only version that will support the new blog and project tools products.

Playa82 07-08-2007 06:54 AM

thanks , works fine

Magnumutz 07-08-2007 07:44 AM

Hey, very nice mod man... I love it... and will *Installed* it right now.


All times are GMT. The time now is 11:24 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.01432 seconds
  • Memory Usage 1,863KB
  • 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
  • (18)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