채택완료

댓글 수정으로 질문드립니다.

2017-08-20 (일) 22:48:09 3,136

안녕하세요. 댓글이 여러개 있다고 가정하고 설명을 드리면

일반적으로 댓글의 댓글을 누르면 댓글의 바로 아래에 댓글입력란이 생성이 되죠.

댓글의 댓글은 잘 됩니다.

근데 바로 옆에 수정을 누르면 댓글입력란이 생겻다가 페이지가 새로고침 되 버립니다.

제가 보기엔 아래 소스 어딘가가 문제인거같은데 그누보드 원본하고 비교해보면 분명 다른점이

있긴합니다. if문 구문만 추려내면 아래와 같습니다.

$query_string = str_replace("&", "&", $_SERVER['QUERY_STRING']); 

요 부분을 원본대로 바꾸면 되긴 되는데 한 3번 클릭해야지 되더군요. 저 cu라는게 문제인거같은데

어떻게 해야 될까요?

제가 쓰는 스킨

Copy
<?php if($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) {				$query_string = str_replace("&", "&amp;", $_SERVER['QUERY_STRING']);				if($w == 'cu') {					$sql = " select wr_id, wr_content from $write_table where wr_id = '$c_id' and wr_is_comment = '1' ";					$cmt = sql_fetch($sql);					$c_wr_content = $cmt['wr_content'];				}				$c_reply_href = './board.php?'.$query_string.'&amp;c_id='.$comment_id.'&amp;w=c#bo_vc_w';				$c_edit_href = './board.php?'.$query_string.'&amp;c_id='.$comment_id.'&amp;w=cu#bo_vc_w';			 ?>

그누보드5 원본스킨

Copy
<?php if($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) {            $query_string = clean_query_string($_SERVER['QUERY_STRING']);            if($w == 'cu') {                $sql = " select wr_id, wr_content, mb_id from $write_table where wr_id = '$c_id' and wr_is_comment = '1' ";                $cmt = sql_fetch($sql);                if (!($is_admin || ($member['mb_id'] == $cmt['mb_id'] && $cmt['mb_id'])))                    $cmt['wr_content'] = '';                $c_wr_content = $cmt['wr_content'];            }            $c_reply_href = './board.php?'.$query_string.'&amp;c_id='.$comment_id.'&amp;w=c#bo_vc_w';            $c_edit_href = './board.php?'.$query_string.'&amp;c_id='.$comment_id.'&amp;w=cu#bo_vc_w';         ?>
|

답변 3개 / 댓글 3개

채택된 답변
+20 포인트

$query_string = clean_query_string($_SERVER['QUERY_STRING']); 

위에서 clean_query_string() 이 함수가 무엇을 하는지에 대해 알아야할듯 싶네요.

단순히 문자 치환을 하는 것이 아니라 어떤 값을 받아오는 겁니다.

아마 게시판이름을 받아오는 부분인듯 싶구요.

llb 폴더안에 common.lib.php 이 파일에서 위에 함수를 검색을 하면 이해 하실겁니다.

답변에 대한 댓글 1개

2017-08-21 (월) 00:13:29
돼지코쿠뇽님 댓글에 올려논 소스가 문제였네요. 원본디자인을 바꿔서 써야될듯하네요.

새로 고침 되는 함수를 찾아봐야게지요

답변에 대한 댓글 1개

2017-08-21 (월) 00:13:36
돼지코쿠뇽님 댓글에 올려논 소스가 문제였네요. 원본디자인을 바꿔서 써야될듯하네요.
2017-08-20 (일) 23:33:13

그누5 원본 코드로 바꾸시면?..

답변에 대한 댓글 1개

2017-08-21 (월) 00:12:35
이부분이 문제였네요. 이걸 원본으로 바꾸면 잘되긴하는데 아 어떻게 바꿔야 될지 막막하네요.

[code]
<aside id="bo_vc_w" class="cmt_wrap">
<form name="fviewcomment" action="./write_comment_update.php" onsubmit="return fviewcomment_submit(this);" method="post" autocomplete="off">
<input type="hidden" name="w" value="<?php echo $w ?>" id="w">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="wr_id" value="<?php echo $wr_id ?>">
<input type="hidden" name="comment_id" value="<?php echo $c_id ?>" id="comment_id">
<input type="hidden" name="sca" value="<?php echo $sca ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<?php echo $stx ?>">
<input type="hidden" name="spt" value="<?php echo $spt ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<input type="hidden" name="is_good" value="">


<div class="cmt_bot">
<label class="txt"><textarea id="wr_content" name="wr_content" maxlength="10000" required class="required" title="내용" onfocus="$('.tbl_wrap').removeClass('dno');"
<?php if ($comment_min || $comment_max) { ?>onkeyup="check_byte('wr_content', 'char_count');"<?php } ?>><?php echo $c_wr_content; ?></textarea></label>
<?php if ($comment_min || $comment_max) { ?><script> check_byte('wr_content', 'char_count'); </script><?php } ?>

<div class="tbl_wrap dno">
<?php if ($is_guest) { ?>
<div class="row">
<input type="text" name="wr_name" value="<?php echo get_cookie("ck_sns_name"); ?>" id="wr_name" required class="frm_input required" size="5" maxLength="20">
<label for="wr_name">이름</label>
</div>
<div class="row">
<input type="password" name="wr_password" id="wr_password" required class="frm_input required" size="10" maxLength="20">
<label for="wr_password">비밀번호</label>
</div>
<div class="row">
<?php echo $captcha_html; ?>
</div>
<?php } ?>
<?php if (strstr($list[$i]['wr_option'], "secret")) { ?>
<div class="row">
<input type="checkbox" name="wr_secret" value="secret" id="wr_secret">
<label for="wr_secret">비밀글</label>
</div>
<?php } ?>
</div>

<div class="cmt_sub">
<button type="submit" id="btn_submit" class="btn_bsub"><span class="glyphicon glyphicon-ok"></span> 댓글등록</button>
<a id="btn_cancle" class="btn_bsub cancle csr" onclick="comment_box(0, 'c'); return false;">취소</a>
</div>
</div>
</form>
</aside>
[/code]

답변을 작성하려면 로그인이 필요합니다.