织梦教程:不显示未审核文档的TAG的方法
文章介绍
未审核文档的TAG会显示在TAG列表页面, 固然点击进入TAG时, 相关的未审核文章不会显示出来, 这样对用户体验是很不好的. DEDECMS暂时没有提供这个功能,所以要解决这个问题, 让DEDECMS不显示未审核文档的TAG, 就要修改TAG的显示库文件 tag.lib.php。
方法一
打开 /include/taglib/tag.lib.php 文件
找到
if(!empty($typeid))
{
$addsql = " where typeid='$typeid' ";
}
修改为
$dsql->SetQuery("Select tid From `dede_taglist` where arcrank<=-1");
$dsql->Execute();
$ids = '';
while($row = $dsql->GetArray())
{
$tid = $row['tid'];
$cquery = "Select count(*) as dd From `dede_taglist` where tid = $tid and arcrank<=-1";
$crow = $dsql->GetOne($cquery);
if(!$crow['dd'])
{
$ids .= ( $ids=='' ? $row['tid'] : ','.$row['tid'] );
}
}
if($ids != '')
{
$addsql= " where id not in($ids) ";
}
if(!empty($typeid))
{
if($addsql)
{
$addsql= " and typeid='$typeid' ";
}else{
$addsql= " where typeid='$typeid'" ;
}
}
本站资源均来自互联网或会员发布,如果不小心侵犯了您的权益请与我们联系。我们将立即删除!谢谢!