<?php
if (!defined("_GNUBOARD_"))
    exit; // 개별 페이지 접근 불가
    /*
     * g4m Panels
     * http://getbootstrap.com/components/#panels
     */
$list_count = count($list);
?>     
<div class=" col-sm-6">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 style="padding: 0; margin: 0"><a href='<?php echo $g4['g4m_bbs_path'] ?>/board.php?bo_table=<?php echo $bo_table ?>'><?php echo $board['bo_subject'] ?></a></h3>
        </div>
        <div class="list-group">
            <?php for ($i = 0; $i < $list_count; $i++) { ?>
                    <?php
                    echo "<a href=\"{$list[$i]['href']}\" class='list-group-item'>";
                    echo '<h4 class="list-group-item-heading">';
                    echo $list[$i]['icon_reply'] . " ";     //답글
                    //공지
                    if ($list[$i]['is_notice']) {
                        echo "<span class=\"lt_notice\">{$list[$i]['subject']}</span>";
                    } else {
                        echo "{$list[$i]['subject']}";
                    }

                    //댓글수
                    if ($list[$i]['comment_cnt']) {
                        echo " <span class='list_comment'>{$list[$i]['comment_cnt']}</span>";
                    }

                    // if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
                    // if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }

                    if ($list[$i]['icon_new']) {
                        echo "<span class='icon-leaf'></i>";
                    }
                    if ($list[$i]['icon_file']) {
                        echo "<span class='icon-file'></i>";
                    }
                    if ($list[$i]['icon_link']) {
                        echo "<span class='icon-star'></i>";
                    }
                    if ($list[$i]['icon_hot']) {
                        echo "<span class='glyphicon glyphicon-fire'></i>";
                    }
                    if ($list[$i]['icon_secret']) {
                        echo "<span class='glyphicon glyphicon-lock'></i>";
                        $contents = '비밀글입니다.';
                    }else{
                        $contents = cut_str(strip_tags($list[$i]['wr_content']), 90);
                    }
                    echo '</h4>';
                    
                    echo "<p class='list-group-item-text'>{$contents}</p>";
                    echo "</a>";
                    ?>
            <?php } ?>

            <?php if ($list_count == 0) { ?><li class="list-group-item"><p style="padding: 48px; text-align: center">게시물이 없습니다.</p></li><?php } ?>
        </div>
    </div>
</div>