테스트 사이트 - 개발 중인 베타 버전입니다

댓글 첨부파일 질문좀 드리겠습니다. 채택완료

11개월 전 조회 1,769

안녕하세요

위스킨 적용 전에는 댓글 갯수가 잘노출되었는데

댓글 갯수가 카운트 안되는데

 

이유를 알수있을까요?

부탁드립니다.

기존거파일을 따로 저장을 안해놔서요 ㅠㅠ

 

https://sir.kr/g5_skin/58690?sfl=wr_subject&stx=%EB%8C%93%EA%B8%80

 

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

답변 3개

채택된 답변
+20 포인트

댓글수 정상 적으로 호출을하고잇는데 안나오신다라는것인가요?

로그인 후 평가할 수 있습니다

답변에 대한 댓글 2개

지금 이렇게 해놨습니다.

<?php
$sql = "SELECT COUNT(*) AS comment_count FROM {$g5['write_prefix']}{$bo_table} WHERE wr_parent = '{$view['wr_id']}' AND wr_is_comment = 1";
$result = sql_query($sql);
$row = sql_fetch_array($result);
$comment_count = $row['comment_count'];
echo "댓글 수: " . $comment_count;
?>



<button type="button" class="cmt_btn"><span class="total"><b>영업활동</b> <?php echo $view['wr_comment']; ?></span><span class="cmt_more"></span></button>
<!-- 영업활동 시작 { -->
<section id="bo_vc">
<h2>영업활동목록</h2>
<?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'];
/*
if (strstr($list[$i]['wr_option'], "secret")) {
$str = $str;
}
*/
$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);
$cmt_sv = $cmt_amt - $i + 1; // 댓글 헤더 z-index 재설정 ie8 이하 사이드뷰 겹침 문제 해결
$c_reply_href = $comment_common_url.'&amp;c_id='.$comment_id.'&amp;w=c#bo_vc_w';
$c_edit_href = $comment_common_url.'&amp;c_id='.$comment_id.'&amp;w=cu#bo_vc_w';
$is_comment_reply_edit = ($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) ? 1 : 0;
?>
<button type="button" class="cmt_btn"><span class="total"><b>영업활동</b> <?php echo $view['wr_comment']; ?></span><span class="cmt_more"></span></button> 이렇게 해서안나오는것은 아마 해당요소가 display:none 처리되어잇을가능성이 큽니다. 하여

요소를 체크해보시던가 아니면
<button type="button" class="cmt_btn">
<span class="total">
<b>영업활동</b> <?php echo $view['wr_comment'] ? $view['wr_comment'] : 0; ?>
</span>
<span class="cmt_more"></span>
</button>이렇게 해보시던해보세요

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

파일이랑 댓글이랑 따로 저장하는거 같네요. 파일만 올리실때 카운트가 안되는거면 파일은 따로 테이블에 저장되서 댓글 카운트에 추가 안되는거 같네요.

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

노출되게끔 할수있는 방법은 없을까요 ㅠㅠ? 염치없지만 부탁좀 드려도 될까요 ㅠㅠ?

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

댓글 갯수를따로 카운트 하지않습니다. 할필요성이 없지않을까요? 만약 댓글갯수를 가져와야한다면 작성자체가 갯수이니 그수를 별도로 누적합을 구해서 출력을해야하겟지요 말그대로 작성된 수가  댓글수가 된다라는뜻이지요 하여 현재 그누보드는 댓글의 수를  정상 출력을하고있습니다.

로그인 후 평가할 수 있습니다

답변에 대한 댓글 7개

스킨에 관해서 말씀드리고있는겁니다..
네 스킨을 말씀드린겁니다. view.common.skin.php 파일상단에 보시면
<button type="button" class="cmt_btn"><span class="total"><b>댓글</b> <?php echo $view['wr_comment']; ?></span><span class="cmt_more"></span></button>


<?php echo $view['wr_comment']; ?> 출력을 하고잇을것입니다. 없으면 넣어주세요
<?php echo $view['wr_comment']; ?> 넵 들어가져있는뎁 카운트가 무조건 움직이지 않습니다 ㅠㅠ
<?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'];
/*
if (strstr($list[$i]['wr_option'], "secret")) {
$str = $str;
}
*/
$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);
$cmt_sv = $cmt_amt - $i + 1; // 댓글 헤더 z-index 재설정 ie8 이하 사이드뷰 겹침 문제 해결
$c_reply_href = $comment_common_url.'&amp;c_id='.$comment_id.'&amp;w=c#bo_vc_w';
$c_edit_href = $comment_common_url.'&amp;c_id='.$comment_id.'&amp;w=cu#bo_vc_w';
$is_comment_reply_edit = ($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) ? 1 : 0;
?>
목록상단에 정의되어잇는지 삭제되어잇는지확인해보시고 없으면 고대로넣어주세요
기존에 들어가있는데도 노출이 안됩니다 ㅠㅠ.

<button type="button" class="cmt_btn"><span class="total"><b>영업활동</b> <?php echo $view['wr_comment']; ?></span><span class="cmt_more"></span></button>
<!-- 영업활동 시작 { -->
<section id="bo_vc">
<h2>영업활동목록</h2>
<?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'];
/*
if (strstr($list[$i]['wr_option'], "secret")) {
$str = $str;
}
*/
$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);
$cmt_sv = $cmt_amt - $i + 1; // 댓글 헤더 z-index 재설정 ie8 이하 사이드뷰 겹침 문제 해결
$c_reply_href = $comment_common_url.'&amp;c_id='.$comment_id.'&amp;w=c#bo_vc_w';
$c_edit_href = $comment_common_url.'&amp;c_id='.$comment_id.'&amp;w=cu#bo_vc_w';
$is_comment_reply_edit = ($list[$i]['is_reply'] || $list[$i]['is_edit'] || $list[$i]['is_del']) ? 1 : 0;
?>
<article id="c_<?php echo $comment_id ?>" <?php if ($cmt_depth) { ?>style="margin-left:<?php echo $cmt_depth ?>px;border-top-color:#e0e0e0"<?php } ?>>


<div class="cm_wrap">

<header style="z-index:<?php echo $cmt_sv; ?>">
<h2><?php echo get_text($list[$i]['wr_name']); ?>님의 <?php if ($cmt_depth) { ?><span class="sound_only">영업활동의</span><?php } ?> 영업활동</h2>
<?php echo $list[$i]['name'] ?>

<span class="sound_only">작성일</span>
<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>
<br>
<?php
// 파일 출력
$file_comm = get_file($bo_table, $list[$i]['wr_id']);
?>
<?php if (!empty($file_comm[0]['file'])): ?>
<img src="../data/file/<?=$bo_table?>/<?=$file_comm[0]['file']?>" width="100" height="100" border="0" alt="">
<?php endif; ?>

<?php
include(G5_SNS_PATH.'/view_comment_list.sns.skin.php');
?>
</header>
만약 댓글수가 안나온다면 아래 부분을 직접 상단에 넣어서 업데이트 테스트해보세요
<?php
$sql = "SELECT COUNT(*) AS comment_count FROM {$g5['write_prefix']}{$bo_table} WHERE wr_parent = '{$view['wr_id']}' AND wr_is_comment = 1";
$result = sql_query($sql);
$row = sql_fetch_array($result);
$comment_count = $row['comment_count'];
echo "댓글 수: " . $comment_count;
?>
오이렇게 할시에는 갯수가 정확하게 노출됩니다.<?php echo $view['wr_comment']; ?> 여기에 노출되게끔 하는방법도 있을까요 ㅠㅠ? 정말 감사합니다 은인 이십니다 ㅠㅠ

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

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

로그인

전체 질문 목록

🐛 버그신고