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.
| Attachment | Size |
|---|---|
| ip2nation-5.x-1.0.tar.gz | 7.96 KB |
| flags.zip | 160 KB |
13 comments
Please contribute
Please contribute this module on Drupal.org
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.
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.
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.
Thanks!!!
Thanks!!!
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
...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
...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.
Whoops, the last server
Whoops, the last server move killed the link… Should work OK now.
Pingback
Pingback
Pingback
Pingback
Post new comment