Retired Documentation
You are using the documentation for version 2.11.9. Go here for the latest version or check here for your available upgrades to the latest version.
IP to Nation¶
Introduction¶
The IP to Nation module enables you to determine which country an IP address is associated with. You can do two things with this information:
- Ban entire countries. When a country is banned, someone with an IP address from that country is not permitted to submit comments, referrer data, or use the email/tell-a-friend forms.
- Show a flag icon within your comments or entries to indicate the country of the person who submitted the entry.
Note
When updating your IP to Nation module, make sure that you also update your /system/expressionengine/config/countries.php file so that newly added or changed nations display properly.
Note
The IP to Nation Module is available only with a purchased ExpressionEngine license.
Database Updates¶
Periodically, the IP address database for the IP to Nation module is updated from maxmind.com’s database. When this occurs, a note will be made in the Change Log. To update your installation, simply make sure that you are running the latest version of ExpressionEngine, and visit the page in your Control Panel. The update may take a few seconds; do not click any links or refresh the page while the auto-update is taking place.
You also manually update the IP address database using the Update IP Database page. The new files will automatically be downloaded for you to use.
Banning Counties¶
To look up the country associated with an IP address, or to ban a country, go to
in your Control Panel.World Flags Tag¶
In order to use the world flag feature, please first visit the Modules page of the control panel and make sure your IP to Nation module is installed.
Note
Please download the flag icons from ExpressionEngine.com. Once downloaded, unzip the archive, then upload the “world_flags” folder to your server. The folder can go anywhere since you’ll set the URL in the tag as described below.
The “world flags” tag can be used within your {exp:comment:entries} or {exp:channel:entries} like this:
{exp:ip_to_nation:world_flags image_url="http://example.com/images/world_flags/"}
{ip_address}
{/exp:ip_to_nation:world_flags}
Parameters¶
image_url=¶
This URL to your “world_flags” folder.
Make sure you include the folder name in the URL and include a trailing slash:
http://example.com/images/world_flags/
type=”text”¶
You can optional set the tag to output the name of the country as text by using the type=”text” parameter.
Note
This product includes GeoLite data created by MaxMind, available from http://maxmind.com/.