비회원 또는 신고 댓글 블라인드 애드온을 만들고 있는데요
다음과 같이 코드를 구현했습니다
$oDocumentModel = getModel('document'); $document_srl = Context::get('document_srl'); $oDocument = $oDocumentModel->getDocument($document_srl); $comment_list = $oDocument->getComments(); if($comment_list) { foreach($comment_list as $key => $comment) { $comment->add('content', '블라인드된 댓글입니다'); } }
그런데 아무리 해도 댓글 내용이 안바뀌길래 알아보니
$oDocument->getComments() 로 $comment_list 를 받아올 경우
내용이 바뀌지 않는다고 하는데 댓글 내용을 바꿀 방법이 없을까요?
어렵네요...
foreach에 '회원인 경우'와 '해당 댓글이 신고 받지 않은 경우'로 조건 걸어서 댓글을 뿌려주면 되지 않을까요?
'비회원인 경우' 또는 '신고된 댓글인 경우'는 출력하시려는 메시지를 내보내시면 될 거구요.