首页 > CMS > 织梦DEDE > 正文

DedeCMS采集文章后导出为仅动态的解决方案

2024-07-12 08:44:58
字体:
来源:转载
供稿:网友
想要让DedeCMS采集文章后,直接导出成仅动态的类型,而不是未生成?按照下面步骤即可实现。

登陆FTP,寻找 dede/co_export.php 文件,找到如下代码:

        //插入数据库
        $rs = $dsql->ExecuteNoneQuery($indexSql);
        if($rs)
        {
            $aid = $dsql->GetLastID();
            $mainSql = str_replace('@aid@',$aid,$mainSql);
            $addSql = str_replace('@aid@',$aid,$addSql);
            $mainSql = ereg_replace('@([a-z0-9]{1,})@','',$mainSql);
            $addSql = ereg_replace('@([a-z0-9]{1,})@','',$addSql);
            $rs = $dsql->ExecuteNoneQuery($mainSql);
            if(!$rs)
            {
                echo "导入 '$title' 时错误:".$dsql->GetError()."
";
                $dsql->ExecuteNoneQuery("Delete From `arctiny` where id='$aid' ");
            }
            else
            {
                $rs = $dsql->ExecuteNoneQuery($addSql);
                if(!$rs)
                {
                    echo "导入 '$title' 时错误:".$dsql->GetError()."
";
                    $dsql->ExecuteNoneQuery("Delete From `arctiny` where id='$aid' ");
                    $dsql->ExecuteNoneQuery("Delete From `$maintable` where id='$aid' ");
                }
            }
        }
        $dsql->ExecuteNoneQuery("update `co_htmls` set isexport=1 where aid='$exid' ");
    }

请将红色代码修改为如下代码(直接替换即可)

    $dsql->ExecuteNoneQuery("update `archives` set ismake=-1 where id='$aid' ");
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表