15621857753

phpcmsV9手机端怎么添加上一页和下一页

来源:齐鲁建站 栏目:开发教程 阅读: 日期:2021-05-07

本文介绍了phpcmsV9手机端怎么添加上一页和下一页,解决思路:打开这个文件wap index.php,在里面添加教程给出的代码,然后继续在模板页里面添加教程给出的上一页和下一页的代码就可以了。

下面齐鲁建站就和大家分享下phpcmsV9想要实现注册成功跳到登录页面怎么弄。

实现教程:

在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>

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

展开