ExpressionEngine

2.11.7 User Guide

Legacy Documentation

You are using the documentation for version 2.11.7. Go here for the latest version or check here for your available upgrades to ExpressionEngine 3.

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:

  1. 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.
  2. Show a flag icon image0 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 Add- Ons ‣ 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.

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 Add-Ons ‣ Modules ‣ IP to Nation 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/.