Example #1
0
<?php

$newList = Helper_Blog::getArticleList(array('fields' => array('id', 'title'), 'cate' => $cate, 'order' => 'order by id desc'));
//最近30天最热的
$fiveDayHot = SYSTEM_TIME - 30 * 24 * 3600;
$hotList = Helper_Blog::getArticleList(array('fields' => array('id', 'title'), 'cate' => $cate, 'order' => 'order by view desc', 'updateTime' => $fiveDayHot));
if (count($hotList) < 5) {
    $hotList = Helper_Blog::getArticleList(array('fields' => array('id', 'title'), 'cate' => $cate, 'order' => 'order by view desc'));
}
//最新评论文章
$newComments = Helper_Blog::getCommentsArticles(array('limit' => '10'));
$newCommentsList = array();
foreach ((array) $newComments as $aid) {
    $newCommentsList[] = Helper_Blog::getArticleList(array('fields' => array('id', 'title'), 'articleid' => $aid))[0];
}
if ($newList) {
    ?>
<div class="yard cm_mb" style="margin-top:10px;">
    <div class="ydtitle">
        <h3>
            <?php 
    if (!empty($cate)) {
        echo $cateList[$cate][0];
    }
    ?>
最新更新文章
        </h3>
    </div>
    <div class="ydcontent">
        <div style="margin-left: 2em" class="c5">
            <ul>