예제 #1
0
파일: list.mod.php 프로젝트: bo-blog/bw
    $allStatURL = array();
    foreach ($article->articleList as $oneArticle) {
        $YYYY = substr($oneArticle['aTime'], 0, 4);
        $groupedArticles[$YYYY][] = $oneArticle;
        $columnName[$YYYY] = $YYYY;
        $columnID[$YYYY] = $YYYY;
        isset($columnCount[$YYYY]) ? $columnCount[$YYYY]++ : ($columnCount[$YYYY] = 1);
        $allStatURL[$oneArticle['aID']] = "{$conf['siteURL']}/{$conf['linkPrefixArticle']}/{$oneArticle['aID']}/";
    }
    file_put_contents(P . 'conf/allAIDs.php', "<?php\r\n\$lf=" . var_export($allStatURL, true) . ";");
    krsort($groupedArticles);
}
if ($listMode == 'tags') {
    $allTags = bw::$db->getRows('SELECT tValue, tCount FROM tags ORDER BY tCount DESC');
    foreach ($allTags as $aTag) {
        $article->getArticleListByTag($aTag['tValue']);
        $groupedArticles[$aTag['tValue']] = $article->articleList;
        $columnName[$aTag['tValue']] = $aTag['tValue'];
        $columnID[$aTag['tValue']] = $aTag['tValue'];
        $columnCount[$aTag['tValue']] = $aTag['tCount'];
    }
}
if ($listMode == 'category') {
    $article->getArticleList();
    foreach ($article->articleList as $oneArticle) {
        $cate = $oneArticle['aCateURLName'];
        $groupedArticles[$cate][] = $oneArticle;
        $columnName[$cate] = $oneArticle['aCateDispName'];
        $columnID[$cate] = $oneArticle['aCateURLName'];
        isset($columnCount[$cate]) ? $columnCount[$cate]++ : ($columnCount[$cate] = 1);
    }
예제 #2
0
파일: tag.mod.php 프로젝트: bo-blog/bw
* @link http://bw.bo-blog.com
* @copyright (c) 2014 bW Development Team
* @license MIT
*/
if (!defined('P')) {
    die('Access Denied.');
}
$article = new bwArticle();
$view = new bwView();
if (isset($canonical->currentArgs['tValue'])) {
    $view->setPageTitle($conf['l']['page:Tags'] . ' - ' . $canonical->currentArgs['tValue']);
    $view->setActiveNav('index');
} else {
    stopError($conf['l']['admin:msg:NoContent']);
}
$article->getArticleListByTag($canonical->currentArgs['tValue']);
loadServices();
//Load Duoshuo
// Pagination
$canonical->calTotalPages($article->totalArticles);
$view->doPagination();
$view->setPassData(array('articlesummary' => $article->articleList));
if (defined('ajax')) {
    $view->setMaster('ajax-article-list');
    $view->setWorkFlow(array('summary', 'ajax-article-list'));
} else {
    $view->setPassData(array('navigation' => bw::$cateList, 'sociallink' => bw::getSocialLinks(), 'externallink' => bw::getExternalLinks(), 'tagClound' => bw::getTagCloud()));
    $view->setMaster('page');
    $view->setWorkFlow(array('summary', 'page'));
}
$view->finalize();