DEDEcms手机网站添加详情内页上一页/下一页的翻页功能
修改文件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']." ".$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手机网站添加详情内页上一页/下一页的翻页功能的更多相关文章
- dedecms手机网站内页上一篇/下一篇的翻页功能
修改文件include/arc.archives.class.php文件. 1.搜索 function GetPreNext($gtype='') 2.将这个函数的所有内容替换为 function G ...
- 【转】android 欢迎界面翻页成效,仿微信第一次登陆介绍翻页界面
android 欢迎界面翻页效果,仿微信第一次登陆介绍翻页界面 本实例做的相对比较简单主要是对翻页控件的使用,有时候想要做一些功能是主要是先了解下是否有现成的控件可以使用,做起来比较简单不用费太大的劲 ...
- thinkphp5.0 文章详情页 上一篇 下一篇
// 上一篇下一篇(同一个分类下,先确定该分类的pid) public function frontAfter() { $param=$this->param; $front=Db::name( ...
- Webdriver控制翻页控件,并实现向前向后翻页功能,附上代码,仅供参考,其他类似日期控件的功能可以自己封装
新增输入与选择页面的html源码: <div style="margin-top:-60px;" class="modal-content" id=&qu ...
- WPF中ListBox ListView数据翻页浏览笔记(强调:是数据翻页,非翻页动画)
ListBox和ListView在应用中,常常有需求关于每页显示固定数量的数据,然后通过Timer自动或者手动翻页操作,本文介绍到的就是该动作的实现. 一.重点 对于ListBox和ListView来 ...
- phpcms新闻详情页上一篇下一篇的实现
在新闻详情页(show.html或show_*.html) 只需要添加类似如下代码即可: <div>上一篇:<a href="{$previous_page[url]}&q ...
- 给你的网站添加谷歌AMP、百度MIP、神马MIP链接自动提交功能
我们在做网站的时候,经常会听到别人说SEO优化,网站优化等等.但是我们经常听的云里雾里的,但是经过我们运营一段时间之后,我们慢慢的就会熟悉了,知道什么是SEO.SEO中文译名为搜索引擎优化,既然是叫搜 ...
- IOS开发 键盘添加工具条 退出 上一项 下一项 简单实现
首先设置每个 UITextField 的 inputAccessoryView 为UIToolBar : 将所有的 textField 放入一个数组: 设置 UITextField UITextFie ...
- tp3.2博客详情页面查询上一篇下一篇
随机推荐
- Apache/Nginx/IIS日志记录的各个字段内容与含义
一.Apache 1.1 Apache日志文件名称及路径介绍 当我们安装并启动Apache后,Apache会自动生成两个日志文件,这两个日志文件分别是访问日志access_log(在Windows上是 ...
- 题解 matrix
传送门 无比毒瘤的dp题,而且伪装地好像很可做的样子 考场上我给它氪了差不多一个小时最后还是只能扔了个20pts状压走人 以下思路基本均来源于题解: 对于此题,题面中三个限制条件: (1)第 i 行第 ...
- 题解 Star Way To Heaven
传送门 这整场都不会--这题想二分不会check 其实check很好写,考虑一个mid的实际意义 即为check在不靠近每个star及边界mid距离内的前提下,能不能到达\((n,m)\) 其实可以转 ...
- ReentrantLock可重入锁lock,tryLock的区别
void lock(); Acquires the lock. Acquires the lock if it is not held by another thread and returns im ...
- 两款轻量级服务器 Http-server && SimpleHTTPServer
Http-server # 全局安装 npm install http-server -g # 启动服务 # 禁用缓存 http-server -c-1 # 在当前目录下的www启动服务器 http- ...
- express中session的基本使用
1.首先安装express-session模块 npm install express-session --save 2.引入express-session,以及设置中间键 var session = ...
- 小白5分钟创建WPF
创建WPF应用程序 基于生产这里选择.Net Framework进行开发 添加控件 由于不熟悉 高效点 我们这里直接拖拽控件 如果你有一点前端基础 你可以在控件对应Code 根据属性 对控件进行设置 ...
- [ASP.NET MVC]@Html.ActionLik重载
一 Html.ActionLink("linkText","actionName") 该重载的第一个参数是该链接要显示的文字,第二个参数是对应的控制器的方法, ...
- 一、vue基础语法(轻松入门vue)
轻松入门vue系列 Vue基础语法 一.HelloWord 二.MVVM设计思想 三.指令 1. v-cloak 2. v-text 3. v-html 4. v-show 4. v-pre 5. v ...
- shiro(二)
public class AuthorizerTest { @Test public void testIsPermitted() { login("classpath:shiro-auth ...