在DedeCMS中的文章页面的上一篇下一篇链接处增加文章摘要的方法
发表于:2025-12-02 作者:千家信息网编辑
千家信息网最后更新 2025年12月02日,这篇文章将为大家详细讲解有关在DedeCMS中的文章页面的上一篇下一篇链接处增加文章摘要的方法,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。在DedeCMS中的文章
千家信息网最后更新 2025年12月02日在DedeCMS中的文章页面的上一篇下一篇链接处增加文章摘要的方法
这篇文章将为大家详细讲解有关在DedeCMS中的文章页面的上一篇下一篇链接处增加文章摘要的方法,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。
在DedeCMS中的文章页面的上一篇下一篇链接处怎么增加文章摘要?
DedeCMS系统默认的是在文章的上一篇和下一篇的链接只显示标题,但是有时我们希望显示其他信息,比如文章的摘要。下面给大家介绍一下方法
推荐学习:织梦cms
DedeCMS系统默认的是在文章的上一篇和下一篇的链接只显示标题,但是有时我们希望显示其他信息,比如文章的摘要。
找到arc.archives.class.php文件,在include目录下面,然后查找"GetPreNext"这个函数,将
$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 `jcode_archives` arc left join jcode_arctype t on arc.typeid=t.id ";
改成:
$query = "Select arc.id,arc.title,arc.shorttitle,arc.typeid,arc.ismake,arc.senddate,arc.arcrank,arc.money,arc.filename,arc.litpic, arc.description,t.typedir,t.typename,t.namerule,t.namerule2,t.ispart,t.moresite,t.siteurl,t.sitepath from `jcode_archives` arc left join jcode_arctype t on arc.typeid=t.id ";
比较一下其实现在只是多了arc.description,这就是文章的摘要,也称为文章描述。
需要注意的是这里的jcode_archives和jcode_arctype中的jcode_是我表结构的前缀,你需要将这个前缀改成你自己的。
现在我们已经将文章描述从数据库里面取出来了。下一步将描述显示在页面上,显示连接文字的代码本来是这样的,你可以通过查找找到,其实就在上面那段代码的附近:
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']);$this->PreNext['pre'] = "上一篇:{$preRow['title']} ";$this->PreNext['preimg'] = "
";}else{$this->PreNext['pre'] = "上一篇:没有了 "; $this->PreNext['preimg'] ="
";}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']);$this->PreNext['next'] = "下一篇:{$nextRow['title']} ";$this->PreNext['nextimg'] = "
";}else{$this->PreNext['next'] = "下一篇:没有了 "; $this->PreNext['nextimg'] ="
";}}现在为了显示出文章描述,在每一个a标签之后添加一个div div中包含文章描述:
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']);$this->PreNext['pre'] = "上一篇:{$preRow['title']} {$preRow['description']} ";$this->PreNext['preimg'] = "
{$preRow['description']} "; }else{$this->PreNext['pre'] = "上一篇:没有了 ";$this->PreNext['preimg'] ="
";}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']);$this->PreNext['next'] = "下一篇:{$nextRow['title']} {$preRow['description']} ";$this->PreNext['nextimg'] = "
{$preRow['description']} "; }else{$this->PreNext['next'] = "下一篇:没有了 ";$this->PreNext['nextimg'] ="
";}}这样做的话能显示文章摘要,但是格式可能会很乱,你可以根据需要增加样式。
关于在DedeCMS中的文章页面的上一篇下一篇链接处增加文章摘要的方法就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。
文章
上一
摘要
链接
页面
方法
代码
信息
前缀
是在
更多
标题
篇文章
系统
不错
实用
内容
函数
只是
可以通过
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
pcs7服务器安装出错
简述网络安全法的目的是什么
数据库一体机市场
商品交易软件开发
飞扬软件开发的蓝奏云分享
老挝网络安全法
达梦数据库信创目录
北京最具实力机器人软件开发公司
大数据科技互联网模板
花生地铁无法连接服务器
文献数据库有些啥
数据库达梦引擎
潜渊症不显示服务器
日照高校党建软件开发系统
慈溪软件开发设计方案
rad软件开发教程
京东软件开发打包
山东大学服务器专业
csgo新加坡服务器
大话西游2 最火爆的服务器
怎么建立标准工时数据库
数据库在磁盘的组织形式是
南京粉丝软件开发
刺客信条3连接服务器自动退出
数据库中汽车的状态怎么定义
数据库审计 技术要求
服务器挂机什么系统最好
网络安全创意宣传语
商云x不能连接到数据库
日照高校党建软件开发系统