Merge branch 'master' of github.com:gnuboard/g4s
This commit is contained in:
@ -7,6 +7,7 @@ $menu['menu100'] = array (
|
||||
//array('100400', '버전정보', G4_ADMIN_URL.'/version.php', 'cf_version'),
|
||||
array('100800', '세션파일 일괄삭제',G4_ADMIN_URL.'/session_file_delete.php', 'cf_session', 1),
|
||||
array('100900', '캐쉬파일 일괄삭제',G4_ADMIN_URL.'/cache_file_delete.php', 'cf_cache', 1),
|
||||
array('100920', '썸네일파일 일괄삭제',G4_ADMIN_URL.'/thumbnail_file_delete.php', 'cf_cache', 1),
|
||||
array('100500', 'phpinfo()', G4_ADMIN_URL.'/phpinfo.php', 'cf_phpinfo'),
|
||||
//array('100600', '업그레이드', G4_ADMIN_URL.'/upgrade.php', 'cf_upgrade'),
|
||||
//array('100700', '복구/최적화', G4_ADMIN_URL.'/repair.php', 'cf_repair'),
|
||||
|
||||
67
adm/thumbnail_file_delete.php
Normal file
67
adm/thumbnail_file_delete.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?
|
||||
$sub_menu = '100920';
|
||||
include_once('./_common.php');
|
||||
|
||||
if ($is_admin != 'super')
|
||||
alert('최고관리자만 접근 가능합니다.', G4_URL);
|
||||
|
||||
$g4['title'] = '썸네일 일괄삭제';
|
||||
include_once('./admin.head.php');
|
||||
?>
|
||||
|
||||
<div id="thumbnail_del">
|
||||
<p>
|
||||
완료 메세지가 나오기 전에 프로그램의 실행을 중지하지 마십시오.
|
||||
</p>
|
||||
<?php
|
||||
$directory = array();
|
||||
$dl = array('file', 'editor');
|
||||
|
||||
foreach($dl as $val) {
|
||||
if($handle = opendir(G4_DATA_PATH.'/'.$val)) {
|
||||
while(false !== ($entry = readdir($handle))) {
|
||||
if($entry == '.' || $entry == '..')
|
||||
continue;
|
||||
|
||||
$path = G4_DATA_PATH.'/'.$val.'/'.$entry;
|
||||
|
||||
if(is_dir($path))
|
||||
$directory[] = $path;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flush();
|
||||
|
||||
if (empty($directory)) {
|
||||
echo '<p>썸네일디렉토리를 열지못했습니다.</p>';
|
||||
}
|
||||
|
||||
$cnt=0;
|
||||
echo '<ul>'.PHP_EOL;
|
||||
|
||||
foreach($directory as $dir) {
|
||||
$files = glob($dir.'/thumb-*');
|
||||
if (is_array($files)) {
|
||||
foreach($files as $thumbnail) {
|
||||
$cnt++;
|
||||
@unlink($thumbnail);
|
||||
|
||||
echo '<li>'.$thumbnail.'</li>'.PHP_EOL;
|
||||
|
||||
flush();
|
||||
|
||||
if ($cnt%10==0)
|
||||
echo PHP_EOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo '<li>완료됨</li></ul>'.PHP_EOL;
|
||||
echo '<p><span>썸네일 '.$cnt.'건의 삭제가 완료됐습니다.</span><br>프로그램의 실행을 끝마치셔도 좋습니다.</p>'.PHP_EOL;
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include_once('./admin.tail.php');
|
||||
?>
|
||||
Reference in New Issue
Block a user