비밀 코멘트 리플보기 > 그누4 팁자료실

그누4 팁자료실

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요.
나누면 즐거움이 커집니다.

비밀 코멘트 리플보기 정보

비밀 코멘트 리플보기

본문

비밀 코멘트를 등록하면 원글 작성자만 그 코멘트 내용을 확인할 수 있습니다.
그래서 코멘트에 비밀 리플을 작성하면 코멘트 작성자가 확인이 불가능하기 때문에 문제가 발생합니다.

view_comment.skin.php 파일의 for 문 안에 아래 코드를 넣으면 비밀 코멘트 리플을 확인할 수 있습니다.

// 코멘트 비밀 리플 보이기
if ($list[$i][content] == "비밀글 입니다.") {
    $sql = "select mb_id from {$write_table}
             where wr_is_comment = 1
               and wr_parent = '{$list[$i][wr_parent]}'
               and wr_comment = '{$list[$i][wr_comment]}'
               and wr_comment_reply = left('{$list[$i][wr_comment]}', length('{$list[$i][wr_comment]}')-1)";
    $row = sql_fetch($sql);
    if ($row[mb_id] == $member[mb_id]) {
        $list[$i][content] = conv_content($list[$i][wr_content], 0, 'wr_content');
        $list[$i][content] = search_font($stx, $list[$i][content]);
    }
}

디비쿼리가 부담스러우시면 아래 코드를 적용해보세요.

if ($list[$i][content] == "비밀글 입니다.") {
    for ($j=$i-1; $j>=0; $j--) {
        if ($list[$j][wr_comment] == $list[$i][wr_comment] && $list[$j][wr_comment_reply] == substr($list[$i][wr_comment_reply], 0, strlen($list[$i][wr_comment_reply])-1)) {
            if ($list[$j][mb_id] == $member[mb_id]) {
                $list[$i][content] = conv_content($list[$i][wr_content], $html, 'wr_content');
                $list[$i][content] = search_font($stx, $list[$i][content]);
            }
            break;
        }
    }
}

코드를 적용하면 원글 작성자와 원 코멘트 작성자가 비밀 코멘트를 확인할 수 있게됩니다.

나름 테스트를 하였지만.. 혹시 모르니  적용해보시고 피드백 부탁드립니다.


[출처] 포털 마이위트 -
http://g4.miwit.com/bbs/board.php?bo_table=g4_tiptech&wr_id=49

추천
2

댓글 12개

곱슬님, 쪽지가 안가서 여기다 드릴 말씀을 ^^
배추게시판 1.0.0을 사용하다 얼마전 1로 바꿨는데...
이모티콘 문제가 발생합니다. 즉 이모티콘의 경로가 저장이 되는데..
새로운 버젼은 디렉토리명 자체가 변경이 되어서 이전의 이모티콘 경로가 무용지물이 되더라구요.
잘 아시리라 생각하며,,, 그런 부분을 위해서라도 일관성을 가지는 구조가 필요할 것 같네요 ^^
항상 수고하세요~
수정하셔야 하는거 ...
(1) if 문에서 = 를 ==로
        if ($list[$j][wr_comment] == $list[$i][wr_comment] && $list[$j][wr_comment_reply] == substr($list[$i][wr_comment_reply], 0, strlen($list[$i][wr_comment_reply])-1)) {
전체 44 |RSS
그누4 팁자료실 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT