学习资料_文档下载_软件应用_程序模板

 找回密码
 立即注册

QQ登录

只需一步,快速开始

手机号码,快捷登录

搜索
查看: 1577|回复: 0

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

[复制链接]

402

主题

419

帖子

554

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
554
发表于 2021-9-25 02:03:18 | 显示全部楼层 |阅读模式
织梦dedecms不显示未审核文档的TAG的方法 。
未审核文档的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. }
复制代码
修改为
  1. $dsql->SetQuery("Select tid From `dede_taglist` where arcrank<=-1");  
  2.         $dsql->Execute();
  3.         $ids = '';
  4.         while($row = $dsql->GetArray())
  5.         {
  6.             $tid = $row['tid'];
  7.             $cquery = "Select count(*) as dd From `dede_taglist` where tid = $tid and arcrank<=-1";
  8.             $crow = $dsql->GetOne($cquery);
  9.             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了 。


此文档仅用于学习交流使用。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

HI223.COM 举报邮箱:345306361@qq.com

GMT+8, 2024-5-18 20:48 , Processed in 0.109307 second(s), 18 queries .

Powered by HI223分享社区 2.3

© 2019-2020 Hi223 All Right Reserved

渝公网安备 50022502000358号

渝ICP备14008270号-3