织梦教程:不显示未审核文档的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

$dsql->Execute();

$ids = ”;

while($row = $dsql->GetArray())

{

$tid = $row[‘tid’];

$cquery = “Select count(*) as dd From `dede_taglist` where tid = $tid and arcrank

$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'” ;

}

}

方法二

找到

$row[‘keyword’] = $row[‘tag’];

在其前边加入:

$rankrowss = $dsql -> GetOne(“SELECT count(tid) as rankcount FROM `js_taglist` WHERE tid = $row[id] and arcrank >= 0”);

if($rankrowss[rankcount] == 0) continue;

通过以上两种方法就可以实现不显示未审核文档的tag了

免责声明:本站所有文章和图片均来自用户分享和网络收集,文章和图片版权归原作者及原出处所有,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服处理。

声明:本站所有文章,如无特殊说明或标注,均为爬虫抓取以及网友投稿,版权归原作者所有。

© 版权声明
THE END
喜欢就支持一下吧
点赞7 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容