(location distance/proximityof drupal7 )not filtering nodes 100miles or km from source point(venue)

Posted: Fri, Apr 27, 2012 - 05:26pm

Hai ,

Kindly send me the details of how to  get the nodes(destination point at definite distance from source point ( say,100milesor km away))displayed in view results,if filtered by latitude and longitude of another view(ie.source point lat&long being selected by user)?

Hi Preetha, please do not

  • Wed, May 09, 2012 - 01:15pm

Hi Preetha, please do not expect ready-made answers.
And can you please detail how are you associating a latitude/longitude to a node?

In any case, there are plenty of ways to calculate distance between 2 poitns, both server-side and client-side (including support from google maps):
http://stackoverflow.com/questions/1502590/calculate-distance-between-two-points-in-google-maps-v3  

__________________

Rahul Singla
Signature

node save with image fields

  • Fri, Jun 01, 2012 - 06:08pm

hai...........

  i want to add a node using node_save . i have a doubt  about images adding  into node . i want to images add to node without download to the local server . image url taken from remote .iam doing like this way...

<?php

global $user;
$node = new stdClass();
         $node->type = 'hotel_image';
         $node->language = 'und';
          $node->title='surya';
       $node->field_image_hotel_id[$node->language][0]['value'] =123456;
           $node->uid=$user->uid;
      $node->status=1;
 $url = 'http://m.travelpn.com/images/ari_atoll/hotel/0/080043/Guest_room_B_1.jpg';
$url= file_stream_wrapper_uri_normalize($url);
$filesize=remotefilesize($url) ;
function remotefilesize($url) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_NOBODY, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE); // 200
$filesize = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD); //filesize
curl_close($ch);
if( 200 != $status )
throw new Exception('File not found!');
return $filesize;
}
$file = new stdClass();
  $file->fid = NULL;
  $file->uri = $url;
  $file->filename = basename($file->uri);
  $file->filemime = file_get_mimetype($file->uri);
  $file->uid = $GLOBALS['user']->uid;
  $file->status = FILE_STATUS_PERMANENT;
file_save($file);

but i got an error  

Warning: filesize() [function.filesize]: stat failed for http://m.travelpn.com/images/ari_atoll/hotel/0/080043/Guest_room_B_1.jpg in file_save() (line 573 of /var/www/divya/travel-dev/includes/file.inc). ..

pls help me..

  

Hi preetha, please see my

  • Tue, Jan 01, 2013 - 09:56pm

Hi preetha, please see my reply here:
http://ike.co.in/forum/topic/63/node-save-with-images 

__________________

Rahul Singla
Signature