You are here

function getlocations_check_node in Get Locations 6

Same name and namespace in other branches
  1. 6.2 getlocations.module \getlocations_check_node()
  2. 7.2 getlocations.module \getlocations_check_node()
  3. 7 getlocations.module \getlocations_check_node()
1 call to getlocations_check_node()
getlocations_get_types in ./getlocations.module

File

./getlocations.module, line 1070
Displays locations on a map. for Drupal 6 using version 3 googlemaps API

Code

function getlocations_check_node($type) {
  $module = FALSE;
  if (module_exists('location_node')) {
    return TRUE;
  }
  if (module_exists('location_cck')) {
    $module = 'location_cck';
  }
  if ($module) {
    $sql = "SELECT i.type_name FROM {content_node_field} f, {content_node_field_instance} i ";
    $sql .= "WHERE f.field_name = i.field_name ";
    $sql .= "AND f.module = i.widget_module ";
    $sql .= "AND f.module = '" . $module . "' ";
    $sql .= "AND i.type_name = '" . $type . "' ";
    $sql .= "AND f.active=1 ";
    $sql .= "AND i.widget_active=1 ";
    $data = '';
    $result = db_query($sql);
    if (count($result) > 0) {
      $data = db_fetch_array($result);
      if ($data != FALSE) {
        return TRUE;
      }
    }
  }
  return FALSE;
}