DedeCMS网站栏目管理中,默认可以显示文章的数量,我想让它显示未审核文章的数量,可以按照以下方式修改。
打开文件/include/typeunit.class.admin.php
在96行的上面,或者搜索:function ListAllType($channel=0,$nowdir=0),在它的上面加入下面代码:
//获取所有栏目的未审核文档ID数
function UpdateCatalogNumw()
{
$this-dsql-SetQuery(SELECT typeid,count(typeid) as dd FROM dede_arctiny where arcrank =-1 group by typeid);
$this-dsql-Execute();
while($row = $this-dsql-GetArray())
{
$this-CatalogNumsw[$row['typeid']] = $row['dd'];
}
}
function GetTotalArcw($tid)
{
if(!is_array($this-CatalogNumsw))
{
$this-UpdateCatalogNumw();
}
if(!isset($this-CatalogNumsw[$tid]))
{
return ;
}
else
{
$totalnum = 0;
$ids = explode(',',GetSonIds($tid));
foreach($ids as $tid)
{
if(isset($this-CatalogNumsw[$tid]))
{
$totalnum += $this-CatalogNumsw[$tid];
}
}
return font color=red.$totalnum.未发font;
}
}
如果你的数据库表前缀修改过,那么要把表前缀dede_改成你修改过的。
然后在原145行或搜索:
(文档:".$this->GetTotalArc($id).")
把它替换成:
(文档:".$this->GetTotalArc($id).$this->GetTotalArcw($id).")
根据上面这样修改以后,后台栏目管理那里就可以显示出每个栏目还有多少篇文章未审核了。