Skip to main content
Topic: [ADDON] GeoIP Location (Read 1016 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[ADDON] GeoIP Location

This is a simplified version of my GeoIP modification.  The simplification is that it now depends on the web server (Nginx or Apache) providing the GeoIP data.   This means that your web server must having this capability enabled and that it also provides the environment data to PHP.   My original modification created a mysql database from the maxmind files, this proved to be a support issue.  Now it depends on the server, so if your web  server does not have this, don't install this addon.    Also note I've only tested this with Nginx since thats what I use,

geoIP Location

Introduction
This modification adds the ability to use the latitude & longitude of a member given their IP address. This is commonly referred to as geolocation. The mod makes use of the geoip capabilities in Nginx or Apache web servers.  You must have this capability enabled in your web server and they must make the following enviroment variables available to PHP ('GEOIP_LATITUDE', 'GEOIP_LONGITUDE' 'GEOIP_CITY_COUNTRY_NAME', 'GEOIP_CITY', 'GEOIP_CITY_COUNTRY_CODE')

License
o This modification is released under a MPL V1.1 license, a copy of it with its provisions is included with the package.

A note on accuracy:
Maxmind shows that this database (which is updated on a monthly basis) is over 99.5% accurate on a country level making it a viable source for registration blocking.

When it comes to the city level accuracy this number is and 79% for the US (within a 25 mile radius).  That is the best accuracy, and other countries city/region location accuracy tapper off from that.  Even with that level of accuracy, it still makes for an entertaining online member map.

In some instances the IP address will not be found, or will have incomplete data.  In this case the mod will make use of secondary sources to gather information.

Features
o Adds an on-line member map which will show a map pin for each IP currently on your forum
o Adds the ability to block or allow member registrations on a per country basis
o Adds in the geoIP information under the track IP sections, allows you to see city / region (state) / country of the IP address
o No source edits
o @todo add country flag to online member list

There are admin settings available with this mod, go to admin - configuration - addon settings - geoIP.

Installation
IMPORTANT NOTES:
o The package will install on all systems, however you must have geoip capabilities enabled in the web server and the environment variables made available to PHP.  If you are on shared hosting, check with your host, or if you are on a VPS you can read how to do it, for example with Nginx : http://www.howtoforge.com/using-geoip-with-nginx-on-ubuntu-12.04

Repo
https://bitbucket.org/spuds_/elk_geoip
Source
https://bitbucket.org/spuds_/elk_geoip/src
Download
http://addons.elkarte.net/feature/geoIP-Location.html
“The problem is not the problem. The problem is your attitude about the problem. Do you understand?” – Jack Sparrow

Re: [ADDON] GeoIP Location

Reply #1
Cool stuff! :D

so if your web  server does not have this, don't install this addon.
And that makes me think that a very cool feature for our beloved PacMan could be a dependencies check of sort... well, in the end it would just be a "during-install-checks-run-this-function" kind of thing.

 emanuele loves how easy things look like when you write them compared to how difficult the darn b**stards are when you have to actually code them. xD
Bugs creator.
Features destroyer.
Template killer.

Re: [ADDON] GeoIP Location

Reply #2
Not a bad idea ... we do have <requires> in pacman , but thats a package dependency check.  Could add a server based one, like min level of php, mysql, or some extension installed.    I think this could be done if I add in a <code> section and do the checks as well.
“The problem is not the problem. The problem is your attitude about the problem. Do you understand?” – Jack Sparrow