Ip2Nation for Drupal

This Ip2Nation module provides an API to access ip2nation database in Drupal. Actually, there is a module called ip2cc which does the same thing, but it exposes another Ip-to-Country database. Ip2nation database is better because it is optimized for queries (and so smaller and faster to use), so I made this module.

Another feature in this module is commenter’s information. You can show from which country a comment in your website is from. This is nice especially for social websites that have lots of users all around the world, or for personal blogs. Of course you can turn off this feature at will (it is, by default). If you know HTML you can put up country flags in the comments, too.

This module is for Drupal 5 only.

Installation

This module does not modify or add database schema in any way; but you need to download ip2nation database and install it (i.e. execute the queries). Do not change the table name even if you use Drupal table prefix facility.

After the module is uploaded and activated (as usual module installation) and ip2nation data is installed, go to Site configuration >> Ip2Nation to set the settings and check that the ip2nation data is installed properly. You should see your own country information there – if you don’t, or an SQL error occured, there is something wrong about your ip2nation data installation.

Country Flags for Comments

You can also put country flags for the comments – after you turn on commenter’s country information setting, you can set the HTML that will be shown in comments. So you can slap in e.g. <img src="files/flags/flag_@code.gif" title="from %country" />, upload the flags and voila! There is also alternative flags.

There are some country flags artwork in the internet. My copy works nice but I forget where I got it. If someone feels familiar to this flags, please let me know so I can put acknowledgements here!

Anyway…

If you have comments, suggestions, feature request etc, feel free to post a comment. Updates for this module will also be posted here.

AttachmentSize
ip2nation-5.x-1.0.tar.gz7.96 KB
flags.zip160 KB
| tags:

13 comments

Post new comment

When replying to comments, you are encouraged to use the corresponding "reply" link in the comments. Your reply will then be placed under the comment, easing conversation and reading.
The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <pre>
  • Lines and paragraphs break automatically.