댓글수정이 새로운 댓글로 입력됩니다. 채택완료
댓글을 수정하면 새로운 댓글로 입력됩니다.
/bbs/write_comment_update.php는 손도 안댔고, view_comment.skin.php에 블라인드 댓글 처리부분만 만들어 넣었습니다.
제가 수정한 부분은 9-17, 27, 47-51줄 입니다.
고수님들 도움을 부탁드립니다.
</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"><section id="bo_vc"></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <h2>댓글목록</h2></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <?php</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> $cmt_amt = count($list);</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> for ($i=0; $i<$cmt_amt; $i++) {</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> $comment_id = $list[$i]['wr_id'];</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> $cmt_depth = ""; // 댓글단계</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> $cmt_depth = strlen($list[$i]['wr_comment_reply']) * 20;</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> $cond_vc = $blind_msg = '';</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> if ($list[$i]['wr_blind']=='blind') {</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> $list[$i]['is_reply'] = $list[$i]['is_edit'] = '';</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> $cond_vc = ' class="blind_vc" ';</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> if (!$is_admin) {</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> $list[$i]['is_del'] = '';</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> $blind_msg = '블라인드 처리된 댓글입니다.';</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> }</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> }</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> $comment = $list[$i]['content'];</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> /*</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> if (strstr($list[$i]['wr_option'], "secret")) {</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> $str = $str;</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> }</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> */</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> $comment = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp|mms)\:\/\/([^[:space:]]+)\.(mp3|wma|wmv|asf|asx|mpg|mpeg)\".*\<\/a\>\]/i", "<script>doc_write(obj_movie('$1://$2.$3'));</script>", $comment);</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> $cmt_sv = $cmt_amt - $i + 1; // 댓글 헤더 z-index 재설정 ie8 이하 사이드뷰 겹침 문제 해결</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> ?></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <article id="c_<?php echo $comment_id ?>" <?php echo $cond_vc; if ($cmt_depth) { ?>style="margin-left:<?php echo $cmt_depth ?>px;border-top-color:#e0e0e0"<?php } ?>></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <header style="z-index:<?php echo $cmt_sv; ?>"></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <h1><?php echo get_text($list[$i]['wr_name']); ?>님의 댓글</h1></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <?php echo $list[$i]['name'] ?></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <?php if ($cmt_depth) { ?><img src="<?php echo $board_skin_url ?>/img/icon_reply.gif" class="icon_reply" alt="댓글의 댓글"><?php } ?></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <?php if ($is_ip_view) { ?></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> 아이피</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <span class="bo_vc_hdinfo"><?php echo $list[$i]['ip']; ?></span></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <?php } ?></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> 작성일</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <span class="bo_vc_hdinfo"><time datetime="<?php echo date('Y-m-d\TH:i:s+09:00', strtotime($list[$i]['datetime'])) ?>"><?php echo $list[$i]['datetime'] ?></time></span></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <?php</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> include(G5_SNS_PATH.'/view_comment_list.sns.skin.php');</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> ?></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> </header></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> </span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <!-- 댓글 출력 --></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <p></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <?php if (strstr($list[$i]['wr_option'], "secret")) { ?><img src="<?php echo $board_skin_url; ?>/img/icon_secret.gif" alt="비밀글"><?php } ?></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <?php </span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> if ($blind_msg)</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> echo $blind_msg;</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> else </span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> echo $comment;</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> ?></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> </p></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> </span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <span id="edit_<?php echo $comment_id ?>"></span><!-- 수정 --></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <span id="reply_<?php echo $comment_id ?>"></span><!-- 답변 --></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> </span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <input type="hidden" value="<?php echo strstr($list[$i]['wr_option'],"secret") ?>" id="secret_comment_<?php echo $comment_id ?>"></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <textarea id="save_comment_<?php echo $comment_id ?>" style="display:none"><?php echo get_text($list[$i]['content1'], 0) ?></textarea></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> </span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <?php if($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) {</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> $query_string = str_replace("&", "&", $_SERVER['QUERY_STRING']);</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> </span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> if($w == 'cu') {</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> $sql = " select wr_id, wr_content from $write_table where wr_id = '$c_id' and wr_is_comment = '1' ";</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> $cmt = sql_fetch($sql);</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> $c_wr_content = $cmt['wr_content'];</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> }</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> </span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> $c_reply_href = './board.php?'.$query_string.'&c_id='.$comment_id.'&w=c#bo_vc_w';</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> $c_edit_href = './board.php?'.$query_string.'&c_id='.$comment_id.'&w=cu#bo_vc_w';</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> ?></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <footer></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <ul class="bo_vc_act"></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <?php if ($list[$i]['is_reply']) { ?><li><a href="<?php echo $c_reply_href; ?>" onclick="comment_box('<?php echo $comment_id ?>', 'c'); return false;">답변</a></li><?php } ?></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <?php if ($list[$i]['is_edit']) { ?><li><a href="<?php echo $c_edit_href; ?>" onclick="comment_box('<?php echo $comment_id ?>', 'cu'); return false;">수정</a></li><?php } ?></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <?php if ($list[$i]['is_del']) { ?><li><a href="<?php echo $list[$i]['del_link']; ?>" onclick="return comment_delete();">삭제</a></li><?php } ?></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> </ul></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> </footer></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <?php } ?></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> </article></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <?php } ?></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <?php if ($i == 0) { //댓글이 없다면 ?></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <p id="bo_vc_empty">등록된 댓글이 없습니다.</p></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> <?php } ?></span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> </span></p><p> </p><p><span style="font-size: 14.6667px; line-height: 22px;"></section></span></p><p><span style="font-size: 14.6667px; line-height: 1.5;">
답변 3개
스킨 자체 문제입니다...
댓글쓸때 비밀글 기능이 빠져있을경우 생기는 현상입니다.
댓글 적는부분에서 원본 스킨 보고 비밀댓글 기능 추가 해보신후 다시 해보세요.
답변에 대한 댓글 4개
분명 답변에 따라 비밀글 처리를 변경하고는 댓글수정이 정상적으로 이뤄지는 걸 확인했는데, 어느순간 확인해 보니 이번에는 답변댓글 입력이 되네요.
혹시 이런 현상에 대해서는 아시는 바가 있으신지, 도움 부탁드립니다.
댓글 입력에 write_comment_update.head.skin.php을 만들었는데, 이걸 비활성화 하니까 해결되네요.
해당 파일안에서 어떤 코드가 문제를 일으키는지 찾아봐야겠네요.
채택도 없는 질문에 답변 주셔서 정말 감사합니다.
댓글을 작성하려면 로그인이 필요합니다.
제 경우에는 특정 input값을 주석처리해서 그런 현상이 나타나네요.
view_comment.skin.php 에서는 주석처리가 아닌 숨김처리(display:none)로 해야 할 것 같습니다.
댓글을 작성하려면 로그인이 필요합니다.
저도 같은 경험으로 고생좀 했는데 저의 경우는...
view_comment.skin.php 파일 중간쯤
...
<input type="hidden" name="w" value="<?php echo $w ?>" id="w">
... 이 값이 수정버튼을 클릭하면 아래 스크립트에서 'cu'로 변경 시켜 줍니다
<script>
function comment_box(comment_id, work) {
...
document.getElementById('w').value = work;
...
}
</script>
그런데 문제는 이 값이 변경이 안되는 겁니다.
원인은 include한 파일중에서 "w"란 id로 또 다른 오브젝트가 존재했기 때문이었지요
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인