라공에디션

기본 게시판 스킨 비밀글 답글의 열람 권한에 원댓글 작성자를 추가

<span class="sv_member">니루</span>
니루 @tabom0w0
2026-10-11 12:57

비밀 댓글 작성 시, 해당 댓글에 답변을 비밀글로 작성하면 비밀 댓글 작성자는 답변을 읽을 수 없던 부분을 수정

+ 비회원 비밀댓글 작성 시 본인 글의 댓글내용 확인 눌러 비번 입력하면 본인 댓글에 달린 비밀 대댓글 내용 볼 수 있음


view.comment.skin.php 에서 해당 부분을 찾아서

<?php
    $cmt_amt = count($list);
    for ($i=0; $i<$cmt_amt; $i++) {
        $comment_id = $list[$i]['wr_id'];
        $cmt_depth = strlen($list[$i]['wr_comment_reply']) * 50;
        $comment = $list[$i]['content'];


비밀글 답글의 열람 권한에 원댓글 작성자를 추가할 수 있도록 아래 코드로 변경한다

<?php
    $cmt_amt = count($list);
    $comment_owner_by_thread = array();
    for ($i=0; $i<$cmt_amt; $i++) {
        $comment_id = $list[$i]['wr_id'];
        $cmt_depth = strlen($list[$i]['wr_comment_reply']) * 50;
        $comment = $list[$i]['content'];
        if (empty($list[$i]['wr_comment_reply'])) {
            $comment_owner_by_thread[$list[$i]['wr_comment']] = array(
                'wr_id' => $comment_id,
                'mb_id' => $list[$i]['mb_id']
            );
        } elseif (
            strpos($list[$i]['wr_option'], 'secret') !== false &&
            isset($comment_owner_by_thread[$list[$i]['wr_comment']]) &&
            (
                (!empty($member['mb_id']) && $member['mb_id'] === $comment_owner_by_thread[$list[$i]['wr_comment']]['mb_id']) ||
                get_session('ss_secret_comment_'.$bo_table.'_'.$comment_owner_by_thread[$list[$i]['wr_comment']]['wr_id'])
            )
        ) {
            $comment = conv_content($list[$i]['wr_content'], 0, 'wr_content');
            $comment = search_font($stx, $comment);
        }


댓글목록