栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > PHP > php开源框架 > dedecms

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

dedecms 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

织梦教程:不显示未审核文档的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'" ;             }         }
  方法二 找到 $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了
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/3869.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号