修改文件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. Python语言系列-02-基础数据类型

    格式化输出 #!/usr/bin/env python3 # author:Alnk(李成果) # 百分号% 格式化输出 name = input('姓名:') age = input('年龄:') ...

  2. 使用JDBC(Dbutils工具包)来从数据库拿取map类型数据来动态生成insert语句

    前言: 大家在使用JDBC来连接数据库时,我们通过Dbutils工具来拿取数据库中的数据,可以使用new BeanListHandler<>(所映射的实体类.class),这样得到的数据, ...

  3. 支持初始化数据的Zookeeper Docker镜像

    最近在做一个演示项目 https://github.com/cnscud/cavedemo, 自然为了方便, 也做了docker打包, 发现zookeeper的镜像没有导入初始化数据的功能, 于是自己 ...

  4. taro小程序地址选择组件

    效果图: address_picker.tsx: import Taro, { Component } from '@tarojs/taro' import { View, PickerView, P ...

  5. 数据结构--Dijkstra算法最清楚的讲解

    迪杰斯特拉(Dijkstra)算法是典型最短路径算法,用于计算一个节点到其他节点的最短路径.它的主要特点是以起始点为中心向外层层扩展(广度优先搜索思想),直到扩展到终点为止 ###基本思想 通过Dij ...

  6. WPF 绘图 和动画

    wpf 的动画:https://www.cnblogs.com/TianFang/p/4050845.html

  7. WPF---依赖属性(二)

    一.概要 我们将会通过一个简单的综合例子来阐述下依赖属性的变化. 场景:我们在一个文本框中输入一个数字,然后对应的panel中会出现对应的椭圆,椭圆的个数与输入的文本相同. 我们在MainWindow ...

  8. qt 中的QlistWidget

  9. JS对象创建的几种方法

    最近一直在看JS高级程序设计这本书,有空来梳理一下几种创建对象的方式.话不多说,直接步入正题. 第一种:Object构造函数创建 var Person = new Object(); Person.n ...

  10. HCNP Routing&Switching之OSPF LSA类型

    前文我们了解了OSPF中的虚连接相关话题,回顾请参考https://www.cnblogs.com/qiuhom-1874/p/15202348.html:今天我们来聊一聊OSPF数据包中LSA类型相 ...