Hi

Great module :-)

I'm using views to create lists of nearby nodes, but a cant filter out long distances based on the users location - like show only events in my neighborhood, or users in my neighborhood.

The distance from the users location works fine in fields and sorting, where I can sort the distance based on the users origin (Origin:
User's location (blank if unset) ).

This option is not present for Filters, where I want to show nodes within a certain distance and exclude nodes beyond a custom distance.

This would be a great feature :-)

Thanks Bo

Comments

marcoBauli’s picture

this functionality seems a blow from being completed..and it will be a good one! Can anyone tell if is there any patch somehwere, or if is interested in a bounty to get it done? Many thanks

marcoBauli’s picture

seems some work is going on at http://drupal.org/node/343943 and http://drupal.org/node/321114

hope to find some time to test later today. cheers

rorymadden’s picture

I am also interested in this functionality.

@marcoBauli - did you figure out a way to get this working?

Thanks in advance

yesct’s picture

marcoBauli’s picture

@rorymadden: yes, a patch should come shortly :)

Roberto Gerola’s picture

Status: Needs review » Active
StatusFileSize
new1.11 KB

Hi.

I developed a patch for this.
The development has been sponsored by Tecnomeme.

Roberto

yesct’s picture

Status: Active » Needs review
bjalford’s picture

Can someone cofirm whether this is for using with node location and user location or whether it works with CCK?

marcoBauli’s picture

@bjalford: actually it works with users and node locations. not completely sure about what you mean with 'works with cck' though..

yesct’s picture

there are the legacy "native" locations on nodes and users. And there are the "new" cck locations that are part of location module now. many of us are really hoping to see views work with the cck locations.

tom78’s picture

does this patch work with D5?

best regards
tom

tiger_h’s picture

This was working for me

My code in file /handlers/location_views_handler_filter_proximity.inc line 153 following


  // Used from the distance field.
  function calculate_coords() {
    if (!empty($this->value['latitude']) && !empty($this->value['longitude'])) {
      // If there are already coordinates, there's no work for us.
      return TRUE;
    }
 
else {
global $user;
$user->location = location_load_locations($user->uid, 'uid');

 if(!empty($user->location[0]['latitude']) && !empty($user->location[0]['longitude'])) {
 $this->value['latitude'] = $user->location[0]['latitude'];
$this->value['longitude'] = $user->location[0]['longitude'];
 return TRUE;
 }    
}    
		    
 // @@@ Switch to mock location object and rely on location more?

    if ($this->options['type'] == 'postal' || $this->options['type'] == 'postal_default') {
      // Force default for country.
      if ($this->options['type'] == 'postal_default') {
  

yesct’s picture

Status: Active » Needs review

This patch needs a review:
http://drupal.org/patch/review
(and maybe a re-roll http://drupal.org/patch/create)

How does this relate to
#606342: Views Argument Handler for Proximity
?

ankur’s picture

Status: Needs review » Closed (fixed)

As suggested by YesCT in #13, this is now possible with #606342: Views Argument Handler for Proximity