phpcms wap手機站文章內容頁分頁點擊圖片進入下一頁的方法是什么?不少朋友問過,一直沒來得及整理,下面給大家介紹下具體操作方法:
1、打開 /phpcms/modules/wap/functions/global.func.php 文件,找到
if($showremain) $multipage .="| <a href='".$pageurls[$curr_page][1]."&remains=true'>剩余全文</a>";
將此代碼注釋或刪除掉
2、打開 /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 = $this->db->get_one("`catid` = '$catid' AND `id`='$id' AND `status`=99",'*','id DESC');}if(empty($next_page)) {$next_page = $this->db->get_one("`catid`= '$catid' AND `id`='$id' AND `status`=99");}
3、打開 phpcms/modules/wap/index.php 文件
找到
if(strpos($content, '[/page]')!==false) { $content = preg_replace("|/[page/](.*)/[/page/]|U", '', $content);} elseif (strpos($content, '[page]')!==false) { $content = str_replace('[page]', '', $content);}
修改為
if(strpos($content, '[/page]')!==false) { $content = preg_replace("|/[page/](.*)/[/page/]|U", '', $content);} elseif (strpos($content, '[page]')!==false) { $content = str_replace('[page]', '[page]', $content);}
4、手機版文章頁show.html調用代碼
{if $pages}<?php$i=strrpos($pages,"href=");$str = substr($pages,$i+5,-13);if ($page==$pagenumber){//如下代碼為點擊最后一張圖片進入上一篇文章,如果想點擊最后一張圖片進入下一篇文章需將$previous_page[id]修改為$next_page[id]//如果想點擊最后一張圖片進入對應欄目頁,則需將//WAP_SITEURL."&a=show&catid=".$catid."&typeid=".$typeid."&id=".$previous_page[id]//修改為//WAP_SITEURL."&a=lists&typeid=".$typeid$content = preg_replace('/(<img (.+)>)/Ui',"<a href=/"".WAP_SITEURL."&a=show&catid=".$catid."&typeid=".$typeid."&id=".$previous_page[id]."/">/${1}</a>",$content,-1);}else{$content = preg_replace('/(<img (.+)>)/Ui',"<a href=".$str."/${1}</a>",$content,-1);}?>{/if}{$content}
新聞熱點
疑難解答