From 06f2c72d846c9673949bba8ce3a611eadd5bb8b4 Mon Sep 17 00:00:00 2001 From: gnuboard Date: Tue, 19 Feb 2013 13:03:56 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B8=80,=EB=8C=93=EA=B8=80=20=EC=93=B0?= =?UTF-8?q?=EA=B8=B0=EC=8B=9C=20=EC=BA=90=EC=8B=9C=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/board_list_update.php | 20 ++++++++++---------- bbs/delete_all.php | 4 +++- bbs/write_comment_update.php | 2 ++ bbs/write_update.php | 5 +++-- index.php | 3 +-- lib/common.lib.php | 9 +++++++++ 6 files changed, 28 insertions(+), 15 deletions(-) diff --git a/bbs/board_list_update.php b/bbs/board_list_update.php index 8302c1bd3..a43924024 100644 --- a/bbs/board_list_update.php +++ b/bbs/board_list_update.php @@ -4,18 +4,18 @@ include_once('./_common.php'); $count = count($_POST['chk_wr_id']); if(!$count) { - alert($_POST['btn_submit']." 하실 항목을 하나 이상 선택하세요."); + alert($_POST['btn_submit'].' 하실 항목을 하나 이상 선택하세요.'); } -if($_POST['btn_submit'] == "선택삭제") { - include "./delete_all.php"; -} else if($_POST['btn_submit'] == "선택복사") { - $sw = "copy"; - include "./move.php"; -} else if($_POST['btn_submit'] == "선택이동") { - $sw = "move"; - include "./move.php"; +if($_POST['btn_submit'] == '선택삭제') { + include './delete_all.php'; +} else if($_POST['btn_submit'] == '선택복사') { + $sw = 'copy'; + include './move.php'; +} else if($_POST['btn_submit'] == '선택이동') { + $sw = 'move'; + include './move.php'; } else { - alert("올바른 방법으로 이용해 주세요."); + alert('올바른 방법으로 이용해 주세요.'); } ?> \ No newline at end of file diff --git a/bbs/delete_all.php b/bbs/delete_all.php index 90b5e7098..06ae7bfbf 100644 --- a/bbs/delete_all.php +++ b/bbs/delete_all.php @@ -92,7 +92,7 @@ for ($i=count($tmp_array)-1; $i>=0; $i--) $result2 = sql_query($sql2); while ($row2 = sql_fetch_array($result2)) // 파일삭제 - @unlink(G4_PATH.'/data/file/'.$bo_table.'/'.$row2['bf_file']); + @unlink(G4_DATA_PATH.'/file/'.$bo_table.'/'.$row2['bf_file']); // 파일테이블 행 삭제 sql_query(" delete from {$g4['board_file_table']} where bo_table = '$bo_table' and wr_id = '{$row['wr_id']}' "); @@ -136,5 +136,7 @@ if ($count_write > 0 || $count_comment > 0) // 4.11 @include_once($board_skin_path.'/delete_all.tail.skin.php'); +delete_cache_latest($bo_table); + goto_url('./board.php?bo_table='.$bo_table.'&page='.$page.$qstr); ?> diff --git a/bbs/write_comment_update.php b/bbs/write_comment_update.php index 56dc4f825..364ccfefc 100644 --- a/bbs/write_comment_update.php +++ b/bbs/write_comment_update.php @@ -312,5 +312,7 @@ else if ($w == 'cu') // 코멘트 수정 @include_once($board_skin_path.'/write_comment_update.skin.php'); @include_once($board_skin_path.'/write_comment_update.tail.skin.php'); +delete_cache_latest($bo_table); + goto_url('./board.php?bo_table='.$bo_table.'&wr_id='.$wr['wr_parent'].'&page='.$page.$qstr.'&#c_'.$comment_id); ?> diff --git a/bbs/write_update.php b/bbs/write_update.php index a27d4c09c..19b948ae7 100644 --- a/bbs/write_update.php +++ b/bbs/write_update.php @@ -602,10 +602,11 @@ if (!($w == 'u' || $w == 'cu') && $config['cf_email_use'] && $board['bo_use_emai } // 사용자 코드 실행 -@include_once ($board_skin_path.'/write_update.skin.php'); - +@include_once($board_skin_path.'/write_update.skin.php'); @include_once($board_skin_path.'/write_update.tail.skin.php'); +delete_cache_latest($bo_table); + if ($file_upload_msg) alert($file_upload_msg, G4_HTTPS_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.'&page='.$page.$qstr); else diff --git a/index.php b/index.php index ed59f5b89..3f6b26af3 100644 --- a/index.php +++ b/index.php @@ -7,7 +7,6 @@ include_once('./_head.php'); diff --git a/lib/common.lib.php b/lib/common.lib.php index e90251f70..4567117e2 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -1732,4 +1732,13 @@ function check_device($device) alert('모바일 전용 게시판입니다.', G4_URL); } } + + +// 게시판 최신글 캐시 파일 삭제 +function delete_cache_latest($bo_table) +{ + foreach (glob(G4_DATA_PATH.'/cache/latest-'.$bo_table.'-*') as $filename) { + unlink($filename); + } +} ?> \ No newline at end of file