댓글이 달린게시물, 없는게시물
본문
A게시판 리스트에서 [댓글달린글보기]와 [댓글달리지않은글만보기] 버튼을 만들어서 댓글이 달린글만 보려면 어떻게해야하나요?
답변 1
<tbody>
<?php
for ($i=0; $i<count($list); $i++) {
if($list[$i]['comment_cnt']){
?>
<tr class="<?php if ($list[$i]['is_notice']) echo "bo_notice"; ?>">
<td class="td_num">
<?php
if ($list[$i]['is_notice']) // 공지사항
echo '<strong>공지</strong>';
else if ($wr_id == $list[$i]['wr_id'])
echo "<span class=\"bo_current\">열람중</span>";
else
echo $list[$i]['num'];
?>
</td>
<?php if ($is_checkbox) { ?>
<td class="td_chk">
<label for="chk_wr_id_<?php echo $i ?>" class="sound_only"><?php echo $list[$i]['subject'] ?></label>
<input type="checkbox" name="chk_wr_id[]" value="<?php echo $list[$i]['wr_id'] ?>" id="chk_wr_id_<?php echo $i ?>">
</td>
<?php } ?>
<td class="td_subject">
<?php
echo $list[$i]['icon_reply'];
if ($is_category && $list[$i]['ca_name']) {
?>
<a href="<?php echo $list[$i]['ca_name_href'] ?>" class="bo_cate_link"><?php echo $list[$i]['ca_name'] ?></a>
<?php } ?>
<a href="<?php echo $list[$i]['href'] ?>">
<?php echo $list[$i]['subject'] ?>
<?php if ($list[$i]['comment_cnt']) { ?><span class="sound_only">댓글</span><?php echo $list[$i]['comment_cnt']; ?><span class="sound_only">개</span><?php } ?>
</a>
<?php
// if ($list[$i]['link']['count']) { echo '['.$list[$i]['link']['count']}.']'; }
// if ($list[$i]['file']['count']) { echo '<'.$list[$i]['file']['count'].'>'; }
if (isset($list[$i]['icon_new'])) echo $list[$i]['icon_new'];
if (isset($list[$i]['icon_hot'])) echo $list[$i]['icon_hot'];
if (isset($list[$i]['icon_file'])) echo $list[$i]['icon_file'];
if (isset($list[$i]['icon_link'])) echo $list[$i]['icon_link'];
if (isset($list[$i]['icon_secret'])) echo $list[$i]['icon_secret'];
?>
</td>
<td class="td_name sv_use"><?php echo $list[$i]['name'] ?></td>
<td class="td_date"><?php echo $list[$i]['datetime2'] ?></td>
<td class="td_num"><?php echo $list[$i]['wr_hit'] ?></td>
<?php if ($is_good) { ?><td class="td_num"><?php echo $list[$i]['wr_good'] ?></td><?php } ?>
<?php if ($is_nogood) { ?><td class="td_num"><?php echo $list[$i]['wr_nogood'] ?></td><?php }
}?>
</tr>
<?php } ?>
<?php if (count($list) == 0) { echo '<tr><td colspan="'.$colspan.'" class="empty_table">게시물이 없습니다.</td></tr>'; } ?>
</tbody>