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}
新闻热点
疑难解答