当前位置: 移动技术网 > IT编程>开发语言>PHP > phpcms手机内容页面添加上一篇和下一篇

phpcms手机内容页面添加上一篇和下一篇

2018年06月18日  | 移动技术网IT编程  | 我要评论

高家虎,树木游泳的力量,动漫下载网站

在phpcms\modules\wap\index.php里面,搜索下面这句

复制代码 代码如下:

if(!$r || $r['status'] != 99) showmessage(l('info_does_not_exists'),'blank');

找到后,在它的下一行添加上

复制代码 代码如下:

 //上一页
 $previous_page = $this->db->get_one("`catid` = '$catid' and `id`<'$id' and `status`=99",'*','id desc');
 //下一页
 $next_page = $this->db->get_one("`catid`= '$catid' and `id`>'$id' and `status`=99");
 if(empty($previous_page)) {
                            $previous_page = array('title'=>l('first_page'), 'thumb'=>img_path.'nopic_small.gif', 'url'=>'javascript:alert(\''.l('first_page').'\');');
                    }
                    if(empty($next_page)) {
                            $next_page = array('title'=>l('last_page'), 'thumb'=>img_path.'nopic_small.gif', 'url'=>'javascript:alert(\''.l('last_page').'\');');
                    }

在模板中添加

上一页:

复制代码 代码如下:

< a href="{wap_siteurl}&a=show&catid={$catid}&typeid=1&id={$previous_page[id]}" >{$previous_page[title]}</a>

下一页:

复制代码 代码如下:

<a href="{wap_siteurl}&a=show&catid={$catid}&typeid=1&id={$next_page[id]}" >{$next_page[title]}</a>

以上所述就是本文的全部内容了,希望大家能够喜欢。

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网