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
Comment #1
arcaicHi 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
Comment #2
soyarma commentedSorry I missed your reply. I do have it working--didn't have that issue.
Comment #3
socialnicheguru commentedhas this been committed? still necessary?
Chris
Comment #4
reubenavery commentedAds 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.
Comment #5
cronix commentedSubscribing.
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.
Comment #6
d0t101101 commentedSubscribing.
Comment #7
soyarma commentedI'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.
Comment #8
jerdavisI 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.
Comment #9
jeremy commentedEvidently there is a packaging error preventing this 6.x-2.x-dev tarball from being displayed.
Comment #10
jeremy commentedNope, there was an idiot error instead (on my part). The 6.x-2.x-dev tarball should show up within the next 12 hours.
Comment #11
joshuautley commentedJeremy, how you doing with this?
Comment #12
anonymous07 commentedSubscribe
Comment #13
jeremy commentedThis should now work in the latest 6.x tarball (grab -rc2).