修改文件include/arc.archives.class.php文件。

1、搜索

function GetPreNext($gtype='')

2、将这个函数的所有内容替换为

    function GetPreNext($gtype='')
{
$rs = '';
if(count($this->PreNext)<2)
{
$aid = $this->ArcID;
$preR = $this->dsql->GetOne("Select id From `#@__arctiny` where id<$aid And arcrank>-1 And typeid='{$this->Fields['typeid']}' order by id desc");
$nextR = $this->dsql->GetOne("Select id From `#@__arctiny` where id>$aid And arcrank>-1 And typeid='{$this->Fields['typeid']}' order by id asc");
$next = (is_array($nextR) ? " where arc.id={$nextR['id']} " : ' where 1>2 ');
$pre = (is_array($preR) ? " where arc.id={$preR['id']} " : ' where 1>2 ');
$query = "Select arc.id,arc.title,arc.shorttitle,arc.typeid,arc.ismake,arc.senddate,arc.arcrank,arc.money,arc.filename,arc.litpic,
t.typedir,t.typename,t.namerule,t.namerule2,t.ispart,t.moresite,t.siteurl,t.sitepath
from `#@__archives` arc left join #@__arctype t on arc.typeid=t.id ";
$nextRow = $this->dsql->GetOne($query.$next);
$preRow = $this->dsql->GetOne($query.$pre); if(is_array($preRow))
{
$mlink = GetFileUrl($preRow['id'],$preRow['typeid'],$preRow['senddate'],$preRow['title'],$preRow['ismake'],$preRow['arcrank'],
$preRow['namerule'],$preRow['typedir'],$preRow['money'],$preRow['filename'],$preRow['moresite'],$preRow['siteurl'],$preRow['sitepath']);
$mobile_mlink = "/m/view.php?aid=".$preRow['id'];
$this->PreNext['pre'] = "上一篇:<a href='$mlink'>{$preRow['title']}</a> ";
$this->PreNext['mobile_pre'] = "上一篇:<a href='$mobile_mlink'>{$preRow['title']}</a> ";
$this->PreNext['preimg'] = "<a href='$mlink'><img src=\"{$preRow['litpic']}\" alt=\"{$preRow['title']}\"/></a> ";
}
else
{
$this->PreNext['pre'] = "上一篇:没有了 ";
$this->PreNext['mobile_pre'] = "上一篇:没有了 ";
$this->PreNext['preimg'] ="<img src=\"/templets/default/images/nophoto.jpg\" alt=\"对不起,没有上一图集了!\"/>";
}
if(is_array($nextRow))
{
$mlink = GetFileUrl($nextRow['id'],$nextRow['typeid'],$nextRow['senddate'],$nextRow['title'],$nextRow['ismake'],$nextRow['arcrank'],
$nextRow['namerule'],$nextRow['typedir'],$nextRow['money'],$nextRow['filename'],$nextRow['moresite'],$nextRow['siteurl'],$nextRow['sitepath']);
$mobile_mlink = "/m/view.php?aid=".$nextRow['id'];
$this->PreNext['next'] = "下一篇:<a href='$mlink'>{$nextRow['title']}</a> ";
$this->PreNext['mobile_next'] = "下一篇:<a href='$mobile_mlink'>{$nextRow['title']}</a> ";
$this->PreNext['nextimg'] = "<a href='$mlink'><img src=\"{$nextRow['litpic']}\" alt=\"{$nextRow['title']}\"/></a> ";
}
else
{
$this->PreNext['next'] = "下一篇:没有了 ";
$this->PreNext['mobile_next'] = "下一篇:没有了 ";
$this->PreNext['nextimg'] ="<a href='javascript:void(0)' alt=\"\"><img src=\"/templets/default/images/nophoto.jpg\" alt=\"对不起,没有下一图集了!\"/></a>";
}
}
if($gtype=='pre')
{
$rs = $this->PreNext['pre'];
}
else if($gtype=='preimg'){ $rs = $this->PreNext['preimg'];
}
else if($gtype=='mobile_pre'){ $rs = $this->PreNext['mobile_pre'];
}
else if($gtype=='next')
{
$rs = $this->PreNext['next'];
}
else if($gtype=='mobile_next')
{
$rs = $this->PreNext['mobile_next'];
}
else if($gtype=='nextimg'){ $rs = $this->PreNext['nextimg'];
}
else
{
$rs = $this->PreNext['pre']." &nbsp; ".$this->PreNext['next'];
}
return $rs;
}

3、在手机网站详情页模板内,将调用上一页、下一页标签插入。

    <ul class="am-pagination blog-pagination">

      <li>{dede:prenext get='mobile_pre'/}</li>
<div style="clear:both;"></div>
<li>{dede:prenext get='mobile_next'/}</li> </ul>

大功告成,详细攻略请移步网站,重庆老农民

DEDEcms手机网站添加详情内页上一页/下一页的翻页功能的更多相关文章

  1. dedecms手机网站内页上一篇/下一篇的翻页功能

    修改文件include/arc.archives.class.php文件. 1.搜索 function GetPreNext($gtype='') 2.将这个函数的所有内容替换为 function G ...

  2. 【转】android 欢迎界面翻页成效,仿微信第一次登陆介绍翻页界面

    android 欢迎界面翻页效果,仿微信第一次登陆介绍翻页界面 本实例做的相对比较简单主要是对翻页控件的使用,有时候想要做一些功能是主要是先了解下是否有现成的控件可以使用,做起来比较简单不用费太大的劲 ...

  3. thinkphp5.0 文章详情页 上一篇 下一篇

    // 上一篇下一篇(同一个分类下,先确定该分类的pid) public function frontAfter() { $param=$this->param; $front=Db::name( ...

  4. Webdriver控制翻页控件,并实现向前向后翻页功能,附上代码,仅供参考,其他类似日期控件的功能可以自己封装

    新增输入与选择页面的html源码: <div style="margin-top:-60px;" class="modal-content" id=&qu ...

  5. WPF中ListBox ListView数据翻页浏览笔记(强调:是数据翻页,非翻页动画)

    ListBox和ListView在应用中,常常有需求关于每页显示固定数量的数据,然后通过Timer自动或者手动翻页操作,本文介绍到的就是该动作的实现. 一.重点 对于ListBox和ListView来 ...

  6. phpcms新闻详情页上一篇下一篇的实现

    在新闻详情页(show.html或show_*.html) 只需要添加类似如下代码即可: <div>上一篇:<a href="{$previous_page[url]}&q ...

  7. 给你的网站添加谷歌AMP、百度MIP、神马MIP链接自动提交功能

    我们在做网站的时候,经常会听到别人说SEO优化,网站优化等等.但是我们经常听的云里雾里的,但是经过我们运营一段时间之后,我们慢慢的就会熟悉了,知道什么是SEO.SEO中文译名为搜索引擎优化,既然是叫搜 ...

  8. IOS开发 键盘添加工具条 退出 上一项 下一项 简单实现

    首先设置每个 UITextField 的 inputAccessoryView 为UIToolBar : 将所有的 textField 放入一个数组: 设置 UITextField UITextFie ...

  9. tp3.2博客详情页面查询上一篇下一篇

随机推荐

  1. html 去除重复边框

    <!DOCTYPE html><html> <head> <meta charset="utf-8"> <title>& ...

  2. 徒手打造基于Spark的数据工厂(Data Factory):从设计到实现

    在大数据处理和人工智能时代,数据工厂(Data Factory)无疑是一个非常重要的大数据处理平台.市面上也有成熟的相关产品,比如Azure Data Factory,不仅功能强大,而且依托微软的云计 ...

  3. miniFTP项目实战四

    项目简介: 在Linux环境下用C语言开发的Vsftpd的简化版本,拥有部分Vsftpd功能和相同的FTP协议,系统的主要架构采用多进程模型,每当有一个新的客户连接到达,主进程就会派生出一个ftp服务 ...

  4. CGO入门和OCR文字识别(非第三方API,有源码,效果好)实战

    这是我参与8月更文挑战的第5天,活动详情查看:8月更文挑战 系列文章见: [第四天] GDB调试指南:C++中如何调试生产环境的程序? [第三天] IM敏感词算法原理和实现 [第二天] 现代IM架构研 ...

  5. NOIP 模拟 $24\; \rm graph$

    题解 \(by\;zj\varphi\) 首先一个点能否选择的条件是 \(dis_{1,x}+dis_{x,n}=dis_{1,n}\) 正解是计算一条道路上的所有为 \(-1\) 边的选择范围,是个 ...

  6. SynchronizedMap和ConcurrentHashMap有什么区别

    SynchronizedMap实现上在调用Map的所有方法是,对整个map进行了同步! public V put(K key, V value) { synchronized (mutex) {ret ...

  7. redis搭建集群和主从

    说明 Redis集群至少需要3个节点,来支持投票容错机制,每个节点都有从节点,所有最少是6个服务(3个主3个从) 因为集群内置了16384个slot(哈希槽),并且把所有的物理节点映射到了这16384 ...

  8. python中的logging日志

    logging使用 import logging import os from logging import handlers from constants.constants import Cons ...

  9. SpringCloud升级之路2020.0.x版-23.订制Spring Cloud LoadBalancer

    本系列代码地址:https://github.com/HashZhang/spring-cloud-scaffold/tree/master/spring-cloud-iiford 我们使用 Spri ...

  10. mysql行转列 问题 SUM(IF(条件,列值,0))

    sum(if(条件,列值,0))语法用例: select name,sum(if(subject="语文",score,0)) as "语文" from gra ...