Ignore:
Timestamp:
Dec 29, 2013, 3:14:42 PM (11 years ago)
Author:
rvelices
Message:

rv_gmaps compatible with nez latitude/longitude fields in piwigo core 2.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/rv_gmaps/trunk/include/functions_map.php

    r22180 r26331  
    129129  if ( !isset($b) or empty($b) )
    130130    return null;
    131   $sql_where = 'i.lat BETWEEN '.$b['s'].' AND '.($b['n']);
     131  $sql_where = 'i.latitude BETWEEN '.$b['s'].' AND '.($b['n']);
    132132  $sql_where .= ' AND ';
    133133  if ($b['e'] >= $b['w'])
    134     $sql_where .= 'i.lon BETWEEN '.$b['w'].' AND '.($b['e']);
     134    $sql_where .= 'i.longitude BETWEEN '.$b['w'].' AND '.($b['e']);
    135135  else
    136     $sql_where .= 'i.lon NOT BETWEEN '.($b['e']+1e-7).' AND '.($b['w']-1e-7);
     136    $sql_where .= 'i.longitude NOT BETWEEN '.($b['e']+1e-7).' AND '.($b['w']-1e-7);
    137137  return $sql_where;
    138138}
     
    172172  if ($bounds['e']>180) $bounds['e']-=360;
    173173  $where_sql = rvm_bounds_to_sql( $bounds );
    174   $order_by = 'ORDER BY POW('.$ll['lat'].'-i.lat,2)+POW('.$cos_lat.'*('.$ll['lon'].'-i.lon),2)';
     174  $order_by = 'ORDER BY POW('.$ll['lat'].'-i.latitude,2)+POW('.$cos_lat.'*('.$ll['lon'].'-i.longitude),2)';
    175175  return $where_sql;
    176176}
     
    300300
    301301  $query = '
    302 SELECT category_id cat_id, uppercats, MAX(lat) AS n, MIN(lat) AS s, MAX(lon) AS e, MIN(lon) AS w, COUNT(i.id) count, MIN(i.date_creation) min_date, MAX(i.date_creation) max_date
     302SELECT category_id cat_id, uppercats, MAX(latitude) AS n, MIN(latitude) AS s, MAX(longitude) AS e, MIN(longitude) AS w, COUNT(i.id) count, MIN(i.date_creation) min_date, MAX(i.date_creation) max_date
    303303  FROM
    304304    '.CATEGORIES_TABLE.' as c
     
    369369
    370370  if (empty($where_sql))
    371     $where_sql .= 'i.lat IS NOT NULL';
     371    $where_sql .= 'i.latitude IS NOT NULL';
    372372  $where_sql_images_only = $where_sql;
    373373  $where_sql .= get_sql_condition_FandF(
Note: See TracChangeset for help on using the changeset viewer.