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.
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="email@example.com" 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!
If you have comments, suggestions, feature request etc, feel free to post a comment. Updates for this module will also be posted here.