陈耀良 發表於 2024-2-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后台添加编辑文章空白的解决方法。分享给大家供大家参考。具体分析如下:</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        <strong>原因分析:</strong></p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        根据dedecms官方文档说明,出现这种问题是可能是由于catalog_do.php里的header()的问题,因为当执行header()前,如果前面输出了空格、空行、任何字符,都会导致header()跳转失效,这就需要你非常有耐心的去排查一个个&lt;?php  ?&gt;是否有空格或空行,把这些空格空行删除,至此功能就全部正常了。</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        <strong>解决的方法:</strong></p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        1、下载…/dede/catalog_do.php把文件下载到本地,用文本编辑器打开,做如下替换:</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        A、把</p>
<blockquote>
        <ol class="dp-c">
<li class="alt">
                        <p>
                                <span><span>header(</span><span class="string">"location:article_add.php"</span><span>) </span></span></p>
                </li>
        </ol>
</blockquote>
<p>
        <span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>替换为:</span></p>
<blockquote>
        <ol class="dp-c">
<li class="alt">
                        <p>
                                <span><span>echo </span><span class="string">" "</span><span>; </span></span></p>
                </li>
        </ol>
</blockquote>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        b、把</p>
<blockquote>
        <ol class="dp-c">
<li class="alt">
                        <p>
                                <span><span>header(</span><span class="string">"location:{$gurl}?channelid={$channelid}&amp;cid= {$cid}"</span><span>); </span></span></p>
                </li>
        </ol>
</blockquote>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        替换为:<br>
         </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>
        <p>
                代码如下:</p>
</div>
<div class="msgborder" id="phpcode13" 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";'>
        echo " ";</div>
<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";'>
        2、下载…/dede/archives_do.php下载到本地,用editplus文本编辑器打开,做如下修改:</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>
        <p>
                代码如下:</p>
</div>
<div class="msgborder" id="phpcode14" 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";'>
        header("location:{$gurl}?aid=$aid");</div>
<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";'>
        修改为如下代码:<br>
         </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>
        <p>
                代码如下:</p>
</div>
<div class="msgborder" id="phpcode15" 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";'>
        echo '&lt;META HTTP-EQUIV="REFRESH" CONTENT="1; URL='.$gurl.'?aid='.$aid.'"&gt;';</div>
<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>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        后台-"系统"-"系统基本参数"-"核心设置"-"html编辑器选项(目前仅支持fck):" 这里填写fck,已正确的用户无需更改.再不行就把FCK换成ckeditor,应该能解决后台添加/编辑文章页面空白或无法显示的问题了!</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        系统基本参数- 核心设置- Html编辑器选项 填写ckeditor 保存 更新缓存</p>
<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";'>
        最后在网上找到了解决方案:<br>
         <br>
        首先进系统---系统设置----系统错误修复,修复了之前生成的错误页面。然后进入系统---系统设置---系统基本参数------其它选项-----自动提取关键字--选择否--保存。<br>
        如果是系统升级了我们可尝试下面方法解决</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        从DEDE5.6升级到5.7后,发现织梦后台部分栏目无法添加文章,添加后显示空白,进所有文档,查看文章状态显示为"未生成";查看了很多网上的帖子,没有发现能解决此问题的;后台经过逆向反复查找,最终锁定问题可能出在此栏目的模板上,模板上使用了一个自定义函数IDReturnURL;</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        而这个函数在DEDE5.7版本升级后,覆盖掉了原文件,代码如下:</p>
<blockquote>
        <ol class="dp-c">
<li class="alt">
                        <p>
                                <span><span>{dede:channelartlist typeid=386}  </span></span></p>
                </li>
                <li>
                        <p>
                                <span>&lt;H3&gt;&lt;A href=<span class="string">'{dede:field name='</span><span>typeurl</span><span class="string">'/}'</span><span> title={dede:field name=</span><span class="string">'typename'</span><span>/}&gt;{dede:field name=</span><span class="string">'typename'</span><span>/}&lt;/A&gt;&lt;/H3&gt;  </span></span></p>
                </li>
                <li class="alt">
                        <p>
                                <span>&lt;UL&gt;  </span></p>
                </li>
                <li>
                        <p>
                                <span>{dede:sql sql=<span class="string">'Select * from dede_archives where typeid=~id~ ORDER BY click limit 0,100;'</span><span>}  </span></span></p>
                </li>
                <li class="alt">
                        <p>
                                <span>&lt;li&gt;&lt;a href=<span class="string">''</span><span> target=</span><span class="string">'_blank'</span><span>&gt;&lt;/a&gt;  </span></span></p>
                </li>
                <li>
                        <p>
                                <span>{/dede:sql}  </span></p>
                </li>
                <li class="alt">
                        <p>
                                <span>&lt;/LI&gt;&lt;/UL&gt;  </span></p>
                </li>
                <li>
                        <p>
                                <span>{/dede:channelartlist} </span></p>
                </li>
        </ol>
</blockquote>
<p>
        <br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>经过查找,发现此函数定义在了extend.func.php文件中,具体定义如下:</span></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>
        <p>
                代码如下:</p>
</div>
<div class="msgborder" id="phpcode17" 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";'>
        function IDReturnURL($ID) <br>
        { <br>
        global $dsql; <br>
        $query = "Select arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault, <br>
        tp.defaultname,tp.namerule,tp.moresite,tp.siteurl,tp.sitepath <br>
        from dede_archives arc left join dede_arctype tp on arc.typeid=tp.id where arc.id = ".$ID; <br>
        $row = $dsql-&gt;GetOne($query); <br>
        $ReturnURL = GetFileUrl($row['id'],$row['typeid'],$row['senddate'],$row['title'],$row['ismake'], <br>
        $row['arcrank'],$row['namerule'],$row['typedir'],$row['money'],$row['filename'],$row['moresite'],$row['siteurl'],$row['sitepath']); <br>
        return $ReturnURL; <br>
        }</div>
<p>
        <br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>添加后,再次进行测试,一切恢复正常.</span></p>
<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";'>
        希望本文所述对大家的dedecms建站有所帮助。</p>
頁: [1]
查看完整版本: DedeCms后台添加编辑文章空白的解决方法