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

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

Location:
extensions/rv_gmaps/trunk/include
Files:
3 edited

Legend:

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

    r23519 r26331  
    2929  $query = '
    3030SELECT id FROM '.IMAGES_TABLE.'
    31 WHERE lat IS NOT NULL
     31WHERE latitude IS NOT NULL
    3232  AND id IN ('.implode(',', $items).')
    3333ORDER BY NULL
  • 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(
  • extensions/rv_gmaps/trunk/include/picture_map.inc.php

    r24745 r26331  
    3636                        'MAP_TYPE' => rvm_get_config_var('map_type', 'ROADMAP'),
    3737      'U_NO_MAP' => duplicate_picture_url(),
    38       'U_BLOWUP' => rvm_make_blowup_url( array('ll'=>$picture), array('start','box') ),
     38      'U_BLOWUP' => rvm_make_blowup_url( array('ll'=> array('lat'=>$picture['latitude'],'lon'=>$picture['longitude'])), array('start','box') ),
    3939      'COMMENT_IMG' => trigger_event('render_element_description', $picture['comment'])
    4040    )
    4141  );
    42   if ( isset($picture['lat']) )
     42  if ( isset($picture['latitude']) )
    4343  {
    4444    $template->assign( 'coordinates',
    4545        array(
    46           'LAT' => $picture['lat'],
    47           'LON' => $picture['lon'],
     46          'LAT' => $picture['latitude'],
     47          'LON' => $picture['longitude'],
    4848        )
    4949      );
Note: See TracChangeset for help on using the changeset viewer.