node_load

Events happening in the community are now at Drupal community events on www.drupal.org.
marinv's picture

distance through

Hello

I am using node_load in order to calculate the distance of a hotel to the city center.
There are two content types: "hotel", which contains the fields latitude, longitude and city;
The other content type is "city" with city name as title and the fields latitude and longitude, the coordinates of the city center (thanks to maxmind.com geolite dates};

I am using the following script:

<?php
$title=$data->node_title;
$city = $data->node_data_field_hid_field_city_value;
$k = $data->node_data_field_hid_field_latitud_value;

Read more
KingMoore's picture

Fetching CCK nodes spanning multiple Content Types

CCK: 6.x-2.1
Drupal: 6.8

I am working on a module that needs to fetch sets of nodes based on various criteria (I don't think the criteria isn overly important for this discussion). The content nodes may span all content types installed on the site. I need to fetch a list of all the nodes matching my requirements and all of their fields/content.

I need this basic functionality:

$result = db_query('SELECT * FROM {node} WHERE #my conditions are met#');
while($row = db_fetch_object($result)){
 
  $node = node_load($row->nid);

  ... do stuff ...

}
Read more
Subscribe with RSS Syndicate content