文章的上一篇,下一篇:
找到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-28 09:51
2016-10-28 09:45
2016-10-28 09:32
2016-10-28 09:24
2016-10-27 21:22
2016-10-27 21:19
2016-10-27 21:13
2016-10-27 21:12
2016-10-27 21:06
2016-10-27 21:02