Example #1
0
 public function doDefault(LJL_Request $input, LJL_Response $output)
 {
     //http://hongbo.com/index.php?c=detail&a=default&articleid=67
     LJL_Http::setExpires(3600);
     #设置缓存时间
     $articleId = $input->get('articleid');
     $articleInfo = Helper_Blog::getArticleInfo(array('articleId' => $articleId, 'fileds' => array('firstImgId', 'cate', 'title', 'descript', 'tags', 'source', 'insertTime', 'view', 'content')));
     if (count($articleInfo) < 5) {
         LJL_Http::send404Header();
         $output->setTemplate('404');
         return;
     }
     $articleInfo['id'] = $articleId;
     $articleTags = explode(',', $articleInfo['tags']);
     $cateList = LJL_Config::get('Blog_' . ucfirst(APP_BLOG_NAME) . '_Cate', 'CATE');
     $prevNext = Helper_Blog::getPreNextArticle(array('articleId' => $articleId, 'fileds' => array('id', 'title')));
     $prevNext = $this->formatPrevNext($prevNext);
     //面包屑导航
     $nav[0]['title'] = '首页';
     $nav[0]['url'] = WWW_WEB;
     $nav[1]['title'] = $cateList[$articleInfo['cate']][0];
     $nav[1]['url'] = Blog_Plugin_Urls::getListUrl(array('cate' => $articleInfo['cate']));
     $nav[2]['title'] = $articleInfo['title'];
     //seo
     $output->seoArr = array('title' => $articleInfo['title'] . ' - ' . BLOG_SEO_TITTLE . ' | 最红博', 'description' => $articleInfo['descript'], 'keywords' => implode(',', $articleTags));
     $output->cateList = $cateList;
     $output->articleInfo = $articleInfo;
     $output->articleTags = $articleTags;
     $output->prevNext = $prevNext;
     $output->nav = $nav;
     $output->cate = $articleInfo['cate'];
     $output->header = $output->fetchCol("Part/Main/Header");
     $output->footer = $output->fetchCol("Part/Main/Footer");
     $output->navbarTpl = $output->fetchCol("Part/Navbar");
     $output->leftsideCate = $output->fetchCol("Part/LeftsideCate");
     $output->navGuideTpl = $output->fetchCol("Part/Navguide");
     $output->newArticleTpl = $output->fetchCol("Part/NewArticle");
     $output->commentTpl = $output->fetchCol("Part/Comment");
     $output->searchTpl = $output->fetchCol("Part/Search");
     $output->setTemplate('Detail');
 }
Example #2
0
                    </div>
                    <div class="news_nav" style="margin-top:20px;">
                        <div class="subbar3 wp">
                            <h1 style="width:280px;">
                                最新博文
                            </h1>
                            <div class="tab_box">
                                <div class="news_list">
                                    <ul>
                                        <?php 
if ($newList) {
    foreach ($newList as $articleInfo) {
        ?>
                                                <li>
                                                    <a href="<?php 
        echo str_replace(APP_BLOG_NAME, $articleInfo['webSite'], Blog_Plugin_Urls::getListUrl(array('cate' => $articleInfo['cate'])));
        ?>
" target="_blank" title="<?php 
        echo $articleInfo['cateVal'];
        ?>
">[<?php 
        echo $articleInfo['cateVal'];
        ?>
]</a> 
                                                    <a href="<?php 
        echo str_replace(APP_BLOG_NAME, $articleInfo['webSite'], Blog_Plugin_Urls::getDetailUrl(array('articleid' => $articleInfo['articleId'])));
        ?>
" target="_blank" title="<?php 
        echo $articleInfo['title'];
        ?>
" class="title"><?php 
Example #3
0
" target="_blank" title="<?php 
echo $cateList[$articleInfo['cate']][0];
?>
" class="category"><?php 
echo $cateList[$articleInfo['cate']][0];
?>
</a></b></li>
                            <?php 
if ($articleTags[0]) {
    ?>
                            <li>本文标签:
                                <?php 
    foreach ($articleTags as $val) {
        ?>
                                        <b><a href="<?php 
        echo Blog_Plugin_Urls::getListUrl(array('cate' => $articleInfo['cate'], 'tag' => $val));
        ?>
" target="_blank" title="<?php 
        echo $val;
        ?>
" class="category"><?php 
        echo $val;
        ?>
</a></b>
                                <?php 
    }
    ?>
                            </li>
                            <?php 
}
?>
Example #4
0
 public function doDefault(LJL_Request $input, LJL_Response $output)
 {
     //http://cuihongbo.com/index.php?c=list&a=default&cate=php
     //http://cuihongbo.com/index.php?c=list&a=default&cate=php&tag=%E5%AE%89%E5%85%A8%E9%97%AE%E9%A2%98
     LJL_Http::setExpires(3600);
     #设置缓存时间
     $page = $input->get('page') ? intval($input->get('page')) : 1;
     $cate = $input->get('cate');
     //与搜索标签方法融合
     $tag = $input->get('tag') ? urldecode(trim($input->get('tag'))) : urldecode(trim($input->get('keyword')));
     $cateList = LJL_Config::get('Blog_' . ucfirst(APP_BLOG_NAME) . '_Cate', 'CATE');
     //文章列表
     $articleList = Helper_Blog::getArticleList(array('page' => $page, 'pageSize' => $this->pageSize, 'fields' => array('id', 'firstImgId', 'title', 'descript'), 'cate' => $cate, 'tag' => $tag));
     //var_dump(1111);die;
     $articleCount = Helper_Blog::getArticleList(array('isCount' => 1, 'cate' => $cate, 'tag' => $tag));
     //分页相关
     $totalPage = ceil($articleCount / $this->pageSize);
     if ($page > $totalPage && $page > 1) {
         LJL_Http::send404Header();
         $output->setTemplate('404');
         return;
     }
     $pageStr = Libs_Global_Page::getPageString(array('page' => $page, 'pageTotal' => $totalPage, 'urlClass' => 'Blog_Plugin_Urls', 'urlFunc' => 'getListUrl', 'args' => array('page' => $page, 'cate' => $cate, 'tag' => $tag)));
     //获取各分类下tag标签
     if ($cateList) {
         $tagsArr = [];
         foreach ($cateList as $cateKey => $cateV) {
             $tagsArr[$cateKey] = Helper_Blog::getTags(array('cate' => $cateKey, 'limit' => 40));
         }
     }
     //面包屑导航
     $nav[0]['title'] = '首页';
     $nav[0]['url'] = WWW_WEB;
     if (!$cate) {
         $nav[1]['title'] = $tag ? $tag : '全部';
     } else {
         $nav[1]['title'] = $cateList[$cate][0];
         if ($tag) {
             $nav[1]['url'] = Blog_Plugin_Urls::getListUrl(array('cate' => $cate));
             $nav[2]['title'] = $tag;
         }
     }
     $pageTitle = $page > 1 ? '-第' . $page . '页' : '';
     //seo
     $seoTitle = $cate ? $tag ? $cateList[$cate][0] . '分类 - ' . $tag . '标签' : $cateList[$cate][0] . '分类' : $tag . '标签';
     $output->seoArr = array('title' => $seoTitle . $pageTitle . ' - ' . BLOG_SEO_TITTLE . ' | 最红博 ');
     $output->tagsArr = $tagsArr;
     $output->cate = $cate;
     $output->tag = $tag;
     $output->nav = $nav;
     $output->cateList = $cateList;
     $output->pageStr = $pageStr;
     $output->articleList = $articleList;
     $output->header = $output->fetchCol("Part/Main/Header");
     $output->footer = $output->fetchCol("Part/Main/Footer");
     $output->navbarTpl = $output->fetchCol("Part/Navbar");
     $output->leftsideCate = $output->fetchCol("Part/LeftsideCate");
     $output->navGuideTpl = $output->fetchCol("Part/Navguide");
     $output->newArticleTpl = $output->fetchCol("Part/NewArticle");
     $output->searchTpl = $output->fetchCol("Part/Search");
     $output->setTemplate('List');
 }
Example #5
0
    echo $cateList[$cate][0];
}
?>
" <?php 
if (!$tag) {
    ?>
class="y"<?php 
}
?>
>全部</a>
                            <?php 
if (isset($tagsArr) && !empty($tagsArr[$cate])) {
    foreach ($tagsArr[$cate] as $tagInfo) {
        ?>
                                <a href="<?php 
        echo Blog_Plugin_Urls::getListUrl(array('cate' => $cate, 'tag' => $tagInfo['tag']));
        ?>
" title="<?php 
        echo $tagInfo['tag'];
        ?>
" <?php 
        if ($tag == $tagInfo['tag']) {
            ?>
class="y"<?php 
        }
        ?>
><?php 
        echo $tagInfo['tag'];
        ?>
</a>
                                <?php 
Example #6
0
if (empty($cate)) {
    ?>
class="active"<?php 
}
?>
>
                <a href="<?php 
echo WWW_WEB;
?>
" title="">首页</a>
                <i></i>
            </li>
            <?php 
if ($cateList) {
    foreach ($cateList as $key => $val) {
        $url = Blog_Plugin_Urls::getListUrl(array('cate' => $key));
        ?>
                         <li <?php 
        if (isset($cate) && $key == $cate) {
            ?>
class="active"<?php 
        }
        ?>
>
                            <a href="<?php 
        echo $url;
        ?>
"><?php 
        echo $val[0];
        ?>
</a>