男的舔女的下面视频在线播放-少妇愉情理仑片高潮日本-久久久久久国产一区二区三区-麻豆精品一区二区综合-国产精品超碰在线观看-网红极品女神精品视频在线-国产亚洲综合777-高清性视频一区二区播放-中文字幕第一页亚洲天堂

返回列表 發(fā)帖
查看: 3013|回復(fù): 2

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

55

主題

147

回帖

3

粉絲

爐火純青

貢獻
1 點
金幣
10 個
樓主
發(fā)表于 2022-12-6 15:28:51 |浙江| 只看樓主 |倒序瀏覽 |閱讀模式
未啟用生效的門戶分類會在任意門戶欄目中右側(cè)相關(guān)分類里顯示,無法隱藏,這個需要怎么改才能去掉不顯示呢
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. }
復(fù)制代碼
替換為
  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. }
復(fù)制代碼
修改后,沒權(quán)限的用戶,不會顯示未啟用的分類

回復(fù)

使用道具 舉報

17

主題

588

回帖

4

粉絲

應(yīng)用開發(fā)者

貢獻
67 點
金幣
902 個
QQ
沙發(fā)
發(fā)表于 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. }
復(fù)制代碼
替換為
  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. }
復(fù)制代碼
修改后,沒權(quán)限的用戶,不會顯示未啟用的分類

謝謝了,我去改下 
發(fā)表于 2022-12-6 16:06
回復(fù)

使用道具 舉報

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

本版積分規(guī)則

  • 關(guān)注公眾號
  • 有償服務(wù)微信
  • 有償服務(wù)QQ

手機版|小黑屋|Discuz! 官方交流社區(qū) ( 皖I(lǐng)CP備16010102號 |皖公網(wǎng)安備34010302002376號 )|網(wǎng)站地圖|star

GMT+8, 2026-4-18 00:09 , Processed in 0.059728 second(s), 15 queries , Redis On.

Powered by Discuz! X5.0 Licensed

© 2001-2026 Discuz! Team.

關(guān)燈 在本版發(fā)帖
有償服務(wù)QQ
有償服務(wù)微信
返回頂部
快速回復(fù) 返回頂部 返回列表