在DedeCMS中的文章页面的上一篇下一篇链接处增加文章摘要的方法
发表于:2025-02-05 作者:千家信息网编辑
千家信息网最后更新 2025年02月05日,这篇文章将为大家详细讲解有关在DedeCMS中的文章页面的上一篇下一篇链接处增加文章摘要的方法,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。在DedeCMS中的文章
千家信息网最后更新 2025年02月05日在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安全错误
数据库的锁怎样保障安全
游戏里的开服指的是服务器吗
服务器在哪看驱动管理
agv调度系统软件开发
我的世界如何连接服务器教学
济南沃德网络技术有限公司
计算机网络技术是文员吗
网络安全学习活动感想
深圳app软件开发多少钱6
js遍历上千条数据库
网络安全周从孩子抓起
台州市五金erp软件开发
优雅的数据库设计
缓存服务器镜像部署
360安全服务器下载
家庭网络安全教育讲座
如何写网络安全书
数据库怎么看表内容的代码
查询mongodb数据库语句
一年级手抄报网络安全简单画
国家安全局侵入华为服务器
sql数据库的安全性是什么
唐县厂家盘古网络技术支持
书籍推荐排行榜网络安全
数据库学习应该用什么书
属于国产数据库的是
国内国外数据库更新频率
观看网络安全知识讲座图片
杭州软件开发公司哪家有实力
速科网络技术有限公司
如何跟人合伙做软件开发