이미지 확장자일때만 썸네일 삭제하도록 수정
This commit is contained in:
@ -82,6 +82,7 @@ while ($row = sql_fetch_array($result))
|
||||
while ($row2 = sql_fetch_array($result2)) {
|
||||
@unlink(G4_DATA_PATH.'/file/'.$bo_table.'/'.$row2['bf_file']);
|
||||
// 썸네일삭제
|
||||
if(preg_match("/\.({$config['cf_image_extension']})$/i", $row2['bf_file']) {
|
||||
$dir = G4_DATA_PATH.'/file/'.$bo_table;
|
||||
if($dh = opendir($dir)) {
|
||||
while(($file = readdir($dh)) !== false) {
|
||||
@ -95,6 +96,7 @@ while ($row = sql_fetch_array($result))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 파일테이블 행 삭제
|
||||
sql_query(" delete from {$g4['board_file_table']} where bo_table = '$bo_table' and wr_id = '{$row['wr_id']}' ");
|
||||
|
||||
@ -95,6 +95,7 @@ for ($i=count($tmp_array)-1; $i>=0; $i--)
|
||||
@unlink(G4_DATA_PATH.'/file/'.$bo_table.'/'.$row2['bf_file']);
|
||||
|
||||
// 썸네일삭제
|
||||
if(preg_match("/\.({$config['cf_image_extension']})$/i", $row2['bf_file']) {
|
||||
$dir = G4_DATA_PATH.'/file/'.$bo_table;
|
||||
if($dh = opendir($dir)) {
|
||||
while(($file = readdir($dh)) !== false) {
|
||||
@ -108,6 +109,7 @@ for ($i=count($tmp_array)-1; $i>=0; $i--)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 파일테이블 행 삭제
|
||||
sql_query(" delete from {$g4['board_file_table']} where bo_table = '$bo_table' and wr_id = '{$row['wr_id']}' ");
|
||||
|
||||
Reference in New Issue
Block a user