I released a country level ip locator Drupal module.
You can download and/or test it here http://www.para.ro/en/node/130.

Comments

robertdouglass’s picture

Thanks for your excellent contribution. Have you considered putting it in the contrib repository here at Drupal.org? To do so you apply for a CVS account:
http://drupal.org/cvs-account

If you don't want to do that, let me know and I'll commit it on your behalf.

Great work!

- Robert Douglass

-----
Rate the value of this post: http://rate.affero.net/robertDouglass/
I recommend CivicSpace: www.civicspacelabs.org
My sites: www.hornroller.com, www.robshouse.net

he_who_shall_not_be_named’s picture

Thanks for your fast reply.
The http://drupal.org/cvs-account says that I allready have an account (I submited it before but I never get a response).
Of course, if my cvs account works I will submit my projects there.

patrickharris’s picture

Hey - this looks excellent. Thanks very much.

Brian@brianpuccio.net’s picture

Thanks for your work and your willingness to add this to the Drupal contribution's repository and keep all the Drupal modules available in one centralized location.

Thox’s picture

If I request your site in English then my country shows as US (incorrect). If I click for the Romanian version then it correctly shows that I'm in the UK. This behaviour is mentioned in one of the comments too, so it's worth looking in to.

For comparison, I've also got a IP-location module, based on the MaxMind GeoIP database. You can see a demo on my site.

On another site I've actually hacked part of Drupal core to insert the country into the access table. That way, I can generate country-based statistics. Ideally though, I'd do that without editting core files.

he_who_shall_not_be_named’s picture

Send me your ip, please. I will do an investigation. MaxMind GeoIp database is for cash. :)

Thox’s picture

The bug seems fixed now.

Also, I meant I was using the GeoLite Country Database, which is GPL.

Do you know how your sources compare with regards to accuracy and working with AOL? The one I use claims to be 97% accurate but reports all AOL users being in the US.

he_who_shall_not_be_named’s picture

That's it. IP locator returns US for all AOL users, too. In the future, if we can, we'll change that.

he_who_shall_not_be_named’s picture

Your related bug is confirmed. I disabled the Drupal cache on my site. See if it works now.

Thanks.

he_who_shall_not_be_named’s picture

I added a hotfix to it described in the CHANGELOG.txt.
http://www.para.ro/en/node/130.

tgotchi’s picture

We hope to see a support for other geolocation service as well.

http://www.ip2location.com

he_who_shall_not_be_named’s picture

Be more explicit, please. I don't understand your comment.

oleykin’s picture

I just installed it. MYSQL has given me "you have exceeded 50000 max_questions"
By reading on drupal.org and my hosting forums I conclude that this is the problem with the script not closing the tables somewhere!

Please advise!

--
43vents.com | Let your negative emotions out...

he_who_shall_not_be_named’s picture

Modify the import options from phpMyAdmin.

-----
http://para.ro

Antorkh’s picture

Hi, i didnt get how to plainly show the users country, but not the form in the block. Is it possible?

best regards,
Antorkh

Antorkh’s picture

ok, i got it by my own:

put into hook_block:

unset($_SESSION['ip_locator_country']);
if(!ipl_country($country_code, $country_name, $latitude, $longitude, $country_flag)) $block['content'] .= "getting country failed";
$block['content'] .= '<small>' . t('Your location: ') . '</small>';
$block['content'] .= theme_image($country_flag, $country_name, $country_name) . ' ';
$block['content'] .= '<small>' . $country_name . '</small>';
$block['content'] .= '<small>' . $country_code . '</small>';
$block['content'] .= '<br/><small>' . sprintf(t('Lat/long: %s/%s'), $latitude, $longitude) . '</small>';

its dirty but you left me no choice! :P

druvision’s picture

The original IP locator module can no longer be downloaded - the node doesn't exist.
Is there a newer module which may be contributed? Or is the GeoIP functionality covered by other modules like locaiton.module or GMap?

Please advise

Thanks in advance,

Amnon
-
Professional: Drupal Israel | Drupal Development & Consulting | בניית אתרים
Personal: Hitech Dolphin: Regain Simple Joy :)

druvision’s picture

OK, I got it. The module is called ip_locator, and there's a nice demo there.

Does it still depends on MaxMind's GeoIP database? I see no clue to it in the installation instructions.

he_who_shall_not_be_named’s picture

Nope. The install.txt contains some info. To install the iIPs just download the ip_locator_geo_ips from http://project.para.ro/project/ip_locator and run it (phpMyAdmin or mysqladmin) to import its data.