分析了一下, DEDE的文章有没有审核发布主要是arcrank这个参数的值决定的. 所以要把DEDE自动审核发布文章也很容易实现了.
代码如下:
<?php
//自动生成HTML版
if(isset($_GET['pub']))
{
require_once (dirname(__FILE__) . “/include/common.inc.php”);
require_once DEDEINC.”/arc.partview.class.php”;
//发布审核稿件
require_once(DEDEINC.”/arc.archives.class.php”);
for ($i=1; $i<=1; $i++) {
$row = $dsql->GetOne(“select * from `dede_arctiny` where arcrank = -1 order by id limit 1″);
$id = $row['id'];
$iquery = “update `dede_arctiny` set arcrank = 0 where id=’$id’”;
$dsql->ExecuteNoneQuery($iquery);
$iquery2 = “update `dede_archives` set arcrank = 0, ismake = 1 where id=’$id’”;
$dsql->ExecuteNoneQuery($iquery2);
$dsql->ExecuteNoneQuery(“Update `dede_taglist` set `arcrank` = 0 where aid=’$id’”);
$ac = new Archives($id);
$rurl = $ac->MakeHtml();
}
//更新首页
$GLOBALS['_arclistEnv'] = ‘index’;
$row = $dsql->GetOne(“Select * From `dede_homepageset`”);
$row
更多信息请查看IT技术专栏