There are a few things I had to do to make this module work for my 6.12 install. I assume they are required for any version of 6.

First off is to alter the .info file and change

dependencies = ad

to

dependencies[] = ad

That will allow you to enable the module. The 2nd thing you need to do is alter the hook_menu function to look like this:

function ad_geoip_menu() {
  $items = array();

  $items['admin/reports/geoip'] = array(
      'title' => t('GeoIP'),
      'page callback' => 'ad_geoip_status',
      'access arguments' => array('administer advertisements'),
      'type' => MENU_LOCAL_TASK);  
  
  return $items;
}

If you have already installed the module,you'll need to flush your menu cache

Lastly, the hook_form_alter function needs to be modified

function ad_geoip_form_alter($form_id, &$form) {

to

function ad_geoip_form_alter(&$form, $form_state, $form_id) {

I haven't actually done geoip based tests yet, but so far these changes got all admin-side functionality rolling for me

Michael

Comments

arcaic’s picture

Hi Soyarma,

Did you ever get this to work properly. I can get the admin side stuff apparently working ok (with your changes) but I can't get adds to display when Ad GeoIP is enabled.

Andy

soyarma’s picture

Sorry I missed your reply. I do have it working--didn't have that issue.

socialnicheguru’s picture

has this been committed? still necessary?

Chris

reubenavery’s picture

Ads are not working with 6.x when GeoIP is enabled due to an error being thrown:
Fatal error: Cannot use string offset as an array in /sites/all/modules/ad_geoip/ad_geoip.inc on line 91 (ad_geoip_cache_select):
$format = $cache['geoip'][$target]['format'][$aid] ? $cache['geoip'][$target]['format'][$aid] : AD_GEOIP_ALL;

Putting a little debugging code in there, I'm seeing that the $config parameter being passed in to ad_geoip_cache_select is the string literal "none" rather than an array, hence the failure on the $format variable assignment.

I've been trying to figure out the execution order with this one but am a little lost currently.. If I stumble upon a cure, I'll post a patch.

cronix’s picture

Subscribing.

Is this module abandoned? I would think that this functionality is needed by many sites. I haven't been able to get this to work too.

d0t101101’s picture

Subscribing.

soyarma’s picture

I've actually rebuilt the site I was using this on from the ground up and haven't put GeoIP back in yet. I'll be doing so in a week or so and will post my success or lack thereof.

When I got it working the first time the changes I outlined above were enough--however, the MaxMind install stuff seems to have changed since this module was first created/documented and there are different ways to enable the maxmind data and not all use the same functions as this module tries to use.

jerdavis’s picture

Priority: Normal » Critical

I actually spent a fair amount of time today getting this working based on the release available. When I went to create a patch, I found that the 6.x-2.x branch was almost completely different.

It would be super awesome to have a development snapshot available from this branch to make it a little easier to see there is actually still work going on here. Granted I could have checked out head to begin with and likely saved myself a lot of time, but there was little indication otherwise that any updates had been made.

For anyone trying to get this working, check out the DRUPAL-6--2 branch from CVS and give that a shot first. If that doesn't work, I can upload a tarball of the code I got working based on the current release.

jeremy’s picture

Evidently there is a packaging error preventing this 6.x-2.x-dev tarball from being displayed.

jeremy’s picture

Nope, there was an idiot error instead (on my part). The 6.x-2.x-dev tarball should show up within the next 12 hours.

joshuautley’s picture

Jeremy, how you doing with this?

anonymous07’s picture

Subscribe

jeremy’s picture

Status: Active » Fixed

This should now work in the latest 6.x tarball (grab -rc2).

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.