您现在的位置是:首页 > 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删除文章同时也删除附件的实现方法
首先添加两个函数代码如下:解析文档内容的本地图片图片把这段代码贴到include/common.func.php后面,接着打开后台(假设使用默认的dede作为后台)
dede织梦怎么修改模板路径
相信大家用Dede架构网站的有很多吧,很多时候我们是直接复制一个templets\default文件夹修改掉名字来达到修改模版路径的目的,但是如果自己做的模板
dedecms织梦只能采集到第一页的解决方法
最近在使用织梦模板后台的采集功能发现如果被采集的文章是分页的话,那么只能采集到第一页。试了好多次,都没有成功,想必是织梦模板本身的BUG吧。
dedecms全文搜索功能怎么实现
dedecms 5.5 默认的模糊搜索只能根据网站文章的名称进行搜索,无法搜索到文章内部信息,对此经过研究得出以下修改方法,现共享下:
相关源码
-
响应式电脑维修办公用品维护pbootcms网站模板模板介绍(自适应手机版)响应式电脑修理公司pbootcms网站模板-蓝色HTML5电脑修理维修店网站源码下载PbootCMS内核开发的营销型网站模板,该模查看源码 -
(自适应响应式)html5蓝色智能水表营销型网站pbootcms模板下载PbootCMS内核开发,为智能水表企业打造的营销型网站解决方案,本模板基于PbootCMS内核开发,为智能水表及相关行业企业设计,采用HTML5+CSS3技术构建,具有响应式布局。查看源码 -
(自适应响应式)刷卡机POS机无线支付设备pbootcms网站源码下载本模板基于PbootCMS系统开发,为支付终端设备企业设计,特别适合POS机、移动支付终端、刷卡设备等金融科技产品展示。采用响应式布局技术,确保各类支付终端产品在不同设备查看源码 -
(自适应)刷卡pos机数据移动支付设备电子科技pbootcms模板下载本模板为POS机设备制造商、移动支付终端服务商和科技企业设计,基于PbootCMS系统开发,提供完整的在线展示平台解决方案,满足支付设备行业特有的展示需求。查看源码 -
(自适应响应式)绿色环保防腐木材轻钢别墅建材pbootcms模板下载本模板为环保防腐木材、轻钢别墅建材类企业设计开发,基于PbootCMS内核构建,充分考虑了建材行业的展示需求与产品特点。模板设计风格自然环保,布局清晰合理,呈现建材产品特性与专业优势,帮助访客直观了解产品特点并建立信任感。查看源码 -
帝国CMS7.5二次元COS漫展网站模板源码免费下载本模板基于帝国CMS 7.5版本深度开发,为二次元文化分享领域设计。采用UTF-8编码,支持中文内容展示,特别适用于COSPLAY作品展示、漫展信息发布等二次元相关内容的网站建设。模板结构清晰,布局合理,充分考虑了二次元用户群体的浏览习惯和审美需求。查看源码
| 分享笔记 (共有 篇笔记) |
