文章的上一篇,下一篇:

ninini
ninini 这家伙很懒,还没有设置简介

2 人点赞了该文章 · 2822 浏览

+-------------------------------------------------------------------------- |   WeCenter [#免费开发#] |   ======================================== |   by Jerry--wcenter user {ninini} |   http://www.5ihelp.com |   ======================================== |   如果有兴趣可以加群{个人兴趣群} 485114585 |                                  {官方用户群} 20712399 |   ======================================== |    更改插件记得先备份,先备份,先备份,先备份 |   ======================================== |    wecenter 版本 3.1.9 |   ======================================== |    开发索引贴地址:http://wenda.wecenter.com/article/1453 +--------------------------------------------------------------------------- 以下为以前写的上一篇,下一篇现帖出来,如果有想法或者问题,欢迎评论 文章 1,改程序文件 找开app/article/main.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();

找到models/article.php  加上后面两句

// 上一页     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;         }     }  

导航帖地址 http://wenda.wecenter.com/article/1453

发布于 2016-10-27 17:41

免责声明:

本文由 ninini 原创发布于 WeCenter ,著作权归作者所有。

登录一下,更多精彩内容等你发现,贡献精彩回答,参与评论互动

登录! 还没有账号?去注册

哦买噶
2016-10-27 20:38
超级超级感谢。
哦买噶
2016-10-27 20:38
谢谢谢谢。。非常感谢。非常感谢。 炒鸡感谢。
kaiheitv
2016-10-27 20:35
改成 // 上一页 $article_info['last_pagesdb'] = $this->model('article')->lastpages(); //下一页 $article_info['next_pagesdb'] =$this->model('article')->nextpages(); <?php echo $article_info['next_pagesdb'] ?>//调用。
kaiheitv
2016-10-27 20:12
奉献的人真可爱。
风见雨下
2016-10-27 17:51
这个不错 必须给赞一个 然后模板上调用一下就好了