在DedeCMS中的文章页面的上一篇下一篇链接处增加文章摘要的方法
发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,这篇文章将为大家详细讲解有关在DedeCMS中的文章页面的上一篇下一篇链接处增加文章摘要的方法,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。在DedeCMS中的文章
千家信息网最后更新 2026年11月01日在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安全错误
数据库的锁怎样保障安全
互联网科技官网
关于新基建和互联网科技
互联网公司 科技公司
互联网医疗科技
美国互联网科技
智网互联网科技
凡科互联网科技
亿账通互联网科技
互联网科技的未来发展
成都狮子座互联网科技
互联网科技生活的内容
互联网汽车科技小镇
深圳前海聚择互联网科技有限公司
荆州市昕露互联网络科技有限公司
互联网科技与大数据专业
消费医药和互联网科技
电子科技大学互联网创业大赛
群盈汇互联网科技有限公司
易租星互联网科技有限公司
恒生科技互联网指数十大成分股
奇士达互联网科技
互联网科技大会案例
科技大学互联网专业好不好
云创客互联网科技公司
科技互联网大厂
互联网科技产业特征
玉溪新华互联网科技好不好
上海科技产业互联网平台
21世纪互联网科技成就
互联网领先科技成果宣传视频