|
DedeCMS采集文章后导出为仅动态的解决方案
想要让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' "); [b] |
|