Changeset 15345 for extensions/GMaps/gmaps_ajax.php
- Timestamp:
- May 27, 2012, 2:04:11 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/GMaps/gmaps_ajax.php
r12214 r15345 21 21 // in this case, PHPWG_ROOT_PATH must be declared as an absolute path... 22 22 define('PHPWG_ROOT_PATH',dirname(dirname(dirname(__FILE__))).'/'); 23 24 23 /* 25 24 * set ajax module in admin mode if request is used for admin interface … … 1200 1199 GROUP_CONCAT(DISTINCT IF(pct.permalink IS NULL, CONCAT('*', pct.id), pct.permalink) ORDER BY pct.id SEPARATOR ';') AS imageCatsPLink, 1201 1200 pit.name AS imageName, 1202 pit.path , pit.tn_ext1201 pit.path 1203 1202 FROM (((".$this->tables['cache']." pgc 1204 1203 LEFT JOIN ".IMAGE_CATEGORY_TABLE." pic ON pic.image_id = pgc.imageId) … … 1231 1230 { 1232 1231 $row['imageName'] =GPCCore::getUserLanguageDesc($row['imageName']); 1233 $row['imageTnFile']= dirname($row['path']).'/'.$conf['dir_thumbnail'].'/'.$conf['prefix_thumbnail'].get_filename_wo_extension(basename($row['path'])).'.'.$row['tn_ext'];1232 $row['imageTnFile']=str_replace(PHPWG_ROOT_PATH, './', DerivativeImage::thumb_url(array('id'=>$row['imageId'], 'path'=>$row['path']))); 1234 1233 if(!$this->checkInGroup($row, $groups, $datas['distanceTreshold'])) 1235 1234 { … … 1265 1264 { 1266 1265 $tmpCatsNames[$key]=GPCCore::getUserLanguageDesc(substr($tmpCatsNames[$key],7)); 1267 1268 $tmpCatsUrl[]=make_picture_url( 1269 array( 1270 'image_id' => $point['imageId'], 1271 'category' => array( 1272 'id' => $id, 1273 'name' => $tmpCatsNames[$key], 1274 'permalink' => (substr($tmpCatsPLinks[$key],0,1)=='*')?'':$tmpCatsPLinks[$key], 1266 $tmpCatsUrl[]=$this->replaceRoot(str_replace(PHPWG_ROOT_PATH, './', 1267 make_picture_url( 1268 array( 1269 'image_id' => $point['imageId'], 1270 'category' => array( 1271 'id' => $id, 1272 'name' => $tmpCatsNames[$key], 1273 'permalink' => (substr($tmpCatsPLinks[$key],0,1)=='*')?'':$tmpCatsPLinks[$key], 1274 ) 1275 1275 ) 1276 1276 ) 1277 ) ;1277 )); 1278 1278 } 1279 1279 … … 1285 1285 $coords['lng']+=$point['longitude']; 1286 1286 1287 $coords['imgTn'][]=$this->replace ImgRoot($point['imageTnFile']);1287 $coords['imgTn'][]=$this->replaceRoot($point['imageTnFile']); 1288 1288 $coords['imgCatsNames'][]=$tmpCatsNames; 1289 1289 $coords['imgName'][]=GPCCore::getUserLanguageDesc($point['imageName']); … … 1348 1348 /** 1349 1349 * replace the root directroy for image 1350 * => './galleries/' becomes "G" 1351 * => './upload/' becomes "U" 1350 * => './_data/i/galleries/' becomes "G" 1351 * => './i.php?/galleries/' becomes "I" 1352 * => './picture.php?/' becomes "P" 1352 1353 * => other case : no chnages 1353 1354 * … … 1355 1356 * @returned String : 1356 1357 */ 1357 private function replaceImgRoot($value) 1358 { 1359 if(preg_match('/^\.\/galleries\//i', $value)>0) 1360 { 1361 return("G".substr($value,12)); 1362 } 1363 elseif(preg_match('/^\.\/upload\//i', $value)>0) 1364 { 1365 return("U".substr($value,9)); 1358 private function replaceRoot($value) 1359 { 1360 if(preg_match('/^\.\/_data\/i\/galleries\//i', $value)>0) 1361 { 1362 return("G".substr($value,20)); 1363 } 1364 if(preg_match('/^\.\/i\.php\?\/galleries\//i', $value)>0) 1365 { 1366 return("I".substr($value,19)); 1367 } 1368 if(preg_match('/^\.\/picture\.php\?\//i', $value)>0) 1369 { 1370 return("P".substr($value,15)); 1366 1371 } 1367 1372 return($value);
Note: See TracChangeset
for help on using the changeset viewer.