mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 06:13:58 -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'),
|
||||
'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) : '{}',
|
||||
|
|
|
@ -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],
|
||||
|
|
|
@ -48,6 +48,10 @@
|
|||
|
||||
<!-- 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 -->
|
||||
<div class="category">
|
||||
<h3 class="cat_title"><a href="{c.U_VIEWCAT}">{c.CAT_TITLE}</a></h3>
|
||||
|
|
|
@ -344,7 +344,7 @@ function OpenInEditor ($file, $line)
|
|||
<strong><a href="{U_REPORT_LIST}" class="mainmenu">{REPORT_LIST} · </a></strong>
|
||||
<!-- END switch_report_list_new -->
|
||||
</td>
|
||||
|
||||
|
||||
<td style="padding: 2px;">
|
||||
<div>
|
||||
<form id="quick-search" action="" method="post" onsubmit="
|
||||
|
@ -403,13 +403,13 @@ function OpenInEditor ($file, $line)
|
|||
<table width="100%" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td class="tCenter pad_2">
|
||||
<a href="{U_REGISTER}" id="register_link"><b>{L_REGISTER}</b></a> ·
|
||||
<a href="{U_REGISTER}" id="register_link"><b>{L_REGISTER}</b></a> ·
|
||||
<form action="{S_LOGIN_ACTION}" method="post">
|
||||
{L_USERNAME}: <input type="text" name="login_username" size="12" tabindex="1" accesskey="l" />
|
||||
{L_PASSWORD}: <input type="password" name="login_password" size="12" tabindex="2" />
|
||||
<label title="{L_AUTO_LOGIN}"><input type="checkbox" name="autologin" value="1" tabindex="3" />{L_REMEMBER}</label>
|
||||
<input type="submit" name="login" value="{L_LOGIN}" tabindex="4" />
|
||||
</form> ·
|
||||
</form> ·
|
||||
<a href="{U_SEND_PASSWORD}">{L_FORGOTTEN_PASSWORD}</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -487,6 +487,35 @@ function go_to_page ()
|
|||
</label>
|
||||
</div>
|
||||
</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>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue