Home > Backend Development > PHP Tutorial > phpcms手机内容页面添加上一篇和下一篇_php实例

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:12:41
Original
893 people have browsed 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`  //下一页
 $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').'\');');
                    }

在模板中添加

上一页:

复制代码 代码如下:

{$previous_page[title]}

下一页:

复制代码 代码如下:

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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
How to uninstall phpcms
From 1970-01-01 08:00:00
0
0
0
phpcms cannot be installed
From 1970-01-01 08:00:00
0
0
0
phpcms access address does not exist
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template