Retired Documentation:  You are using the documentation for version 1.7.3 which was retired in 2013. Go here for the latest version documentation or check here for your available upgrades to the latest version.

IP to Nation Module

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:

  1. Ban entire countries. When a country is banned, someone with an IP address from that country is not permitted to submit comments, trackbacks, referrer data, or use the email/tell-a-friend forms.
  2. 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/lib/countries.php file so that newly added or changed nations display properly.

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 and build of ExpressionEngine, and visit the Modules > IP to Nation 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.

Banning Counties

To look up the country associated with an IP address, or to ban a country you'll to to the Modules > IP to Nation page 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:weblog: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

The world flags tag has two 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/

Top of Page