diff --git a/bbs/delete.php b/bbs/delete.php index 9d38fda5e..b2df50c36 100644 --- a/bbs/delete.php +++ b/bbs/delete.php @@ -79,8 +79,22 @@ while ($row = sql_fetch_array($result)) // 업로드된 파일이 있다면 파일삭제 $sql2 = " select * from {$g4['board_file_table']} where bo_table = '$bo_table' and wr_id = '{$row['wr_id']}' "; $result2 = sql_query($sql2); - while ($row2 = sql_fetch_array($result2)) + while ($row2 = sql_fetch_array($result2)) { @unlink(G4_DATA_PATH.'/file/'.$bo_table.'/'.$row2['bf_file']); + // 썸네일삭제 + $dir = G4_DATA_PATH.'/file/'.$bo_table; + if($dh = opendir($dir)) { + while(($file = readdir($dh)) !== false) { + if($file == "." || $file == "..") + continue; + + $filename = preg_replace("/\.[^\.]+$/i", "", $row2['bf_file']); + if(strstr($file, $filename) && strpos($file, $filename) != 0) { + @unlink($dir.'/'.$file); + } + } + } + } // 파일테이블 행 삭제 sql_query(" delete from {$g4['board_file_table']} where bo_table = '$bo_table' and wr_id = '{$row['wr_id']}' "); @@ -121,7 +135,5 @@ if ($count_write > 0 || $count_comment > 0) @include_once($board_skin_path.'/delete.tail.skin.php'); -delete_cache_latest($bo_table); - goto_url('./board.php?bo_table='.$bo_table.'&page='.$page.$qstr); ?> diff --git a/bbs/delete_all.php b/bbs/delete_all.php index 06ae7bfbf..de4d0905e 100644 --- a/bbs/delete_all.php +++ b/bbs/delete_all.php @@ -90,10 +90,25 @@ for ($i=count($tmp_array)-1; $i>=0; $i--) // 업로드된 파일이 있다면 $sql2 = " select * from {$g4['board_file_table']} where bo_table = '$bo_table' and wr_id = '{$row['wr_id']}' "; $result2 = sql_query($sql2); - while ($row2 = sql_fetch_array($result2)) + while ($row2 = sql_fetch_array($result2)) { // 파일삭제 @unlink(G4_DATA_PATH.'/file/'.$bo_table.'/'.$row2['bf_file']); + // 썸네일삭제 + $dir = G4_DATA_PATH.'/file/'.$bo_table; + if($dh = opendir($dir)) { + while(($file = readdir($dh)) !== false) { + if($file == "." || $file == "..") + continue; + + $filename = preg_replace("/\.[^\.]+$/i", "", $row2['bf_file']); + if(strstr($file, $filename) && strpos($file, $filename) != 0) { + @unlink($dir.'/'.$file); + } + } + } + } + // 파일테이블 행 삭제 sql_query(" delete from {$g4['board_file_table']} where bo_table = '$bo_table' and wr_id = '{$row['wr_id']}' "); diff --git a/css/adm.css b/css/adm.css index 3baf5cf6e..b89ead4f0 100644 --- a/css/adm.css +++ b/css/adm.css @@ -66,14 +66,14 @@ h2 {font-size:1.2em} .gnb_js {} .gnb_js ul {zoom:1} .gnb_js ul:after {display:block;visibility:hidden;clear:both;content:""} -.gnb_js .gnb_1depth {position:relative;float:left;margin-left:-1px;border:1px solid #222;border-top:0;border-bottom:0} +.gnb_js .gnb_1depth {position:relative;float:left;margin-left:-1px;width:90px;border:1px solid #222;border-top:0;border-bottom:0} .gnb_js .gnb_1depth a {display:inline-block;float:none;width:90px;height:35px;color:#e0e0e0;font-weight:bold;text-align:center} .gnb_js .gnb_1depth_air a {float:none;background:#f7f7f2;color:#000} .gnb_js .gnb_1depth_on a {float:none;background:#fff;color:#000} .gnb_js .gnb_1depth a:focus, .gnb_js .gnb_1depth a:hover, .gnb_js .gnb_1depth a:active {text-decoration:none} -.gnb_js .gnb_1depth ul {width:0px;height:0px;overflow:hidden} +.gnb_js .gnb_1depth ul {width:0;height:0;overflow:hidden} .gnb_js .gnb_1depth li {float:none} .gnb_js .gnb_1depth_over ul {position:absolute;top:35px;left:-1px;width:181px;height:auto;border:1px solid #ccc;border-top:0} .gnb_js .gnb_2depth a {display:inline-block;margin:0;padding:5px 10px;width:161px;height:25px;border-bottom:0;background:#fff;color:#000;font-weight:normal;text-align:left;line-height:2.1em} diff --git a/lib/thumbnail.lib.php b/lib/thumbnail.lib.php index 250615dc8..ebd9b4d79 100644 --- a/lib/thumbnail.lib.php +++ b/lib/thumbnail.lib.php @@ -98,7 +98,7 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h @chmod($target_path, 0707); } - $thumb_file = "$target_path/{$thumb_filename}_{$thumb_width}x{$thumb_height}.png"; + $thumb_file = "$target_path/thumb-{$thumb_filename}_{$thumb_width}x{$thumb_height}.png"; $thumb_time = @filemtime($thumb_file); $source_file = "$source_path/$filename"; $source_time = @filemtime($source_file); @@ -112,7 +112,7 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h // 이미지 파일이 없거나 아님 if (!$size[0]) { if (!$thumb_height) $thumb_height = $thumb_width; - $thumb_file = "$target_path/noimg_{$thumb_width}x{$thumb_height}.png"; + $thumb_file = "$target_path/thumb-noimg_{$thumb_width}x{$thumb_height}.png"; if (!file_exists($thumb_file)) { $target = imagecreate($thumb_width, $thumb_height); imagecolorallocate($target, 250, 250, 250);