자료실

tatter 0.96 댓글 관련 패치 모음

유노씨 2005. 10. 12. 23:06
이번 0.96 tatter에서 댓글에 댓글 달기가 추가되었으나..
찾아보니 이와 관련된 패치가 있기에 적용시켜보았다.

1.댓글 카운트에서 관리자 댓글 제외하기- by 도아님
포스트의 댓글에서 관리자의 댓글은 제외한 카운트가 맞다고 들었는데, 저또한 그렇게 생각되기에 적용하였습니다.
inc_presswork.php파일 수정

변경전: 119: $sql = "select no, pno, name, body, regdate, is_secret from t3_".$dbid."_reply order by no desc limit 0, $p_rct_rp_cnt";

변경후: 119: $sql = "select user_nick from t3_".$dbid."_setting"; 120: $result = @mysql_query($sql); 121: list($user_nick) = mysql_fetch_row($result); 122: 123: $sql = "select no, pno, name, body, regdate, is_secret from t3_".$dbid."_reply where name != '$user_nick' order by no desc limit 0, $p_rct_rp_cnt";

즉 119~122행을 추가하고 123행에 where name != '$user_nick'를 추가하면 된다.


2.최근 댓글에 대한 답글 이미지로 표시하기-by 한스님
어느새 답글들을 달다보면 최근 목록에는 제글만 표시가 됩니다.
그래서 이를 적용, 댓글에 답글이 달리면 이미지로 표시됩니다.

1. inc_presswork.php 파일을 열고 나서 다음 부분을 찾는다.
$p_rep = str_replace("[ ##_rctrp_rep_desc_##]", str_cut($body, $p_rct_rp_trunc, 1), $p_rep);

2. 그 바로 위에 다음 내용을 추가한다.

$rp_tmp = mysql_fetch_array(mysql_query("select * from t3_".$dbid."_reply where rno=" .$no));
if($rp_tmp[no]) $p_rep = str_replace("[ ##_rctrp_rep_desc_##]", str_cut($body, $p_rct_rp_trunc, 1) . " < img src=images/reply.gif>", $p_rep);
else





3.최근에 달린 댓글에서 관리자 댓글 제거하기-by 도아님
이제 제가 답글을 달면 이미지가 표시됩니다. 하지만 여전히
최근 목록에는 제글들이 뜨게됩니다. 그리아여 최근댓글에서 관리자글을 제거합니다.
inc_presswork.php 파일 수정

변경전: 119: $sql = "select no, pno, name, body, regdate, is_secret from t3_".$dbid."_reply order by no desc limit 0, $p_rct_rp_cnt";

변경후: 119: $sql = "select user_nick from t3_".$dbid."_setting"; 120: $result = @mysql_query($sql); 121: list($user_nick) = mysql_fetch_row($result); 122: 123: $sql = "select no, pno, name, body, regdate, is_secret from t3_".$dbid."_reply where name != '$user_nick' order by no desc limit 0, $p_rct_rp_cnt";

즉 119~122행을 추가하고 123행에 where name != '$user_nick'를 추가하면 됩니다.


4.관리자만 댓글에 댓글을 달 수 있도록 패치하기 - by 도아님
다른분이 댓글에 댓글을 달았을 경우가 있더군요. 아니면 댓글에 댓글이 계속 달릴 경우도 있을듯 해서 아예 관리자만 댓글에 댓글을 달수 있게 수정하였습니다.;;

inc_function.php파일 수정

변경전
$bf2_rep = str_replace("[ ##_rp_rep_onclick_reply_##]", "onclick_reply('rp', '$num', '$no'); return false;", $bf2_rep);

변경후
if($is_admin) $bf2_rep = str_replace("[ ##_rp_rep_onclick_reply_##]", "onclick_reply('rp', '$num', '$no'); return false;", $bf2_rep); 460: else $bf2_rep = str_replace("[ ##_rp_rep_onclick_reply_##]", "alert('관리자만 댓글을 달 수 있습니다'); return false;", $bf2_rep);