Просмотр файла admin/admin_album_clearcache.php

Размер файла: 1.55Kb
  1. <?php
  2. /***************************************************************************
  3. * mides.ru
  4. * -------------------
  5. ***************************************************************************/
  6. define('IN_PHPBB', true);
  7.  
  8. if( !empty($setmodules) )
  9. {
  10. $filename = basename(__FILE__);
  11. $module['Photo_Album']['Clear_Cache'] = $filename;
  12. return;
  13. }
  14.  
  15. $phpbb_root_path = '../';
  16. require($phpbb_root_path . 'extension.inc');
  17. require('./pagestart.' . $phpEx);
  18. require($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main_album.' . $phpEx);
  19. require($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin_album.' . $phpEx);
  20.  
  21.  
  22. if( !isset($HTTP_POST_VARS['confirm']) )
  23. {
  24. $template->set_filenames(array(
  25. 'body' => 'confirm_body.tpl')
  26. );
  27.  
  28. $template->assign_vars(array(
  29. 'MESSAGE_TITLE' => $lang['Confirm'],
  30.  
  31. 'MESSAGE_TEXT' => $lang['Album_clear_cache_confirm'],
  32.  
  33. 'L_NO' => $lang['No'],
  34. 'L_YES' => $lang['Yes'],
  35.  
  36. 'S_CONFIRM_ACTION' => append_sid("admin_album_clearcache.$phpEx"),
  37. )
  38. );
  39.  
  40. $template->pparse('body');
  41.  
  42. include('./page_footer_admin.'.$phpEx);
  43. }
  44. else
  45. {
  46. $cache_dir = @opendir('../' . ALBUM_CACHE_PATH);
  47.  
  48. while( $cache_file = @readdir($cache_dir) )
  49. {
  50. if( preg_match('/(\.gif$|\.png$|\.jpg|\.jpeg)$/is', $cache_file) )
  51. {
  52. @unlink('../' . ALBUM_CACHE_PATH . $cache_file);
  53. }
  54. }
  55.  
  56. @closedir($cache_dir);
  57.  
  58. message_die(GENERAL_MESSAGE, $lang['Thumbnail_cache_cleared_successfully']);
  59. }
  60.  
  61. ?>