灰儿 发表于 2016-2-19 15:13:03

phpcms v9手机门户中的show.html页添加上一篇下一篇

在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').'\');');
                  }
在模板show.html中添加

上一页:
<a href="{WAP_SITEURL}&a=show&catid={$catid}&typeid=1&id={$previous_page}"> {$previous_page} </a><br />
下一页:
<a href="{WAP_SITEURL}&a=show&catid={$catid}&typeid=1&id={$next_page}" >{$next_page}</a><br />



页: [1]
查看完整版本: phpcms v9手机门户中的show.html页添加上一篇下一篇