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、在article_article_m.htm文件页面上一篇下一篇插入或修改
<ul class="am-pagination blog-pagination"> <li>{dede:prenext get='mobile_pre'/}</li> <li>{dede:prenext get='mobile_next'/}</li> </ul>
dedecms手机网站内页上一篇/下一篇的翻页功能的更多相关文章
- thinkphp5.0 文章详情页 上一篇 下一篇
// 上一篇下一篇(同一个分类下,先确定该分类的pid) public function frontAfter() { $param=$this->param; $front=Db::name( ...
- phpcms v9文章内容页调用上一篇下一篇的方法(转)
phpcms v9文章内容页调用上一篇下一篇的方法如下,魔客吧(www.moke8.com)提示您直接摘取如下代码中的红色部分即可: 上一篇:{$previous_page[url]}" t ...
- ShopEx文章页添加上一篇下一篇功能
在全部的文章页中,会常常发现都会有这么一个功能.能引导用户去查看上一篇文章或下一篇文章,而在ShopEx中,我DEZEND了一下文章模型.并没有找到上一篇这种函数功能,因此,这就须要我们手动在相应的文 ...
- thinkPHP中的文章详情页实现“上一篇下一篇”功能经验分享
前段时间在公司中接触到了用thinkPHP搭建的项目,其中涉及到了文章详情页上一篇下一篇翻页的功能实现效果. 因为刚接触这套框架和PHP,所以整理一下实现该功能的经验方法. 如果有不到位的地方,欢迎指 ...
- wordpress文章显示同一分类下的上一篇下一篇
我们在用wordpress开发网站的时候会在文章页中引入上一篇下一篇,但是发现新闻页的上下文章有可能是产品分类的post,这个就不太合理,如何显示同一分类下的上一篇下一篇文章呢?随ytkah一起来看看 ...
- ecshop调用文章显示上一篇下一篇
首先调用文章中的上一篇和下一篇语法为: 代码如下 复制代码 上一篇:<a href="{$next_article.url}">{$next_article.titl ...
- MVC3学习:实现文章上一篇下一篇链接
文章的显示都是通过id查询数据库来显示.但是文章会经常删除,因此id号可能不是连续的,所以上一篇下一篇文章,不能简单的做id加减法. 我的思路是:先将表格中所有文章的ID号全部放入一个数组中,如果文章 ...
- 【转】android 欢迎界面翻页成效,仿微信第一次登陆介绍翻页界面
android 欢迎界面翻页效果,仿微信第一次登陆介绍翻页界面 本实例做的相对比较简单主要是对翻页控件的使用,有时候想要做一些功能是主要是先了解下是否有现成的控件可以使用,做起来比较简单不用费太大的劲 ...
- DEDEcms手机网站添加详情内页上一页/下一页的翻页功能
修改文件include/arc.archives.class.php文件. 1.搜索 function GetPreNext($gtype='') 2.将这个函数的所有内容替换为 function G ...
随机推荐
- 我的arcgis培训照片9
来自:http://www.cioiot.com/successview-547-1.html
- ArcEngine 打开AutoCAD文件的几种方法
方法一. IWorkspaceFactory pWorkspaceFactory; IFeatureWorkspace pFeatureWorkspace; IFeatureLayer pFeatur ...
- C#.NET如何判断是否有缺少的using
调试的时候会报错,红色的波浪线表示出错的位置,右击即可找到对应的using
- 让你完全理解base64是怎么回事
HTTP将BASE64-编码用于基本认证和摘要认证,在几种HTTP扩展中也使用了该编码. Base-64编码保证了二进制数据的安全 Base-64编码可以将任意一组字节转换为较长的常见文本字符序列,从 ...
- 编程算法 - 两个升序列的同样元素 代码(C)
两个升序列的同样元素 代码(C) 本文地址: http://blog.csdn.net/caroline_wendy 两个升序列的同样元素, 须要使用两个指针, 依次遍历, 假设相等输出, 假设小于或 ...
- Session与Cookie解析
Session和Cookie这两个对象也接触了比較长的时间了,今天就来总结一下. 首先,他们都是会话跟踪中经常使用的技术.Cookie在client记录信息来确定用户身份,Session在服务端记录信 ...
- MySQL-修改数据(REPLACE)
MySQL-REPLACE语句 功能介绍:用于向数据库表插入或更新数据. REPLACE语句的工作原理: 如果给定行数据不存在,那么MySQL REPLACE语句会插入新行. 如果给定行数据存在,则R ...
- UVA1523-Helicopter(暴力+全排列)
题目链接 题意:有八个乘客坐在直升机上,求重心M最小值. 思路:依据题目所给的公式,我们能够知道要使得M最小.也就是要使得Mv和Mh的和最小,我们能够使用全排列,分别将每一个值放在各个位子上,然后更新 ...
- 指针数组,数组指针,函数指针,main函数实质,二重指针,函数指针作为參数,泛型函数
1.指针数组 数组里面的每一个元素都是指针. 指针数组的案比例如以下: 易犯错误: 2.数组指针 归根结底还是指针,仅仅是取*的时候可以取出一整个数组出来. 数组指针:(一个指针指向了数组.一般 ...
- OSX:不同OSX版本号的标记可能不兼容
现象: 依据測试,中文OS X 10.9和中文10.10的文件标记彼此不兼容. 也就是说.比方在10.9中的颜色标记,在10.10DP2中不能删除,但能够加入/删除10.10自己的颜色标记,反之亦然. ...