그러나 필자의 경우 관리자의 댓글은 카운트에서 제외하는 것을 좋아하기때문에 이 글을 쓰게되었다. 일단 이 패치를 적용하기전에 필자의 이전 글, 태터 패치: 태터의 댓글 카운트 일치 시키기을 이용해서 일단 기존의 댓글 카운트에서 관리자의 댓글 수를 제거하는 것이 좋다. 패치는 상당히 간단하다.
inc_function.php
변경전:
331: function set_rp_cnt($num) {
332: global $db, $dbid;
333:
334: $sql = "select count(*) from t3_".$dbid."_reply where pno = $num";
335: list ($cnt) = mysql_fetch_array(mysql_query($sql));
336: put_query("update t3_".$dbid." set rp_cnt = $cnt where no = $num");
337: }
변경후:
331: function set_rp_cnt($num) {
332: global $db, $dbid;
333: $sql = "select user_nick from t3_".$dbid."_setting";
334: $result = @mysql_query($sql);
335: list($user_nick) = mysql_fetch_row($result);
336:
337: $sql = "select count(*) from t3_".$dbid."_reply where pno =
$num and name != '$user_nick'";
338: list ($cnt) = mysql_fetch_array(mysql_query($sql));
339: put_query("update t3_".$dbid." set rp_cnt = $cnt where no = $num");
340: }
위에서 알 수 있듯이 333행(변경전)에 333행~336행(변경후)을 추가하고 337행(변경전)의 끝부분에 and name != '$user_nick만 추가하면 다음부터는 관리자가 작성한 글은 카운트에 포함되지 않는다주1.
주1: 태터의 환경 설정에서 입력한 관리자의 이름과 댓글을 작성할 때의 이름이 같은 경우에만 카운트에서 제외된다.