diff --git a/upload/includes/page_header.php b/upload/includes/page_header.php index 4041220d3..3e2974949 100644 --- a/upload/includes/page_header.php +++ b/upload/includes/page_header.php @@ -170,6 +170,7 @@ $template->assign_vars(array( 'IN_ADMIN' => defined('IN_ADMIN'), 'QUIRKS_MODE' => !empty($page_cfg['quirks_mode']), 'SHOW_ADS' => (!$logged_in || isset($bb_cfg['show_ads_users'][$user->id]) || (!($is_admin || $is_mod) && $user->show_ads)), + 'USER_HIDE_CAT' => (BB_SCRIPT == 'index'), 'INCLUDE_BBCODE_JS' => !empty($page_cfg['include_bbcode_js']), 'USER_OPTIONS_JS' => ($logged_in) ? bb_json_encode($user->opt_js) : '{}', diff --git a/upload/index.php b/upload/index.php index 2703ed196..a59db7ce1 100644 --- a/upload/index.php +++ b/upload/index.php @@ -37,6 +37,10 @@ $req_page .= ($viewcat) ? "_c{$viewcat}" : ''; define('REQUESTED_PAGE', $req_page); caching_output(IS_GUEST, 'send', REQUESTED_PAGE .'_guest'); +$hide_cat_opt = isset($user->opt_js['h_cat']) ? (string) $user->opt_js['h_cat'] : 0; +$hide_cat_user = array_flip(explode('-', $hide_cat_opt)); +$showhide = isset($_GET['sh']) ? (int) $_GET['sh'] : 0; + // Topics read tracks $tracking_topics = get_tracks('topic'); $tracking_forums = get_tracks('forum'); @@ -226,6 +230,21 @@ $template->assign_vars(array( // Build index page foreach ($cat_forums as $cid => $c) { + $template->assign_block_vars('h_c', array( + 'H_C_ID' => $cid, + 'H_C_TITLE' => $cat_title_html[$cid], + 'H_C_CHEKED' => in_array($cid, preg_split("/[-]+/", $hide_cat_opt)) ? 'checked' : '', + )); + + $template->assign_vars(array( + 'H_C_AL_MESS' => ($hide_cat_opt && !$showhide) ? true : false + )); + + if (!$showhide && isset($hide_cat_user[$cid])) + { + continue; + } + $template->assign_block_vars('c', array( 'CAT_ID' => $cid, 'CAT_TITLE' => $cat_title_html[$cid], diff --git a/upload/templates/default/index.tpl b/upload/templates/default/index.tpl index 26d7b63b1..c251e1d90 100644 --- a/upload/templates/default/index.tpl +++ b/upload/templates/default/index.tpl @@ -48,6 +48,10 @@ + +
Часть категорий скрыта "опциями показа" (Показать все)
+ +

{c.CAT_TITLE}

diff --git a/upload/templates/default/page_header.tpl b/upload/templates/default/page_header.tpl index d1b4d7069..523b81546 100644 --- a/upload/templates/default/page_header.tpl +++ b/upload/templates/default/page_header.tpl @@ -344,7 +344,7 @@ function OpenInEditor ($file, $line) {REPORT_LIST} · - +
· + · {L_FORGOTTEN_PASSWORD} @@ -487,6 +487,35 @@ function go_to_page ()
+ +
+ Скрыть категории +
+
+ + + +
+
+
+ + + + + +
+
+
+