Records location during registration.
Setup:
By default this add-on will use the ipapi.com to get the location from the users IP address. However using the API is not as reliable as using the GeoIp2 library. Here is a link which explains how to install the GeoIp2 library.
Database changes:
This add-on will add a field called 'andy_register_location' to your xf_user table.
Some add-on use by default the ipapi.com API to get a location from the IP address. While this works fairly well, often the service will return an empty result, this is due to excessive use of the service.
GeoIp2 library to the rescue. This GeoIp2 library allows reading the GeoLite2 database located on your server and you can lookup as many IP addresses as you like. The GeoIp2 library is free and is easy to install.
Installation instructions
- Create a directory called misc in your public_html directory.
- Log into your server using SSH. Log in as a cPanel user or equivalent (do not log in as root).
- Navigate to the /misc directory.
- Enter the following command composer require geoip2/geoip2:~2.
- Composer will install the GeoIp2 library.
Example of the vendor directory.
In order to use the GeoIp2 library, you will need to download the GeoLite2-City.mmdb database. First step is to register at the maxmind.com site:
www.maxmind.com
Then go to the downloads page here:
www.maxmind.com
Download the GZIP file.
Unpack the GZIP file and upload the GeoLite2-City.mmdb file to your /misc directory on your server. Last step is to update the add-ons options page with the path to the autoload.php and GeoLite2-City.mmdb files.
Attachments