Changeset 18951 for extensions/rv_gmaps/trunk/admin/admin_boot.php
- Timestamp:
- Nov 6, 2012, 9:55:00 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/rv_gmaps/trunk/admin/admin_boot.php
r18728 r18951 172 172 173 173 $template->set_prefilter('batch_manager_unit', 'rvm_prefilter_batch_manager_unit'); 174 175 if (empty($page['cat_elements_id']))176 return;177 178 $query = '179 SELECT id,lat,lon180 FROM '.IMAGES_TABLE;181 182 if ($is_category)183 {184 $category_info = get_cat_info($_SESSION['bulk_manager_filter']['category']);185 186 $conf['order_by'] = $conf['order_by_inside_category'];187 if (!empty($category_info['image_order']))188 {189 $conf['order_by'] = ' ORDER BY '.$category_info['image_order'];190 }191 192 $query.= '193 JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id';194 }195 196 $query.= '197 WHERE id IN ('.implode(',', $page['cat_elements_id']).')';198 199 if ($is_category)200 {201 $query.= '202 AND category_id = '.$_SESSION['bulk_manager_filter']['category'];203 }204 205 $query.= '206 '.$conf['order_by'].'207 LIMIT '.$page['nb_images'].' OFFSET '.$page['start'].'208 ;';209 $result = pwg_query($query);210 211 $tpl_vars = array();212 while ($row = pwg_db_fetch_assoc($result))213 {214 // remove last zeros for better display215 $row['lat'] = preg_replace('#\.([0-9]*?)([0]+)$#', '.$1', $row['lat']);216 $row['lon'] = preg_replace('#\.([0-9]*?)([0]+)$#', '.$1', $row['lon']);217 218 $tpl_vars[ $row['id'] ] = array(219 'LAT' => rtrim($row['lat'], '.'),220 'LON' => rtrim($row['lon'], '.'),221 );222 }223 224 $template->assign('GEOTAG', $tpl_vars);225 174 } 226 175 … … 234 183 <td> 235 184 <label>{\'Latitude\'|@translate} 236 <input type="text" size="8" name="lat-{$element. ID}" value="{$GEOTAG[$element.ID].LAT}">185 <input type="text" size="8" name="lat-{$element.id}" value="{$element.lat}"> 237 186 </label> 238 187 <label>{\'Longitude\'|@translate} 239 <input type="text" size="9" name="lon-{$element. ID}" value="{$GEOTAG[$element.ID].LON}">188 <input type="text" size="9" name="lon-{$element.id}" value="{$element.lon}"> 240 189 </label> 241 190 </td>
Note: See TracChangeset
for help on using the changeset viewer.