글,댓글 쓰기시 캐시파일 삭제

This commit is contained in:
gnuboard
2013-02-19 13:03:56 +09:00
parent 57f617b2bd
commit 06f2c72d84
6 changed files with 28 additions and 15 deletions

View File

@ -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('올바른 방법으로 이용해 주세요.');
}
?>

View File

@ -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);
?>

View File

@ -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);
?>

View File

@ -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

View File

@ -7,7 +7,6 @@ include_once('./_head.php');
<!-- 메인화면 최신글 시작 -->
<?
/*
// 최신글
$sql = " select bo_table from {$g4['board_table']} order by gr_id, bo_table ";
$result = sql_query($sql);
@ -27,7 +26,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
?>
</div>
<?
}*/
}
?>
<!-- 메인화면 최신글 끝 -->

View File

@ -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);
}
}
?>