文章的上一篇,下一篇:
找到models/article.php 加上后面两句在$article_info['message'] = FORMAT::parse_attachs(nl2br(FORMAT::parse_bbcode($article_info['message'])));后面加上 // 上一页 $last_pagesdb = $this->model('article')->lastpages(); //下一页 $next_pagesdb =$this->model('article')->nextpages();
导航帖地址 http://wenda.wecenter.com/article/1453// 上一页 public function lastpages(){ // $this->dao->where("catid=$data[catid] and id<$id")->order('id desc')->find(); $id = intval($_GET['id']); $sql = "SELECT id,title FROM " . get_table('article')." WHERE id< ".$id." ORDER BY id DESC LIMIT 1"; $result = $this->query_all($sql); if($result){ return $result; }else{ return $result=false; } } // 下一页 public function nextpages(){ $id = intval($_GET['id']); $sql = "SELECT id,title FROM " . get_table('article')." WHERE id> ".$id." ORDER BY id ASC LIMIT 1"; $result = $this->query_all($sql); if($result){ return $result; }else{ return $result=false; } }
2016-10-29 14:56
2016-10-29 08:40
2016-10-28 21:13
2016-10-28 16:12
2016-10-28 15:01
2016-10-28 14:58
2016-10-28 14:37
2016-10-28 10:07
2016-10-28 09:57
2016-10-28 09:53