香蕉成人伊视频在线观看|学生小视频国产区|yy女主播啪啪啪视频|麻豆传播媒体APP大全免费版官网|瑜伽牲交AV|国产欧美日韩在线天堂区|白浆精品国产91

返回列表 發帖
查看: 3096|回復: 2

[已處理] X3.5的默認門戶模板有個小BUG

55

主題

147

回帖

3

粉絲

爐火純青

貢獻
1 點
金幣
10 個
樓主
發表于 2022-12-6 15:28:51 |浙江| 只看樓主 |倒序瀏覽 |閱讀模式
未啟用生效的門戶分類會在任意門戶欄目中右側相關分類里顯示,無法隱藏,這個需要怎么改才能去掉不顯示呢
1 貢獻

最佳答案

https://gitee.com/Discuz/DiscuzX/pulls/1826
打開
source/function/function_portal.php

找到
  1. function category_remake($catid) {
  2.         global $_G;

  3.         $cat = $_G['cache']['portalcategory'][$catid];
  4.         if(empty($cat)) return array();

  5.         foreach ($_G['cache']['portalcategory'] as $value) {
  6.                 if($value['catid'] == $cat['upid']) {
  7.                         $cat['ups'][$value['catid']] = $value;
  8.                         $upid = $value['catid'];
  9.                         while(!empty($upid)) {
  10.                                 if(!empty($_G['cache']['portalcategory'][$upid]['upid'])) {
  11.                                         $upid = $_G['cache']['portalcategory'][$upid]['upid'];
  12.                                         $cat['ups'][$upid] = $_G['cache']['portalcategory'][$upid];
  13.                                 } else {
  14.                                         $upid = 0;
  15.                                 }
  16.                         }
  17.                 } elseif($value['upid'] == $cat['catid']) {
  18.                         $cat['subs'][$value['catid']] = $value;
  19.                 } elseif($value['upid'] == $cat['upid']) {
  20.                         $cat['others'][$value['catid']] = $value;
  21.                 }
  22.         }
  23.         if(!empty($cat['ups'])) $cat['ups'] = array_reverse($cat['ups'], TRUE);
  24.         return $cat;
  25. }
復制代碼
替換為
  1. function category_remake($catid) {
  2.         global $_G;

  3.         $cat = $_G['cache']['portalcategory'][$catid];
  4.         if(empty($cat)) return array();
  5.         require_once libfile('function/portalcp');
  6.         $categoryperm = getallowcategory($_G['uid']);
  7.         foreach ($_G['cache']['portalcategory'] as $value) {
  8.                 if($value['catid'] == $cat['upid']) {
  9.                         $cat['ups'][$value['catid']] = $value;
  10.                         $upid = $value['catid'];
  11.                         while(!empty($upid)) {
  12.                                 if(!empty($_G['cache']['portalcategory'][$upid]['upid'])) {
  13.                                         $upid = $_G['cache']['portalcategory'][$upid]['upid'];
  14.                                         $cat['ups'][$upid] = $_G['cache']['portalcategory'][$upid];
  15.                                 } else {
  16.                                         $upid = 0;
  17.                                 }
  18.                         }
  19.                 } elseif($value['upid'] == $cat['catid']) {
  20.                         $cat['subs'][$value['catid']] = $value;
  21.                 } elseif($value['upid'] == $cat['upid']) {
  22.                         if (!$value['closed'] || $_G['group']['allowdiy'] || $categoryperm[$value['catid']]['allowmanage']) {
  23.                                 $cat['others'][$value['catid']] = $value;
  24.                         }
  25.                 }
  26.         }
  27.         if(!empty($cat['ups'])) $cat['ups'] = array_reverse($cat['ups'], TRUE);
  28.         return $cat;
  29. }
復制代碼
修改后,沒權限的用戶,不會顯示未啟用的分類

回復

使用道具 舉報

17

主題

588

回帖

4

粉絲

應用開發者

貢獻
67 點
金幣
902 個
QQ
沙發
發表于 2022-12-6 15:51:36 |浙江| 只看Ta
https://gitee.com/Discuz/DiscuzX/pulls/1826
打開
source/function/function_portal.php

找到
  1. function category_remake($catid) {
  2.         global $_G;

  3.         $cat = $_G['cache']['portalcategory'][$catid];
  4.         if(empty($cat)) return array();

  5.         foreach ($_G['cache']['portalcategory'] as $value) {
  6.                 if($value['catid'] == $cat['upid']) {
  7.                         $cat['ups'][$value['catid']] = $value;
  8.                         $upid = $value['catid'];
  9.                         while(!empty($upid)) {
  10.                                 if(!empty($_G['cache']['portalcategory'][$upid]['upid'])) {
  11.                                         $upid = $_G['cache']['portalcategory'][$upid]['upid'];
  12.                                         $cat['ups'][$upid] = $_G['cache']['portalcategory'][$upid];
  13.                                 } else {
  14.                                         $upid = 0;
  15.                                 }
  16.                         }
  17.                 } elseif($value['upid'] == $cat['catid']) {
  18.                         $cat['subs'][$value['catid']] = $value;
  19.                 } elseif($value['upid'] == $cat['upid']) {
  20.                         $cat['others'][$value['catid']] = $value;
  21.                 }
  22.         }
  23.         if(!empty($cat['ups'])) $cat['ups'] = array_reverse($cat['ups'], TRUE);
  24.         return $cat;
  25. }
復制代碼
替換為
  1. function category_remake($catid) {
  2.         global $_G;

  3.         $cat = $_G['cache']['portalcategory'][$catid];
  4.         if(empty($cat)) return array();
  5.         require_once libfile('function/portalcp');
  6.         $categoryperm = getallowcategory($_G['uid']);
  7.         foreach ($_G['cache']['portalcategory'] as $value) {
  8.                 if($value['catid'] == $cat['upid']) {
  9.                         $cat['ups'][$value['catid']] = $value;
  10.                         $upid = $value['catid'];
  11.                         while(!empty($upid)) {
  12.                                 if(!empty($_G['cache']['portalcategory'][$upid]['upid'])) {
  13.                                         $upid = $_G['cache']['portalcategory'][$upid]['upid'];
  14.                                         $cat['ups'][$upid] = $_G['cache']['portalcategory'][$upid];
  15.                                 } else {
  16.                                         $upid = 0;
  17.                                 }
  18.                         }
  19.                 } elseif($value['upid'] == $cat['catid']) {
  20.                         $cat['subs'][$value['catid']] = $value;
  21.                 } elseif($value['upid'] == $cat['upid']) {
  22.                         if (!$value['closed'] || $_G['group']['allowdiy'] || $categoryperm[$value['catid']]['allowmanage']) {
  23.                                 $cat['others'][$value['catid']] = $value;
  24.                         }
  25.                 }
  26.         }
  27.         if(!empty($cat['ups'])) $cat['ups'] = array_reverse($cat['ups'], TRUE);
  28.         return $cat;
  29. }
復制代碼
修改后,沒權限的用戶,不會顯示未啟用的分類

謝謝了,我去改下 
發表于 2022-12-6 16:06
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

  • 關注公眾號
  • 有償服務微信
  • 有償服務QQ

手機版|小黑屋|Discuz! 官方交流社區 ( 皖ICP備16010102號 |皖公網安備34010302002376號 )|網站地圖|star

GMT+8, 2026-5-31 05:36 , Processed in 0.051573 second(s), 15 queries , Redis On.

Powered by Discuz! X5.0 Licensed

© 2001-2026 Discuz! Team.

關燈 在本版發帖
有償服務QQ
有償服務微信
返回頂部
快速回復 返回頂部 返回列表