泽雨哥 發表於 2024-5-11 00:00:00

织梦DEDECMS后台文章列表中显示自定义字段的方法

<p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;">
        织梦后台的文章发布列表中,有些信息没有必要显示,同时又需要显示自定义字段的内容。先看图:</p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;; text-align: center;"><span style="color:#428bca"><img style="max-width:100%!important;height:auto!important;" title="织梦DEDECMS后台文章列表中显示自定义字段的方法" alt="织梦DEDECMS后台文章列表中显示自定义字段的方法" src="https://zhuji.jb51.net/uploads/img/202305/556aac3e97f01640f12a274be6db412e.jpg"/></span></p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;">
        下面就是解决方法: 找到dede/content_list.PHP文件 第165行 注释掉这行</p><div class="jb51code" style="margin: 0px; padding: 0px; outline: none; line-height: 25.2px; font-size: 14px; width: 660px; overflow: hidden; clear: both; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;"><pre class="brush:php;toolbar:false;">$whereSql&nbsp;=&nbsp;empty($channelid)&nbsp;?&nbsp;&quot;&nbsp;WHERE&nbsp;arc.channel&nbsp;&gt;&nbsp;0&nbsp;&nbsp;AND&nbsp;arc.arcrank&nbsp;&gt;&nbsp;-2&nbsp;&quot;&nbsp;:&nbsp;&quot;&nbsp;WHERE&nbsp;arc.channel&nbsp;=&nbsp;&#39;$channelid&#39;&nbsp;AND&nbsp;arc.arcrank&nbsp;&gt;&nbsp;-2&nbsp;&quot;;</pre></div><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;">
        然后找到208行的</p><div class="jb51code" style="margin: 0px; padding: 0px; outline: none; line-height: 25.2px; font-size: 14px; width: 660px; overflow: hidden; clear: both; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;"><pre class="brush:php;toolbar:false;">$query&nbsp;=&nbsp;&quot;SELECT&nbsp;arc.id,arc.typeid,arc.senddate,arc.flag,arc.ismake,
arc.channel,arc.arcrank,arc.click,arc.title,arc.color,arc.litpic,
arc.pubdate,arc.mid
FROM&nbsp;`$maintable`&nbsp;arc
$whereSql
ORDER&nbsp;BY&nbsp;$orderbyField&nbsp;DESC&quot;;</pre></div><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;">
        更换为</p><div class="jb51code" style="margin: 0px; padding: 0px; outline: none; line-height: 25.2px; font-size: 14px; width: 660px; overflow: hidden; clear: both; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;"><pre class="brush:php;toolbar:false;">$query&nbsp;=&nbsp;&quot;SELECT&nbsp;arc.id,arc.typeid,addon.huohao,arc.flag,arc.ismake,arc.channel,
arc.arcrank,arc.click,arc.title,arc.color,arc.litpic,arc.pubdate,arc.mid
FROM&nbsp;`$maintable`&nbsp;arc,`dede_addonarticle`&nbsp;addon,`dede_arctype`&nbsp;act&nbsp;where&nbsp;(arc.id=addon.aid)&nbsp;and&nbsp;(arc.typeid=act.id)$whereSql
ORDER&nbsp;BY&nbsp;$orderbyField&nbsp;DESC&quot;;</pre></div><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;">
        这个就可以了 调用方法 在dede/templets里面找到content_list.htm 直接使用 {dede:field.huohao/}标签就可以显示了</p><p style="margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, &quot;Microsoft YaHei&quot;;">
        以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。</p>
頁: [1]
查看完整版本: 织梦DEDECMS后台文章列表中显示自定义字段的方法