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

Please contribute

Please contribute this module on Drupal.org

by Nancyw, February 13, 2008 - 21:47

I do not currently have

I do not currently have enough time to administer this project. Probably some time in the future. In the meantime, I would be delighted if someone can take over the code and put it on drupal.org.

by Leon, February 16, 2008 - 00:39

I you don't mind, I want to

I you don't mind, I want to maintain this project. I also have added automatic database installation and display flags in your module.

by Suryanto Rachmat, March 7, 2008 - 19:40

I have put this module in

I have put this module in drupal.org. You can download the latest version from http://drupal.org/project/ip2nation.

by Suryanto Rachmat, April 24, 2008 - 15:07

Thanks!!!

Thanks!!!

by Leon, April 24, 2008 - 17:41

Flags zip file

Hi,

The link to the flags zip file is dead.

By the way, I can recommend the flags on famfamfam:

http://www.famfamfam.com/lab/icons/flags/

They are iso compatible

by lejon, February 13, 2008 - 22:23

...instructions

And can you expand on your installation instructions? For those of use not familiar with SQL can you give us a step-by-step of what we have to do with the database file?

Thanks

by lejon, February 13, 2008 - 22:34

...one more thing

can you access this from a form to create a select list for users to choose which country they come from rather than only identifying their IP?

Thanks.

by lejon, February 13, 2008 - 22:46

Whoops, the last server

Whoops, the last server move killed the link… Should work OK now.

by Leon, February 16, 2008 - 00:36

Pingback

[...] module Fri, 03/07/2008 - 20:06 This IP2Nation module provides API to access ip2nation (http://www.ip2nation.com/) database in Drupal. With this module you can easily display visitor’s country flag and name. I have developed this module from leon works. [...]
by IP2Nation | Rachmat.net, March 7, 2008 - 20:38

Pingback

[...] module Fri, 03/07/2008 - 20:57 Modul IP2Nation menyediakan API untuk mengakses database ip2nation (http://www.ip2nation.com/) di Drupal. Dengan modul ini Anda dengan mudah dapat menampilkan nama negara dan bendera pengunjung. Saya mengembangkan modul ini dari hasil pekerjaan leon. [...]
by IP2Nation | Rachmat.net, March 7, 2008 - 21:39

Pingback

[...] in the day, Suryanto Rachmat posted a comment in my blog asking my permission to maintain another of my Drupal module. I’ve never met this person but he obviously has an identical nationality to me (Indonesia) [...]

Pingback

[...] module Fri, 03/07/2008 - 20:57 Modul IP2Nation menyediakan API untuk mengakses database ip2nation (http://www.ip2nation.com/) di Drupal. Dengan modul ini Anda dengan mudah dapat menampilkan nama negara dan bendera pengunjung. Saya mengembangkan modul ini dari hasil pekerjaan leon. [...]

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.