Работает на версии phpBBex 1.4.0.
Инструкция по установке.
В phpmyadmin выполнить
- Код: Выделить всё
ALTER TABLE phpbb_forums ADD default_display tinyint(1) NOT NULL DEFAULT 1;
adm/style/acp_forums.html после
- Код: Выделить всё
<label><input type="radio" class="radio" name="display_active" value="0"<!-- IF not S_DISPLAY_ACTIVE_TOPICS --> id="display_active" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
- Код: Выделить всё
<dl>
<dt><label for="forum_style">{L_DEFAULT_DISPLAY}:</label><br /><span>{L_DEFAULT_DISPLAY_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="default_display" value="1"<!-- IF S_DEFAULT_DISPLAY --> id="default_display" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="default_display" value="0"<!-- IF not S_DEFAULT_DISPLAY --> id="default_display" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
includes/acp/acp_forums.php после
- Код: Выделить всё
'forum_password_unset' => request_var('forum_password_unset', false),
- Код: Выделить всё
'default_display' => request_var('default_display', true),
- Код: Выделить всё
'forum_password_confirm'=> '',
- Код: Выделить всё
'default_display' => true,
- Код: Выделить всё
'S_CAN_COPY_PERMISSIONS' => ($action != 'edit' || empty($forum_id) || ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth'))) ? true : false,
- Код: Выделить всё
'S_DEFAULT_DISPLAY' => ($forum_data['default_display']) ? true : false,
includes/functions_display.php после
- Код: Выделить всё
// Empty category
if ($row['parent_id'] == $root_data['forum_id'] && $row['forum_type'] == FORUM_CAT)
{
- Код: Выделить всё
$cat_aff_stat = request_var($config['cookie_name'].'_cat_'.$row['forum_id'].'_aff_stat', intval($row['default_display']),false,true);
- Код: Выделить всё
'S_IS_CAT' => true,
- Код: Выделить всё
'DISPLAY_CAT' => ($cat_aff_stat) ? 'block' : 'none',
'DISPLAY_CAT_LINK' => ($cat_aff_stat) ? '<a href="javascriptshow_details(\'cat_'.$row['forum_id'].'\');" title="'.$user->lang['EXPAND_CAT_HIDE'].'">-</a>' : '<a href="javascriptshow_details(\'cat_'.$row['forum_id'].'\');" title="'.$user->lang['EXPAND_CAT_DISPLAY'].'">+</a>',
index.php после
- Код: Выделить всё
'TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts),
- Код: Выделить всё
'COOKIE_NAME' => $config['cookie_name'],
language/ru/acp/forums.php перед
- Код: Выделить всё
));
?>
- Код: Выделить всё
'DEFAULT_DISPLAY' => 'Expand this category by default',
'DEFAULT_DISPLAY_EXPLAIN' => 'Expand categories MOD\'s configuration',
language/ru/common.php перед
- Код: Выделить всё
?>
- Код: Выделить всё
$lang = array_merge($lang, array(
'EXPAND_CAT_DISPLAY' => 'Expand this category',
'EXPAND_CAT_HIDE' => 'Hide this category',
));
styles/prosilver/template/forumlist_body.html перед
- Код: Выделить всё
<!-- BEGIN forumrow -->
- Код: Выделить всё
<script type="text/javascript">
function show_details(id)
{
if(document.getElementById(id).style.display == 'none')
{
//Display
document.getElementById(id).style.display = 'block';
//Change link
document.getElementById('phpbb_'+id).innerHTML = '<a href="javascriptshow_details(\''+id+'\');" title="{L_EXPAND_CAT_HIDE}">-</a>';
//Delete cookie
document.cookie = '{COOKIE_NAME}_'+id+'_aff_stat=1;';
}
else
{
//Don't display
document.getElementById(id).style.display = 'none';
//Change link
document.getElementById('phpbb_'+id).innerHTML = '<a href="javascriptshow_details(\''+id+'\');" title="{L_EXPAND_CAT_DISPLAY}">+</a>';
//Create cookie
document.cookie = '{COOKIE_NAME}_'+id+'_aff_stat=0;';
}
}
</script>
- Код: Выделить всё
<!-- BEGIN forumrow -->
<!-- IF (forumrow.S_IS_CAT and not forumrow.S_FIRST_ROW) or forumrow.S_NO_CAT -->
</ul>
- Код: Выделить всё
</div>
- Код: Выделить всё
<dt><!-- IF forumrow.S_IS_CAT --><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a><!-- ELSE -->{L_FORUM}<!-- ENDIF --></dt>
- Код: Выделить всё
<dt><!-- IF forumrow.S_IS_CAT --><span id="phpbb_cat_{forumrow.FORUM_ID}" style="font-size:18px;margin-right:8px;">{forumrow.DISPLAY_CAT_LINK}</span><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a><!-- ELSE -->{L_FORUM}<!-- ENDIF --></dt>
- Код: Выделить всё
<ul class="topiclist forums">
- Код: Выделить всё
<div id="cat_{forumrow.FORUM_ID}" style="display:{forumrow.DISPLAY_CAT};">
- Код: Выделить всё
<!-- IF forumrow.S_LAST_ROW -->
</ul>
- Код: Выделить всё
</div>