正经笑话 發表於 2023-9-25 00:00:00

DEDECMS教程:去除列表页文章标题加粗标签的方法

<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        最近在用DEDECMS搭架网站的时候,我碰到这种情况:就是生成的列表模板中,列表文章标题全都加粗加黑了,这样看的特别扭。刚开始,我还以为是样式出了问题,我就把列表模板页面的样式检查了一遍,根本没有加粗标签。我用火狐浏览器看了一下列表文章标题的样式,确实有&lt;b&gt;标签存在。那既然不是列表模板的问题,那就是DEDECMS相关地方的问题,这种问题之前也没遇到过。</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
          既然是列表显示的问题,我就找到了DEDECMS列表显示的类文件:include目录下的arc.listview.class.php。我打开该文件,冒着试一试的想法,查找了一下标签,还真找了,代码如下:</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
         </p>
<div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
        <div class="right">
                <span><u>复制代码</u></span>
</div>
        代码如下:</div>
<div class="msgborder" id="phpcode1" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
        <br>
        if(preg_match('/c/', $row['flag']))<br>
        { <br>
        $row['title'] = "&lt;b&gt;".$row['title']."&lt;/b&gt;";<br>
        } &lt;/p&gt; &lt;p&gt;</div>
<br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>  这句代码的意思,大概就是,如果在DEDECMS后台发布文章时,如果选择了推荐(c)属性,那么生成的列表中,文章标题就加粗。因为其他原因,我就把这几句代码注释掉了,然后重新生成了一下栏目,刷新一下,列表文章标题的加粗标签都没了。</span>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
         </p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
          大家如果以后遇到这种情况,可以试试这种方法。</p>
頁: [1]
查看完整版本: DEDECMS教程:去除列表页文章标题加粗标签的方法