您现在的位置是:首页 > 教程 > dedecms教程dedecms教程

织梦未审核文档的发布时间为当前时间的实现方法

山柏2023-12-10 23:10:21dedecms教程已有人查阅

导读织梦模板未审核文档的发布时间是采集时的时间,因为有一些采集的文档需要编辑,所以当前发布时的时间总是“落后、过去式”,那么如何自动修改为当前时间呢?

织梦模板未审核文档的发布时间是采集时的时间,因为有一些采集的文档需要编辑,所以当前发布时的时间总是“落后、过去式”,那么如何自动修改为当前时间呢?现在就说一下修改方法(在DEDE5.3下测试通过):
打开DEDE后台所在目录(默认为dede)的archives_do.php文件,大概在200行开始:
$maintable = ( trim($row['maintable'])=='' ? 'dede_archives' : trim($row['maintable']) );
$dsql->ExecuteNoneQuery("Update `dede_arctiny` set arcrank='0' where id='$aid' ");
if($row['issystem']==-1)
{
$dsql->ExecuteNoneQuery("Update `".trim($row['addtable'])."` set arcrank='0' where aid='$aid' ");
}
else
{
$dsql->ExecuteNoneQuery("Update `$maintable` set arcrank='0' where id='$aid' ");
}
$pageurl = MakeArt($aid,false);
}
ShowMsg("成功审核指定的文档!",$ENV_GOBACK_URL);
修改为:
$maintable = ( trim($row['maintable'])=='' ? 'dede_archives' : trim($row['maintable']) );
$newdate = time();
$dsql->ExecuteNoneQuery("Update `dede_arctiny` set sortrank='$newdate',senddate='$newdate',arcrank='0' where id='$aid' ");
if($row['issystem']==-1)
{
$dsql->ExecuteNoneQuery("Update `".trim($row['addtable'])."` set sortrank='$newdate',pubdate='$newdate',senddate='$newdate',arcrank='0' where aid='$aid' ");
}
else
{
$dsql->ExecuteNoneQuery("Update `$maintable` set sortrank='$newdate',pubdate='$newdate',senddate='$newdate',arcrank='0' where id='$aid' ");
}
$pageurl = MakeArt($aid,false);
}
ShowMsg("成功审核指定的文档!",$ENV_GOBACK_URL);

本文标签:

很赞哦! ()

留言与评论 (共有 条评论)
验证码:

本栏推荐

相关标签