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

Discuz! 官方交流社區(qū)

標(biāo)題: X3.5的默認(rèn)門戶模板有個(gè)小BUG [打印本頁(yè)]

作者: 達(dá)雅    時(shí)間: 2022-12-6 15:28
標(biāo)題: X3.5的默認(rèn)門戶模板有個(gè)小BUG
未啟用生效的門戶分類會(huì)在任意門戶欄目中右側(cè)相關(guān)分類里顯示,無(wú)法隱藏,這個(gè)需要怎么改才能去掉不顯示呢

作者: 1314學(xué)習(xí)網(wǎng)    時(shí)間: 2022-12-6 15:51
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ù)制代碼
修改后,沒(méi)權(quán)限的用戶,不會(huì)顯示未啟用的分類






歡迎光臨 Discuz! 官方交流社區(qū) (http://m.sdtechgong.com.cn/) Powered by Discuz! X5.0