前段时刻发一个篇”让DEDE随机更新文章”的文章, 这可以计齐整些文章和首页的更新. 但不能自动宣布没有考核的文章. 说明白一下, DEDE的文章有没有考核宣布首要是arcrank这个参数的值抉择的. 以是要把DEDE自动考核宣布文章也很轻易实现了. -598080707.NET
<?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['templet'] = MfTemplet($row['templet']);
$pv = new PartView();
$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . “/” . $row['templet']);
$pv->SaveToHtml(dirname(__FILE__).’/index.html’);
include(dirname(__FILE__).’/index.html’);
exit();
}
else
{
header(‘HTTP/1.1 301 Moved Permanently’);
header(‘Location:index.html’);
}
?>
找出文件:
$row = $dsql->GetOne(“select * from `dede_arctiny` where arcrank = -1 order by id limit 1″);
改变属性:
$iquery2 = “update `dede_archives` set arcrank = 0, ismake = 1 where id=’$id’”;
$dsql->ExecuteNoneQuery($iquery2);
相干表的更新:
$dsql->ExecuteNoneQuery($iquery2);
$dsql->ExecuteNoneQuery(“Update `dede_taglist` set `arcrank` = 0 where aid=’$id’”);
常常上面的修改, 再从头天生页面. 就能自动考核”未考核稿件”. 所有都自动化了. 虽然还可以配置栏目, 限制自动考核的范畴,这就看详细的需求了.注:想相识更多更好的站长信息资源请上 织梦喜爱者