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

재질문 채택완료

초초동 9년 전 조회 3,874

어제도 질문을했는데 아직 못찾겠어서 다시 질문 드립니다.

이런식으로 하면 리스트 글에만 번호가 매겨지게 됩니다. 

리플을 숫자가 안뜨게해서 리플이 아닌 글에만 번호가 매겨지는데 


제가 원한는 기능은

이런 기능 입니다. 리플을 번호에서 제외하고 글에만 숫자가 매겨지게.....

 

아래는 소스코드 입니다.
 

 

 

// 공지, 현재글 스타일 체크

$tr_css = $subject_css = '';

if ($wr_id == $list[$i]['wr_id']) {

$tr_css = ' class="list-now"';

$subject_css = ' now';

$num = '열람중';

} else if ($list[$i]['is_notice']) { // 공지사항

$tr_css = ' class="active"';

$subject_css = ' notice';

$num = '';

$list[$i]['ca_name'] = '공지';

} else if ($list[$i]['icon_reply']) {

$num = '';

} else {

$num = ''.$list[$i]['num'].'';

 

}

?>

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

답변 3개

채택된 답변
+20 포인트
9년 전

http://blog.naver.com/mmmsolzer/220712135747">http://blog.naver.com/mmmsolzer/220712135747

참고하세요.

위와같은 방식으로 코딩가능합니다 

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

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

그림자밟기

원본 소스를 수정해야 합니다. 스킨 수정으로는 좀 많이 지저분 해집니다.

 

1. /bbs/write_update.php 에서 답변글의 경우 카운트를 업데이트하지 않습니다.

 

</p><p>    // 게시글 1 증가</p><p>    sql_query("update {$g5['board_table']} set bo_count_write = bo_count_write + 1 where bo_table = '{$bo_table}'");</p><p>

=>
</span>
</div><div><span style="font-size: 14.6667px;">if($bo_table != "해당게시판ID" && $w != 'r') {</span></div><div><div>    // 게시글 1 증가</div><div>    sql_query("update {$g5['board_table']} set bo_count_write = bo_count_write + 1 where bo_table = '{$bo_table}'");</div></div><div>}</div><div><span style="font-size: 14.6667px;">
2. list.php
192줄 부근
</div><div>        $list[$i]['num'] = $list_num - $k;
</div><div>
=>
</div><div style="font-size: 14.6667px;"><span style="font-size: 14.6667px;">       </span><span style="font-size: 14.6667px;"> </span><span style="font-size: 14.6667px;">if($bo_table == "게시판ID" && $list[$i]['wr_reply']) {</span></div><div style="font-size: 14.6667px; margin-left: 40px;"><span style="font-size: 14.6667px;">       $list[$i]['num'] = '';</span><span style="font-size: 14.6667px;">
</span></div><div style="font-size: 14.6667px; margin-left: 80px;"><span style="font-size: 14.6667px;">$k++;</span>
</div><div style="font-size: 14.6667px; margin-left: 40px;"><span style="font-size: 14.6667px;"> } else {</span></div><div style="font-size: 14.6667px; margin-left: 40px;"><span style="font-size: 14.6667px;">       $list[$i]['num'] = $list_num - $k;</span></div><div style="font-size: 14.6667px; margin-left: 40px;"><span style="font-size: 14.6667px;"> }</span></div><div style="font-size: 14.6667px; margin-left: 0px;"><span style="font-size: 14.6667px;">
테스트는 안해봤습니다만, 대략 이렇게 하면 될 듯 하네요.
로그인 후 평가할 수 있습니다

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

플라이
9년 전

한마디로 지금 전체 카운팅을 하기 보다는 리플은 별도로 불러들이는 방식으로 해서 게시물은 카운트를 적용해 주는 방식으로 변경이 필요합니다.

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

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

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

로그인