<sup id="0sgeu"><center id="0sgeu"></center></sup>
<rt id="0sgeu"><small id="0sgeu"></small></rt><rt id="0sgeu"><center id="0sgeu"></center></rt>
<acronym id="0sgeu"></acronym><rt id="0sgeu"></rt>

phpcms手機內容頁面添加上一篇和下一篇

更新時間:2016-03-30 編輯:未知 關注人次:0 云搜索


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

 

以上所述就是本文的全部內容了,希望大家能夠喜歡。

本文地址: http://www.slhfoods.com/a/xinwenguandian/vipcms/2016/0330/157.html ,轉載請注明出處。

服務支持

我們珍惜您每一次在線詢盤,有問必答,用專業的態度,貼心的服務。

讓您真正感受到我們的與眾不同!

狼客人成网