Changeset 28498
- Timestamp:
- May 18, 2014, 9:12:50 AM (10 years ago)
- Location:
- extensions/rv_gmaps/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/rv_gmaps/trunk/admin/admin_boot.php
r26331 r28498 3 3 4 4 include_once( dirname(dirname(__FILE__)) .'/include/functions.php'); 5 6 add_event_handler('invalidate_user_cache', 'rvm_invalidate_cache' );7 5 8 6 add_event_handler('get_admin_plugin_menu_links', 'rvm_plugin_admin_menu' ); … … 89 87 WHERE id IN ('.implode(',',$collection).')'; 90 88 pwg_query($update_query); 91 rvm_invalidate_cache();92 89 } 93 90 } -
extensions/rv_gmaps/trunk/include/functions.php
r26331 r28498 1 1 <?php 2 3 function rvm_get_cache_file_name()4 {5 global $conf;6 return PHPWG_ROOT_PATH.$conf['data_location'].'/tmp/_rvgm_cat_cache.dat';7 }8 9 function rvm_invalidate_cache()10 {11 @unlink( rvm_get_cache_file_name() );12 }13 2 14 3 function rvm_load_language($source=false) -
extensions/rv_gmaps/trunk/include/functions_map.php
r26331 r28498 284 284 function rvm_get_cat_bounds() 285 285 { 286 $cache_file_name = rvm_get_cache_file_name(); 287 if ( file_exists($cache_file_name) ) 288 { 289 return unserialize( file_get_contents($cache_file_name) ); 290 } 291 $forbidden = get_sql_condition_FandF( 292 array 293 ( 294 'forbidden_categories' => 'category_id', 295 'visible_categories' => 'category_id', 296 'visible_images' => 'i.id' 297 ), 298 'AND' 299 ); 286 global $persistent_cache; 287 if ($persistent_cache->get('rvgm_album_bounds', $cat_bounds)) 288 return $cat_bounds; 300 289 301 290 $query = ' … … 307 296 INNER JOIN 308 297 '.IMAGES_TABLE.' i ON image_id=i.id 309 WHERE lat IS NOT NULL '.$forbidden.' 310 GROUP BY category_id 311 ;'; 298 WHERE latitude IS NOT NULL 299 GROUP BY category_id'; 312 300 313 301 $result = pwg_query($query); … … 349 337 } 350 338 //echo "<pre>" . var_export($cat_bounds,true); 351 mkgetdir( dirname($cache_file_name) ); 352 $file = fopen($cache_file_name , 'w' ); 353 fwrite($file, serialize($cat_bounds) ); 354 fclose( $file ); 355 339 340 $persistent_cache->set('rvgm_album_bounds', $cat_bounds); 356 341 return $cat_bounds; 357 342 } … … 375 360 ( 376 361 'forbidden_categories' => 'category_id', 377 'visible_categories' => 'category_id', 378 'visible_images' => 'i.id' 362 'forbidden_images' => 'i.id' 379 363 ), 380 364 "\n AND" … … 530 514 $page['title'] = l10n('Recent photos'); 531 515 } 532 else 516 elseif ('list'==$page['section']) 533 517 { 534 518 $query =' -
extensions/rv_gmaps/trunk/main.inc.php
r26717 r28498 1 1 <?php /* 2 2 Plugin Name: RV Maps&Earth 3 Version: 2. 6.a3 Version: 2.7.a 4 4 Description: Extend your gallery with Google Maps and Google Earth ... 5 5 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=122 -
extensions/rv_gmaps/trunk/maintain.inc.php
r26331 r28498 67 67 @unlink( PHPWG_ROOT_PATH.'map.php' ); 68 68 } 69 70 rvm_invalidate_cache();71 69 } 72 70
Note: See TracChangeset
for help on using the changeset viewer.