![]() |
GLA - Geographic Location Awareness for vBulletin
*** 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. ***
GLA - Geographic Location Awareness for vBulletin What does this do? GLA adds an additional layer of information into your vBulletin site (visitors' country name). GLA doesn't output anything to the user, or change any display on your forum, it simply adds additional information which is then available to other programs or mods. But what can I use it for? There are many applications, but the main idea is that this mod enables other mod writers to very easily add location awareness functions into their own mods. If you were thinking of writing a mod to display a person's registration country in the postbit, it's now very easy to do. Why should I download and install this? Unless you are also going to install one of the other mods which requires GLA, there isn't much point. If you are a developer, you might install this to add functionality to your own mods. How will I update this? Easy - you can update the database used for matching country names to IP addresses yourself - it's very easy. Full instructions are provided in the install.txt file inside the zip file. How do I install? Download the zip file and look for install.txt. But basically it's easy - upload the contents of the upload folder to your forum directory, and import the enclosed .xml file. That's it. How do I know if it is working? A test script is provided that will test every aspect of your GLA installation to inform you of any potential problems. Please see the installation instructions for information about this test script. What about flags? This includes flags, meaning that other mods won't have to package flags. You can change the flags if you like, instructions are provided. How about a quick summary of features?
Yes, a list will be maintained here. Please let me know if you find a mod which requires GLA that isn't listed, so I can add it. The current list of GLA mods is as follows:
Please post on this thread only for issues relating to GLA itself. If you have an issue that concerns a mod that uses GLA, please post on the appropriate thread for that mod. If you have an issue which concerns the underlying functionality of GLA itself, then post here. Even though this is a required mod from another mod and may be fairly boring, please click install if you are using it. Support requests from people who have not clicked install may not be answered. No screen shots for this mod, since there's nothing to see. Version history 1.0 (07.07.07) Initial version |
Reserved
|
Sounds like it could be a useful addition .. thanks mfyvie .. look forward to seeing future mods utilising this hack.
Clicked install thingy :up: |
great to add addon like :prevent visitors to register from specific country
|
Quote:
|
Just a suggestion, but it would be very useful to be able to get statistics on what countries our members are from. This helps with targeting and selling ads.
Thanks. |
Flawless install.
Many thanks. |
Quote:
GLA itself doesn't seem to add features by itself, it merely acts as a layer or additional information that other people can use to develop their own template edits or plugins. With your suggestion, it could be as simple as adding a plugin to run after GLA which just logs the country to a flat text file, or adding to the hook which fires after a member logs in could record this information just for members. I should point out however that webstats packages like awstats already provide this functionality based on your web logs. |
I would love to have the country flag in the postbit template.
|
Quote:
Hopefully this will inspire someone to write a mod like the one you suggested. I've thought of it too, but am too busy with other mods at the moment. |
i did not get the option in whois online
|
No you won't. This mod doesn't do anything to the Who's Online. I suggest you read the instructions and click install if you'd like me to support you.
If you are referring to the who's online mod - you are on the wrong thread. |
Quote:
https://vborg.vbsupport.ru/showthread.php?t=151600 |
I Install It now my forum not working when i open i get this msg
Warning: Unknown(/home/pakcan/public_html/includes/gla.php): failed to open stream: No such file or directory in /global.php(356) : eval()'d code on line 80 Fatal error: (null)() [function.require]: Failed opening required '/home/pakcan/public_html/includes/gla.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/pakcan/public_html/global.php(356) : eval()'d code on line 80 |
Quote:
You can disable the product until you resolve the problem. Please check the instructions again to make sure you've followed them. |
Quote:
I Unistall It But it not working i am getting that massege . when i open forums but admin cp is working fine |
Quote:
I think you've uninstalled the wrong product. Check again. |
Ok, I've refreshed the installation file. Only 2 minor changes (no need to do anything if you've already installed!)
1. Added the following message during installation: Quote:
2. I added the following text to the instructions file: Quote:
|
Awesome! Thank you very much for sharing. :)
|
I installed this and also installed the addon to show the countries and flags on my whos online page and it works great, except that a couple of isps do not show including mine! I use comcast in Florida and would think it would be in the database, but i guess it is not. Is there anyway to add isps that come up blank with the correct info for them?
|
I guess it would be possible to manually add IP ranges to the database by hand if you wanted to. What are the IP ranges in question?
|
Quote:
Well my isp is 66.229.216.150 which is c-66-229-216-150.hsd1.fl.comcast.net . Pretty popular isp. |
Another cool plugin might be to display one flag of each country currently view pages.
|
Actually, what I meant was the range you wanted added, not just the ip address.
Anyway, if we look up that address you gave in the ARIN database we see that it is registered to comcast as you say, and covers the following range: 66.229.0.0 - 66.229.255.255 (a class B range, a pretty big chunk) Before we do anything we need to convert this to numerical format. This is pretty simple, we just do it like this for the first part of the range: 66 * 256 * 256 *256 + 229 * 256 *256 + 0 * 256 + 0 This give us 1122304000 Now we do the same for the end of the address: 66 * 256 * 256 *256 + 229 * 256 *256 + 255 * 256 + 255 This gives us 1122369535 So we want to assign addresses between 1122304000 and 1122369535 to the US. But wait - are you really sure that this whole address range is in the US? How are you sure? Anyway, since this is your own database and nobody else's, you can do what you like. Use a tool (like PhpMyAdmin, or the SQL query function in the admincp) to look inside your database. Execute the following SQL command to give you any ranges inside the one you want like this: Code:
SELECT * FROM ip2country WHERE ip_from <= 1122369535 AND ip_to >= 1122304000 We see that a single result is returned: 1122320960 - 1122320995 - only 35 addresses? In the middle of that range assigned to portugal? Probably a mistake. Ok, so let's say you are absolutely sure that you want to add that big block in. You could make an SQL query like this: Code:
INSERT INTO ip2country (ip_from, ip_to, country_code2, country_code3, country_name) VALUES ('1122304000', '1122369535', 'us', 'usa', 'United States') Then you should be done. Anyone else can also use these instructions for another IP range if they like. Some useful links: http://ip-to-country.webhosting.info/forum (is full of spam, and isn't very useful, but these are the official forums for the database) http://www.arin.net/whois/ (for looking up IP address ranges) And of course - read install.txt and developer.txt in the installation archive for links, etc. |
By the way, if anyone is wondering if their OWN address is being found in the database, you can go to this page:
http://ip-to-country.webhosting.info/ They look up your address and display the country. When I visit the site I see the details. If you visit the site and don't see your country come up, your IP is not in the database. |
Now we just need someone to make a plugin which will allow the admins to pick countries to ban and then have it dynamically ban anyone that registers with a certain country :D
|
Quote:
|
Very nice, will u notify Country-IP-DB updates here?
|
Quote:
|
Quote:
Approximately one time per month! |
Careful there - the forum post you are quoting is 3 years old. From the looks of that site it doesn't appear to be well maintained. The last update was in March, already 4 months old. I used this database because it was free and I didn't have to look too hard to find it. However, if anyone else finds a more reliable source for the database, I can look at switching over to something else. Most of these databases are unfortunately commercial.
|
I've discovered a very minor flaw.
Impact: If a user's IP isn't found in the database, GLA functions will be disabled for that user. For example, they won't be able to see the who's online list. Whenever that person loads any page on the forum, 1 extra query will be executed - for most people that wouldn't be the end of the world, but I have tried to make GLA as efficient as possible. What you need to do: Download the .zip file again, you do not need to reinstall the whole package, just replace your includes/gla.php file that you uploaded earlier. Why this happened: People not interested in the programmer's explanation may skip this next part - show's over folks.. When someone's IP address isn't found we write a null value to the session variable. We use isset() to later check if we've already executed the query, but if the null value is written to the database it doesn't come back on the next page load, therefore the isset() we expected to be true is really false. This is solved by writing an unknown entry to the database as ' ' (space character), GLA then trims anything that comes from the session table the first time it loads - effectively nullifying the variable again. Thereore developers can still use isset() before their GLA compatible plugins (to test if GLA is present at all), and != null to test to see if a country has been found. What if I do nothing? Well it won't be the end of the world, but it might mean that some users (who have IP addresses that aren't in the database) might not be able to use features which rely on GLA. I'd therefore prefer it if everyone replaced their gla.php file - just to ensure no support issues come up in the future. Who should do this? Anyone who downloaded and installed GLA before the date of this post. Anyone who has installed GLA after the date of this post can safely ignore this whole post! |
For those of you who run the Proxy RBL on Registration mod, you'll be pleased to know that I've posted some info here on how to make this mod "country aware" using GLA.
|
Thanks for this ..
|
Thanks for this.
Although it is a bit USA happy. Alot of people seem to get traced to the US. (I.E one of my German members is apparantly in the USA :p) |
Quote:
If you know of any such errors you can also make a manual modification to the database. |
Quote:
|
Quote:
|
Okay, thanks ;)
(Also, finally remembered to click installed :D) |
I've just finished a verification script which will test many aspects of GLA and report whether they are correct or not. If something is not correct a text box will be displayed explaining how the problem may be resolved.
I believe this should make it much easier for people who install it to be able to verify their installation before asking for support. In fact, the script gives the sort of answers I might give them if they came to this thread for support anyway. Those of you who already have working GLA installations may be interested to look at the script anyway. It will tell you whether you've installed the flags correctly for ALL of your styles, and if GLA is functioning correctly it will even give you a little search box where you can query any IP address you like to find out the country. This file is called gla_test.php and is now included in the installation archive. It is designed to be run from your main forum directory, but you could run it from any directory you like. You can either redownload the archive to get this file, or I've attached it to this post with a screenshot. Unfortunately the screenshot gets automatically scaled down, so it may be hard to read. I hope you all enjoy this test script and find it useful. |
All times are GMT. The time now is 11:25 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|