您现在的位置是:首页 > cms教程 > DedeCMS教程DedeCMS教程
dedecms手机网站添加详情内页上一页/下一页的翻页的方法
简务2023-09-19DedeCMS教程已有人查阅
导读修改文件include/arc.archives.class.php文件。1、搜索function GetPreNext($gtype=)2、将这个函数的
修改文件include/arc.archives.class.php文件。
1、搜索
1、搜索
function GetPreNext($gtype='')
2、将这个函数的所有内容替换为
function GetPreNext($gtype='')
{
$rs = '';
if(count($this->PreNext)<2)
{
$aid = $this->ArcID;
$preR = $this->dsql->GetOne("Select id From `dede_arctiny` where id<$aid And arcrank>-1 And typeid='{$this->Fields['typeid']}' order by id desc");
$nextR = $this->dsql->GetOne("Select id From `dede_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 `dede_archives` arc left join dede_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>
大功告成
本文标签:
很赞哦! ()
相关教程
- PHPCMS和织梦DEDECMS对比分析
- cms基本概念dedecms,phpcms介绍
- DedeCMS, Discuz, Phpwind, PhpCMS配置安全设置方法
- phpcms和dedecms工作区别
- 帝国cms、dedecms、phpcms等负载测试
- dedecms、php168,phpcms、VeryCMS、DiyPage五款开源cms系统点评
- phpcms和dedecms有哪些区别不同
- dedecms织梦发布内容网站为空白的原因有哪些
- dedecms织梦程序安装后无法修改栏目的解决方法
- 织梦dedecms上传图片默认路径怎么修改
- 用dedecms织梦程序做中英双语网站制作方法
- 织梦dedecms首页幻灯片不显示的原因和解决办法
图文教程
dedecms搜索结果列表页调用自定义字段的方法
关于在dedecms搜索结果列表页调用自定义字段的方法比较多有些教程都写得比较含糊,经过织梦者的测试今天推荐一个比较有效的方法给大家
织梦dedecms自定义模型字段火车头web发布模块制作介绍
如果你是用了dedecms自定义模型,并且添加了自定义字段,要制作web发布模块的时候应该按照以下步骤更改原对应模块(以文章系统系统为例):
织梦模板文件位置路径,织梦模板文件在哪
问:织梦模板文件在什么地方?答:默认的是在templets/default文件夹里 \templets\default\images这个是模板图片文件夹
dedecms后台假死卡死不能动的原因及解决方法
织梦(DEDECMS)登录后台后,点击左边栏目列表没有任何反应,甚至导致整个浏览器崩溃,那么是什么原因导致这样的恶果呢?解决织梦(DEDECMS)登录后台假死
相关源码
-
(自适应)帝国CMS7.5模板淘宝客导购博客文章源码本模板基于帝国CMS7.5内核深度开发,为电商导购类网站设计。采用响应式布局技术,确保在手机、平板及电脑端均能获得优质浏览体验。模板内置商品推荐模块与优惠信息展示区,可快速搭建专业导购平台。查看源码 -
(自适应)幽默笑话脑筋急转弯搞笑趣图博客pbootcms模板下载本模板基于PbootCMS系统开发,专为幽默笑话、搞笑趣图类网站设计。采用轻松活泼的布局风格,突出娱乐内容分享特色,适合各类笑话、段子、搞笑图片等内容展示。查看源码 -
(自适应)蓝色自动溶剂萃取仪器设备类网站pbootcms模板下载本模板为溶剂萃取设备、实验室仪器等精密仪器行业设计,采用PbootCMS内核开发,具有高度专业性和行业适配性。模板设计充分考虑了仪器设备行业展示需求,能够呈现各类精密仪器的技术参数、应用场景和解决方案。查看源码 -
(PC+WAP)货物运输快递物流汽车贸易pbootcms模板下载为货运代理、汽车贸易及快递企业设计的全终端适配网站系统,整合运单追踪与车辆展示核心功能模块原生开发的DIV+CSS架构,支持WebP图像压缩技术。查看源码 -
(自适应响应式)蓝色环保机械设备网站pbootcms模板HTML5源码下载基于PbootCMS的生态环境技术展示平台,通过内容调整可应用于新能源设备、污水处理、空气净化等环保相关领域。设备参数采用对比表格展示,技术原理支持图文混排;查看源码 -
(PC+WAP)聚氨酯粉末涂料防腐耐用材料粘合剂网站源码下载为化工涂料企业设计的展示系统,集成产品技术参数库、颜色样板展示器和配方查询模块。支持粉末涂料、环氧树脂等多类产品分类展示查看源码
| 分享笔记 (共有 篇笔记) |
大家在看
织梦cms收费哪几款cms可以免费商用?本栏推荐
相关标签
大家喜欢
- 织梦{dede:list}列表按多种排序显示的方法
- 织梦dedecms下拉式友情链接的制作方法
- 织梦dedecms提示plus\search.php on line 44 search.php报错
- dedecms提示ereg_replace() is deprecated错误的解决方法
- dedecms5.6,5.7发布文章空白的解决方法
- 织梦dedecms wap手机门户站点首页不更新怎么办
- 去除dedecms首页网址后缀显示index.html的方法
- 织梦dedecms模板调用标签大全归总
- dedecms搬家后提示/include/templets/default/index.htm Not Fou
- dede评论盖楼的显示方法修改