<?php
if (!defined('_GNUBOARD_')) {
    exit;
}
/*
 * 기본 latest
 */
add_stylesheet('<link rel="stylesheet" href="' . G5_THEME_CSS_URL . '/skin/mobile/asktheme.latest_basic.css">', 0);
?>
<div class="latest-ask-basic-wrap">
    <div class="latest-header">
        <h3 class="latest-title">
            <a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $bo_table ?>"><?php echo $bo_subject; ?></a>
        </h3>
    </div>
    <div class="latest-body">
        <ul class="latest-list">
            <?php for ($i = 0; $i < count($list); $i++) { ?>
                <li>
                    <?php
                    //echo $list[$i]['icon_reply']." ";
                    echo "<a href='{$list[$i]['href']}' class='latest-links'>";
                    if (isset($list[$i]['icon_new'])) {
                        if ($list[$i]['icon_new']) {
                            echo '<i class="textcon textcon-new">New</i> ';
                        }
                    }
                    if (isset($list[$i]['icon_hot'])) {
                        if ($list[$i]['icon_hot']) {
                            echo '<i class="textcon textcon-hot">Hot</i> ';
                        }
                    }
                    if (isset($list[$i]['icon_file'])) {
                        if ($list[$i]['icon_file']) {
                            echo '<i class="textcon textcon-file">File</i> ';
                        }
                    }
                    if (isset($list[$i]['icon_link'])) {
                        if ($list[$i]['icon_link']) {
                            echo '<i class="textcon textcon-link">Link</i> ';
                        }
                    }
                    if (isset($list[$i]['icon_secret'])) {
                        if ($list[$i]['icon_secret']) {
                            echo '<i class="textcon textcon-new"><i class="fa fa-unlock-alt" aria-hidden="true"></i></i> ';
                        }
                    }
                    if ($list[$i]['is_notice']) {
                        echo '<i class="textcon textcon-notice">Notice</i> ';
                    }
                    echo $list[$i]['subject'];

                    if ($list[$i]['comment_cnt']) {
                        echo $list[$i]['comment_cnt'];
                    }
                    echo "</a>";

                    // if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
                    // if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
                    ?>
                </li>
            <?php } ?>
            <?php if (count($list) == 0) { //게시물이 없을 때   ?>
                <li>게시물이 없습니다.</li>
            <?php } ?>
        </ul>
    </div>

    <div class="latest-footer">
        <div class="latest-more">
            <a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $bo_table ?>"><span class="sound_only"><?php echo $bo_subject ?></span>more</a>
        </div>
    </div>
</div>