쟈

list에 출력되는 코멘트를 수정하려면, 또 댓댓글을 달게 하려면 어떻게 해야 하나요

원글 수정은..

<a href="./write.php?w=u&bo_table=<?=$bo_table?>&wr_id=<?=$list[$i][wr_id]?>&page=<?=$page?>" class="write">+</a>

이 링크로 해결하고 있는데요

코멘트 수정은 도대체 어떻게 해야 할지 모르겠습니다...


스킨을 보니까 view_comment.skin.php에 다음과 같은 자바스크립트와 관련 부분이 있던데
막상 list.skin.php에서는 그걸 이용하는 것 같지도 않고...
코드를 복사하면 되나 싶었는데 list.skin.php에 붙여넣어도 안 되더라고요.


그리고 댓댓글을 달게 하려면 어떤 코드를 넣어야 하는지도 알고 싶습니다.


아시는 분 답변 부탁드립니다. 감사합니다.




<? if ($list[$i][is_reply]) { echo "<a href=\"javascript:comment_box('{$comment_id}', 'c');\" style=\"font-size:10px;\">R</a> "; } ?>
<? if ($list[$i][is_edit]) { echo "<a href=\"javascript:comment_box('{$comment_id}', 'cu');\" style=\"font-size:10px;\">M</a> "; } ?>
<? if ($list[$i][is_del]) { echo "<a href=\"javascript:comment_delete('{$list[$i][del_link]}');\" style=\"font-size:10px;\">D</a> "; } ?>





function comment_box(comment_id, work)
{
var el_id;
// 코멘트 아이디가 넘어오면 답변, 수정
if (comment_id)
{
if (work == 'c')
el_id = 'reply_' + comment_id;
else
el_id = 'edit_' + comment_id;
}
else
el_id = 'comment_write';

if (save_before != el_id)
{
if (save_before)
{
document.getElementById(save_before).style.display = 'none';
document.getElementById(save_before).innerHTML = '';
}

document.getElementById(el_id).style.display = '';
document.getElementById(el_id).innerHTML = save_html;
// 코멘트 수정
if (work == 'cu')
{
document.getElementById('wr_content').value = document.getElementById('save_comment_' + comment_id).value;
if (typeof char_count != 'undefined')
check_byte('wr_content', 'char_count');
if (document.getElementById('secret_comment_'+comment_id).value)
document.getElementById('wr_secret').checked = true;
else
document.getElementById('wr_secret').checked = false;
}

document.getElementById('comment_id').value = comment_id;
document.getElementById('w').value = work;

save_before = el_id;
}

if (typeof(wrestInitialized) != 'undefined')
wrestInitialized();

if (comment_id && work == 'c')
$.kcaptcha_run();
}

function comment_delete(url)
{
if (confirm("Are you sure to delete the comment?")) location.href = url;
}

comment_box('', 'c'); // 코멘트 입력폼이 보이도록 처리하기위해서 추가 (root님)

댓글 1개

질문 아래쪽 코멘트관련 코드는 뷰페이지에서 쓰는 것이지 리스트페이지에서 쓰는 것이 아니니 저걸 사용할 수는 없습니다
리스트에서 코멘트 수정 기능을 만드는 것이 간단하지는 않을 것 같군요
코멘트 수정 폼이 나오게 스킨을 하나 만들고 링크를 이 스킨을 호출하도록 만들고
수정 후 리스트로 이동하도록 수정 등등..
댓글을 작성하시려면 로그인이 필요합니다.

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
13-04-30 조회 921
13-04-30 조회 1,110
13-04-30 조회 2,323
13-04-30 조회 809
13-04-30 조회 1,000
13-04-30 조회 1,637
13-04-30 조회 942
13-04-30 조회 1,678
13-04-30 조회 971
13-04-30 조회 885
13-04-30 조회 1,090
13-04-30 조회 928
13-04-30 조회 876
13-04-30 조회 3,163
13-04-30 조회 1,155
13-04-30 조회 1,754
13-04-30 조회 892
13-04-30 조회 872
13-04-30 조회 2,328
13-04-30 조회 752