need('component/header.php'); ?> need('component/aside.php'); ?>
options->blogNotice): ?>

  options->blogNotice(); ?>

options->title(); ?>

options->featuresetup)) { $this->options->Indexwords(); }else{ echo '加载中……'; echo ''; } ?>
row = []; $this->stack = []; $this->length = 0; $order = ''; $sticky_cids = []; //初始化数据库使用工具 $restPostSelect = $this->select()->where('table.contents.type = ? and table.contents.status = ? and table.contents.created < ?', 'post','publish',time())->group('table.contents.cid'); $db = Typecho_Db::get(); $sticky = $this->options->sticky; //置顶的文章cid,按照排序输入, 请以半角逗号或空格分隔 //对置顶文章的处理 if(trim($sticky) && $this->is('index') || $this->is('front')){ $sticky_cids = explode(',', strtr($sticky, ' ', ','));//分割文本 $sticky_html = ''._mt("置顶").''; $pageSize = $this->options->pageSize; $stickySelect = $this->select()->where('table.contents.type = ?', 'post'); foreach($sticky_cids as $i => $cid) { if($i == 0) $stickySelect->where('table.contents.cid = ?', $cid); else $stickySelect->orWhere('table.contents.cid = ?', $cid); $order .= " when $cid then $i"; $restPostSelect->where('table.contents.cid != ?', $cid); //避免重复 } if ($order) $stickySelect->order(null,"(case cid$order end)"); //置顶文章的顺序 按 $sticky 中 文章ID顺序 if ($this->_currentPage == 1) foreach($db->fetchAll($stickySelect) as $sticky_post){ //首页第一页才显示 $sticky_post['sticky'] = $sticky_html; $this->push($sticky_post); //压入列队 } } $restPostSelect->join('table.relationships', 'table.relationships.cid = table.contents.cid',Typecho_Db::LEFT_JOIN) ->join('table.metas','table.metas.mid = table.relationships.mid',Typecho_Db::LEFT_JOIN) ->where('table.metas.slug != ? or table.metas.slug is NULL', 'image'); $uid = $this->user->uid; //登录时,显示用户各自的私密文章 if($uid) { $restPostSelect->orWhere('authorId = ? and table.metas.slug!=? or table.metas.slug is NULL', $uid,'image') ->where('table.contents.type = ? and table.contents.status = ? and table.contents.created < ?', 'post','private',time()); } $endSelect = $restPostSelect->order('table.contents.created', Typecho_Db::SORT_DESC); $rest_posts = $db->fetchAll($restPostSelect->order('table.contents.created', Typecho_Db::SORT_DESC)->page($this->_currentPage, $this->parameter->pageSize)); //计算相册分类的数目 $count = IMAGE_POST_NUM; foreach($rest_posts as $rest_post) { $this->push($rest_post); } //压入列队 Utils::hEcho($this->getTotal()); $this->setTotal($this->getTotal()-count($sticky_cids)-$count); //置顶文章和相册文章不计算在所有文章内 ?>
need('component/sidebar.php') ?>
need('component/footer.php'); ?>