mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 14:23:57 -07:00
r211
скрытие категорий git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@211 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
ed967afc95
commit
3b372cda91
4 changed files with 56 additions and 3 deletions
|
@ -170,6 +170,7 @@ $template->assign_vars(array(
|
||||||
'IN_ADMIN' => defined('IN_ADMIN'),
|
'IN_ADMIN' => defined('IN_ADMIN'),
|
||||||
'QUIRKS_MODE' => !empty($page_cfg['quirks_mode']),
|
'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)),
|
'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']),
|
'INCLUDE_BBCODE_JS' => !empty($page_cfg['include_bbcode_js']),
|
||||||
'USER_OPTIONS_JS' => ($logged_in) ? bb_json_encode($user->opt_js) : '{}',
|
'USER_OPTIONS_JS' => ($logged_in) ? bb_json_encode($user->opt_js) : '{}',
|
||||||
|
|
|
@ -37,6 +37,10 @@ $req_page .= ($viewcat) ? "_c{$viewcat}" : '';
|
||||||
define('REQUESTED_PAGE', $req_page);
|
define('REQUESTED_PAGE', $req_page);
|
||||||
caching_output(IS_GUEST, 'send', REQUESTED_PAGE .'_guest');
|
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
|
// Topics read tracks
|
||||||
$tracking_topics = get_tracks('topic');
|
$tracking_topics = get_tracks('topic');
|
||||||
$tracking_forums = get_tracks('forum');
|
$tracking_forums = get_tracks('forum');
|
||||||
|
@ -226,6 +230,21 @@ $template->assign_vars(array(
|
||||||
// Build index page
|
// Build index page
|
||||||
foreach ($cat_forums as $cid => $c)
|
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(
|
$template->assign_block_vars('c', array(
|
||||||
'CAT_ID' => $cid,
|
'CAT_ID' => $cid,
|
||||||
'CAT_TITLE' => $cat_title_html[$cid],
|
'CAT_TITLE' => $cat_title_html[$cid],
|
||||||
|
|
|
@ -48,6 +48,10 @@
|
||||||
|
|
||||||
<!-- IF SHOW_FORUMS -->
|
<!-- IF SHOW_FORUMS -->
|
||||||
|
|
||||||
|
<!-- IF H_C_AL_MESS -->
|
||||||
|
<div class="row1 med tCenter mrg_2 pad_4 border bw_TRBL">Часть категорий скрыта "опциями показа" <span class="small">(<a class="small" href="index.php?sh=1">Показать все</a>)</span></div>
|
||||||
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<!-- BEGIN c -->
|
<!-- BEGIN c -->
|
||||||
<div class="category">
|
<div class="category">
|
||||||
<h3 class="cat_title"><a href="{c.U_VIEWCAT}">{c.CAT_TITLE}</a></h3>
|
<h3 class="cat_title"><a href="{c.U_VIEWCAT}">{c.CAT_TITLE}</a></h3>
|
||||||
|
|
|
@ -487,6 +487,35 @@ function go_to_page ()
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
<!-- IF USER_HIDE_CAT -->
|
||||||
|
<fieldset id="user_hide_cat">
|
||||||
|
<legend>Скрыть категории</legend>
|
||||||
|
<div id="h-cat-ctl" class="pad_4 nowrap">
|
||||||
|
<form autocomplete="off">
|
||||||
|
<!-- BEGIN h_c -->
|
||||||
|
<label><input class="h-cat-cbx" type="checkbox" value="{h_c.H_C_ID}" {h_c.H_C_CHEKED} />{h_c.H_C_TITLE}</label>
|
||||||
|
<!-- END h_c -->
|
||||||
|
</form>
|
||||||
|
<div class="spacer_6"></div>
|
||||||
|
<div class="tCenter">
|
||||||
|
<!-- IF H_C_AL_MESS -->
|
||||||
|
<input style="width: 100px;" type="button" onclick="$('input.h-cat-cbx').attr('checked',false); $('input#sec_h_cat').click(); return false;" value="Сбросить">
|
||||||
|
<!-- ENDIF -->
|
||||||
|
<input id="sec_h_cat" type="button" onclick="set_h_cat();" style="width: 100px;" value="Отправить">
|
||||||
|
<script type="text/javascript">
|
||||||
|
function set_h_cat ()
|
||||||
|
{
|
||||||
|
h_cats = [];
|
||||||
|
$.each($('input.h-cat-cbx:checked'), function(i,el){
|
||||||
|
h_cats.push( $(this).val() );
|
||||||
|
});
|
||||||
|
user.set('h_cat', h_cats.join('-'), 365, true);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
<!-- ENDIF -->
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue