From 8235f324fc95bcf29180b5cfce80ad545a903d3d Mon Sep 17 00:00:00 2001 From: gnuboard Date: Fri, 8 Mar 2013 10:49:28 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B6=94=EA=B0=80=EB=90=9C=20=ED=95=84?= =?UTF-8?q?=EB=93=9C=20=EB=B0=98=EC=98=81=EA=B3=BC=20=EA=B8=80=EC=88=98=20?= =?UTF-8?q?=EC=A1=B0=EC=A0=95=EC=9D=84=20=EC=97=94=ED=94=BC=EC=94=A8?= =?UTF-8?q?=EB=8B=98=EC=9D=98=20=ED=8C=81=EC=9C=BC=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/board_form_update.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/adm/board_form_update.php b/adm/board_form_update.php index f5ac45e21..0d2e5cf81 100644 --- a/adm/board_form_update.php +++ b/adm/board_form_update.php @@ -173,16 +173,23 @@ if ($w == '') { $bo_count_comment = $row['cnt']; // 글수 조정 + /* + 엔피씨님의 팁으로 교체합니다. 130308 + http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=27207 + */ if (isset($_POST['proc_count'])) { // 원글을 얻습니다. - $sql = " select wr_id from {$g4['write_prefix']}{$bo_table} where wr_is_comment = 0 "; + //$sql = " select wr_id from {$g4['write_prefix']}{$bo_table} where wr_is_comment = 0 "; + $sql = " select a.wr_id, (count(b.wr_parent) - 1) as cnt from {$g4['write_prefix']}{$bo_table} a, {$g4['write_prefix']}{$bo_table} b where a.wr_id=b.wr_parent and a.wr_is_comment=0 group by a.wr_id "; $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']}' "); + sql_query(" update {$g4['write_prefix']}{$bo_table} set wr_comment = '{$row['cnt']}' where wr_id = '{$row['wr_id']}' "); } }