>>>>>> 35e2a0e57216e9ff77b98266f30f5e8f87800654 if ($bo_image_head_del) { @unlink($board_path.'/'.$bo_image_head_del); $sql_common .= " , bo_image_head = '' "; } if ($bo_image_tail_del) { @unlink($board_path.'/'.$bo_image_tail_del); $sql_common .= " , bo_image_tail = '' "; } if ($_FILES['bo_image_head']['name']) { //$bo_image_head_urlencode = urlencode($_FILES['bo_image_head']['name']); $bo_image_head_urlencode = $bo_table.'_head_'.time(); $sql_common .= " , bo_image_head = '{$bo_image_head_urlencode}' "; } if ($_FILES['bo_image_tail']['name']) { //$bo_image_tail_urlencode = urlencode($_FILES['bo_image_tail']['name']); $bo_image_tail_urlencode = $bo_table.'_tail_'.time(); $sql_common .= " , bo_image_tail = '{$bo_image_tail_urlencode}' "; } if ($w == '') { $row = sql_fetch(" select count(*) as cnt from {$g4['board_table']} where bo_table = '{$bo_table}' "); if ($row['cnt']) alert($bo_table.' 은(는) 이미 존재하는 TABLE 입니다.'); $sql = " insert into {$g4['board_table']} set bo_table = '{$bo_table}', bo_count_write = '0', bo_count_comment = '0', $sql_common "; sql_query($sql); // 게시판 테이블 생성 $file = file('./sql_write.sql'); $sql = implode($file, "\n"); $create_table = $g4['write_prefix'] . $bo_table; // sql_board.sql 파일의 테이블명을 변환 $source = array('/__TABLE_NAME__/', '/;/'); $target = array($create_table, ''); $sql = preg_replace($source, $target, $sql); sql_query($sql, FALSE); } else if ($w == 'u') { // 게시판의 글 수 $sql = " select count(*) as cnt from {$g4['write_prefix']}{$bo_table} where wr_is_comment = 0 "; $row = sql_fetch($sql); $bo_count_write = $row['cnt']; // 게시판의 코멘트 수 $sql = " select count(*) as cnt from {$g4['write_prefix']}{$bo_table} where wr_is_comment = 1 "; $row = sql_fetch($sql); $bo_count_comment = $row['cnt']; // 글수 조정 if ($proc_count) { // 원글을 얻습니다. $sql = " select wr_id from {$g4['write_prefix']}{$bo_table} where wr_is_comment = 0 "; $result = sql_query($sql); for ($i=0; $row=sql_fetch_array($result); $i++) { // 코멘트수를 얻습니다. $sql2 = " select count(*) as cnt from {$g4['write_prefix']}$bo_table where wr_parent = '{$row['wr_id']}' and wr_is_comment = 1 "; $row2 = sql_fetch($sql2); sql_query(" update {$g4['write_prefix']}{$bo_table} set wr_comment = '{$row2['cnt']}' where wr_id = '{$row['wr_id']}' "); } } // 공지사항에는 등록되어 있지만 실제 존재하지 않는 글 아이디는 삭제합니다. $bo_notice = ""; $lf = ""; if ($board['bo_notice']) { $tmp_array = explode("\n", $board['bo_notice']); for ($i=0; $i