<?php
if (!defined("_GNUBOARD_"))
    exit; // 개별 페이지 접근 불가
/*
 * g4m gallery skin
 */

$list_count = count($list);
?>
<div class="g4latest_gallery col-sm-6">
    <div class="well well-sm">
        <h2 style="padding:0; margin: 5px;"><a href='<?php echo $g4['g4m_bbs_path'] ?>/board.php?bo_table=<?php echo $bo_table ?>'><?php echo $board['bo_subject'] ?></a></h2>
        <table class="table">
            <tr>
            <?php
            for ($i = 0; $i < $list_count; $i++) {
                //댓글수
                $cmt_count = '';
                if ($list[$i]['comment_cnt']) {
                    $cmt_count = " <span class='lt_cmt'>{$list[$i]['comment_cnt']}</span>";
                }
                if($list[$i]['file']['0']['file'] && $list[$i]['file']['0']['image_type'] < 3){
                    $img = get_thumb($board['bo_table'],$list[$i]['file']['0']['file'], 'list', 160, 120);
                }else{
                    $img = "<img src='{$latest_skin_path}/img/noimage.gif' width='100%' alt='no img'/>";
                }
                $td = round(100 / 3 , 1);
            ?>
                <td style='width:<?php echo $td?>%'>
                    <a href='<?php echo $list[$i]['href'] ?>' class="thumbnail">
                        <?php echo $img?>
                        <p class="subject"><?php echo cut_str($list[$i]['subject'], '21') ?> <?php echo $cmt_count ?></p>
                    </a>
                </td>
            <?php
                if (($i + 1) % 3 == 0) {
                    echo "</tr><tr>";
                }
            } ?>
            </tr>
        </table>
        <?php if ($list_count == 0) { ?><p style="padding: 48px; text-align: center">게시물이 없습니다.</p><?php } ?>
    </div>
</div>