首页 > CMS建站 > PhpCMS > 正文

phpcms wap手机站文章内容页分页点击图片进入下一页的方法

2020-07-03 13:03:05
字体:
来源:转载
供稿:网友
这篇文章主要为大家详细介绍了phpcms wap手机站文章内容页分页点击图片进入下一页的方法,具有一定的参考价值,感兴趣的小伙伴们可以参考一下,有需要的朋友可以收藏方便以后借鉴。

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}


以上就是phpcms wap手机站文章内容页分页点击图片进入下一页的方法的全部内容,希望对大家的学习和解决疑问有所帮助,也希望大家多多支持错新网。
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表