/** * 对前后文章数据进行组织 */ private function formatPrevNext($prevNext) { if (!is_array($prevNext)) { return false; } $out = array(); foreach ($prevNext as $pkey => $pN) { if (is_array($pN)) { if (!$pN) { $out[$pkey] = array(); } foreach ($pN as $key => $val) { $out[$pkey][$key]['title'] = $val['title']; $out[$pkey][$key]['url'] = Blog_Plugin_Urls::getDetailUrl(array('articleid' => $val['id'])); } } } return $out; }
?> <span>未发布</span><?php } else { ?> <span> </span><?php } ?> <span><?php echo date("Y-m-d H:i:s", $val['insertTime']); ?> </span><a class="link1">[<?php echo $val['cate']; ?> ]</a> <a target="_blank" href="<?php echo Blog_Plugin_Urls::getDetailUrl(array('articleid' => $val['id'])); ?> "><?php echo $val['title']; ?> </a> </li> <?php } } ?> <p class="page"><?php echo $pageStr; ?> </p> </ul>
<div class="cm_M"> <div class="news_nav"> <div class="subbar wp"> <h1> 给你推荐的博文 </h1> <div class="tab_box"> <ul> <?php if ($recommendList) { foreach ($recommendList as $articleInfo) { ?> <li> <h2> <a target="_blank" href="<?php echo str_replace(APP_BLOG_NAME, $articleInfo['webSite'], Blog_Plugin_Urls::getDetailUrl(array('articleid' => $articleInfo['articleId']))); ?> " title="<?php echo $articleInfo['title']; ?> "><?php echo $articleInfo['title']; ?> </a> </h2> <p><?php echo $articleInfo['descript']; ?> ...</p> <p class="list_title">发布于:<?php echo date('m-d H:i', $articleInfo['publishTime']);
<div class="hidden2 searchBlk"> <form target="_blank" action="<?php echo Blog_Plugin_Urls::getIndexUrl(array()); ?> " autocomplete="off" method="get" id="scbar_form"> <input type="hidden" name="c" value="list"></input> <input type="hidden" name="a" value="search"></input> <div class="search_goal"> <p> <input type="text" autocomplete="off" class="search_goal_input" value="<?php if (empty($cate) && !empty($tag)) { echo $tag; } ?> " name="keyword"> </p><input type="submit" value="搜索" class="search_goal_btn"> </div> <table width="100%"> <tbody> <tr> <td width="60"> <input type="radio" <?php if (!isset($type) || $type != 'tags') { ?> checked<?php } ?> value="fulltext" id="sear1" name="type"><label for="sear1">全文</label> </td> <td> <input type="radio" value="tags" <?php
" 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 } ?>
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'); }
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>
ispublish: p,//发布或者预览的标志0:预览,1:发布 articleId: articleId,//如果有改id说明是修改,否则为新增 cate: cate, title: title, tags: tags, source: source, content: content, imgArr: imgArr }, function(r) { articleId = r; if(r==='error'){ alert('在同一个类型下,不允许发布两篇文章的题目相同。');return false; } //window.open(""); window.location.href = "<?php echo Blog_Plugin_Urls::getDetailUrl(array('articleid' => '"+articleId+"')); ?> "; }) } })(); } } publishArticle() //实例化编辑器 //建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例 var ue = UE.getEditor('editor'); //图片追加到内容 function appendImgToContent(){ var imgArr = document.getElementById("upload-images").getElementsByTagName("img"); if(imgArr){
?> "><?php echo $cateList[$cateid][0]; ?> 热门标签</a> </h3><a class="cm_go" target="_blank" href="<?php echo Blog_Plugin_Urls::getListUrl(array('cate' => $cateid)); ?> ">更多>></a> </div> <div class="ydcontent index_gtag"> <?php foreach ($tagArr as $tagInfo) { ?> <a class="tag project" href="<?php echo Blog_Plugin_Urls::getListUrl(array('cate' => $cateid, 'tag' => $tagInfo['tag'])); ?> " title="<?php echo $cateList[$cateid][0]; ?> <?php echo $tagInfo['tag']; ?> "><?php echo $tagInfo['tag']; ?> </a> <?php } ?> </div>