I create a small patch for location module based on this http://drupal.org/node/820116 for use the proximity filter with the data retrive by this module.
In location.views.inc after:
case 'uid_arg':
if ($userhandler = $view->display_handler->get_handler('argument', $options['uid_arg'])) {
$uid = $userhandler->get_value();
if ($uid && is_numeric($uid) && $tempuser = user_load(array('uid' => $uid))) {
$coordinates['latitude'] = (float) $tempuser->location['latitude'];
$coordinates['longitude'] = (float) $tempuser->location['longitude'];
}
}
break;
add
case 'smartip':
if (module_exists('smart_ip')) {
if ($_SESSION['smart_ip']['location']['longitude']!=0) { // intentional assignment of $geoip
$coordinates['latitude'] = $_SESSION['smart_ip']['location']['latitude'];
$coordinates['longitude'] = $_SESSION['smart_ip']['location']['longitude'];
}
}
else if ($options['latitude'] && $options['longitude']) {
$coordinates['latitude'] = (float) $options['latitude'];
$coordinates['longitude'] = (float) $options['longitude'];
}
break;
and in handlers/location_views_handler_filter_proximity.inc after
if (module_exists('gmap')) {
$form['origin']['#options']['latlon_gmap'] = t('Latitude / Longitude input (use map)');
}
add
if (module_exists('smart_ip')) {
$form['origin']['#options']['smartip'] = t("Position of the visitor (0,0 if unset)");
}
Now in the filter set "Position of the visitor (0,0 if unset)" to works.
Also i found this tutorial for who doesn't want to change location module: http://envisioninteractive.com/drupal/user-targeted-content-with-drupal-...
Comments
Comment #1
arpeggio commentedI think this post is best to be placed at Location module issue queue as this patch is intended to be applied to Location module. Thanks for sharing this BTW.
Comment #3
matt@antinomia commentedRe-opening this as a Location Views feature request so it's not lost.
Comment #3.0
matt@antinomia commentedadd tutorial link