0 || $count_comment > 0) { sql_query(" update {$g5['board_table']} set bo_count_write = bo_count_write - '$count_write', bo_count_comment = bo_count_comment - '$count_comment' where bo_table = '$bo_table' "); } } } else // 코멘트 삭제 { //-------------------------------------------------------------------- // 코멘트 삭제시 답변 코멘트 까지 삭제되지는 않음 //-------------------------------------------------------------------- //print_r2($write); $comment_id = $wr_id; $len = strlen($write['wr_comment_reply']); if ($len < 0) $len = 0; $comment_reply = substr($write['wr_comment_reply'], 0, $len); // 코멘트 삭제 if (!delete_point($write['mb_id'], $bo_table, $comment_id, '코멘트')) { insert_point($write['mb_id'], $board['bo_comment_point'] * (-1), "{$board['bo_subject']} {$write['wr_parent']}-{$comment_id} 코멘트삭제"); } // 코멘트 삭제 sql_query(" delete from $write_table where wr_id = '$comment_id' "); // 코멘트가 삭제되므로 해당 게시물에 대한 최근 시간을 다시 얻는다. $sql = " select max(wr_datetime) as wr_last from $write_table where wr_parent = '{$write['wr_parent']}' "; $row = sql_fetch($sql); // 원글의 코멘트 숫자를 감소 sql_query(" update $write_table set wr_comment = wr_comment - 1, wr_last = '{$row['wr_last']}' where wr_id = '{$write['wr_parent']}' "); // 코멘트 숫자 감소 sql_query(" update {$g5['board_table']} set bo_count_comment = bo_count_comment - 1 where bo_table = '$bo_table' "); // 새글 삭제 sql_query(" delete from {$g5['board_new_table']} where bo_table = '$bo_table' and wr_id = '$comment_id' "); } } $save_bo_table = array_unique($save_bo_table); foreach ($save_bo_table as $key=>$value) { delete_cache_latest($value); } run_event('bbs_new_delete', $chk_bn_id, $save_bo_table); goto_url("new.php?sfl=$sfl&stx=$stx&page=$page"); ?>