网站模板中心

您现在的位置:首页>>织梦大学>>织梦技巧

织梦教程:不显示未审核文档的TAG的方法

来源: 编辑:admin 发布时间:2020-09-04热度:64 ℃
未审核文档的TAG会显示在TAG列表页面, 固然点击进入TAG时, 相关的未审核文章不会显示出来, 这样对用户体验是很不好的. DEDECMS 暂时没有提供这个功能,所以要解决这个问题, 让DEDECMS不...
未审核文档的TAG会显示在TAG列表页面, 固然点击进入TAG时, 相关的未审核文章不会显示出来, 这样对用户体验是很不好的. DEDECMS暂时没有提供这个功能,所以要解决这个问题, 让DEDECMS不显示未审核文档的TAG, 就要修改TAG的显示库文件 tag.lib.php。
方法一
打开 /include/taglib/tag.lib.php 文件
找到
1 if(!empty($typeid))
2 {
3 $addsql " where typeid='$typeid' ";
4 }
修改为
01 $dsql->SetQuery("Select tid From `dede_taglist` where arcrank<=-1"); 
02         $dsql->Execute();
03         $ids '';
04         while($row $dsql->GetArray())
05         {
06             $tid $row['tid'];
07             $cquery "Select count(*) as dd From `dede_taglist` where tid = $tid and arcrank<=-1";
08             $crow $dsql->GetOne($cquery);
09             if(!$crow['dd'])
10             {
11                 $ids .= ( $ids=='' $row['tid'] : ','.$row['tid'] );
12             }
13         }
14         if($ids != '')
15         {
16             $addsql" where id not in($ids) ";
17         }
18         if(!empty($typeid))
19         {
20             if($addsql)
21             {
22                 $addsql" and typeid='$typeid' ";
23             }else{
24                 $addsql" where typeid='$typeid'" ;
25             }
26         }
 
方法二
找到
1 $row['keyword'] = $row['tag'];
在其前边加入:
1 $rankrowss $dsql -> GetOne("SELECT count(tid) as rankcount FROM `js_taglist` WHERE tid = $row[id] and arcrank >= 0");
2 if($rankrowss[rankcount] == 0) continue;
通过以上两种方法就可以实现不显示未审核文档的tag了

Pbootcms问题解决

请点击在线联系我们【点击咨询解决问题】   如果您有任何Pbootcms问题,我们将免费为您写解决教程!

    PB模板网:承接仿站业务,价格200元起!