mirror of
https://github.com/moparisthebest/moparscape.org-smf
synced 2024-12-22 07:08:48 -05:00
Implement archived boards, via categories hidden by default
This commit is contained in:
parent
f808070271
commit
90d2036d2c
@ -30,7 +30,15 @@ if (!defined('SMF'))
|
|||||||
function getBoardIndex($boardIndexOptions)
|
function getBoardIndex($boardIndexOptions)
|
||||||
{
|
{
|
||||||
global $smcFunc, $scripturl, $user_info, $modSettings, $txt;
|
global $smcFunc, $scripturl, $user_info, $modSettings, $txt;
|
||||||
global $settings, $context;
|
global $settings, $context, $show_archived;
|
||||||
|
|
||||||
|
//xxx show archived boards
|
||||||
|
if($boardIndexOptions['include_categories']){
|
||||||
|
if(isset($_GET['show_archived']))
|
||||||
|
$_SESSION['show_archived'] = $_GET['show_archived'] == 0 ? 0 : 1;
|
||||||
|
$show_archived = !empty($user_info['possibly_robot']) || (isset($_SESSION['show_archived']) && $_SESSION['show_archived'] == 1);
|
||||||
|
}
|
||||||
|
//xxx end show archived boards
|
||||||
|
|
||||||
// For performance, track the latest post while going through the boards.
|
// For performance, track the latest post while going through the boards.
|
||||||
if (!empty($boardIndexOptions['set_latest_post']))
|
if (!empty($boardIndexOptions['set_latest_post']))
|
||||||
@ -63,7 +71,9 @@ function getBoardIndex($boardIndexOptions)
|
|||||||
LEFT JOIN {db_prefix}members AS mods_mem ON (mods_mem.id_member = mods.id_member)
|
LEFT JOIN {db_prefix}members AS mods_mem ON (mods_mem.id_member = mods.id_member)
|
||||||
WHERE {query_see_board}' . (empty($boardIndexOptions['countChildPosts']) ? (empty($boardIndexOptions['base_level']) ? '' : '
|
WHERE {query_see_board}' . (empty($boardIndexOptions['countChildPosts']) ? (empty($boardIndexOptions['base_level']) ? '' : '
|
||||||
AND b.child_level >= {int:child_level}') : '
|
AND b.child_level >= {int:child_level}') : '
|
||||||
AND b.child_level BETWEEN ' . $boardIndexOptions['base_level'] . ' AND ' . ($boardIndexOptions['base_level'] + 1)),
|
AND b.child_level BETWEEN ' . $boardIndexOptions['base_level'] . ' AND ' . ($boardIndexOptions['base_level'] + 1)) .
|
||||||
|
//xxx show archived boards
|
||||||
|
(isset($show_archived) && !$show_archived ? ' AND c.forumid = 1' : ''),
|
||||||
array(
|
array(
|
||||||
'current_member' => $user_info['id'],
|
'current_member' => $user_info['id'],
|
||||||
'child_level' => $boardIndexOptions['base_level'],
|
'child_level' => $boardIndexOptions['base_level'],
|
||||||
|
@ -3944,7 +3944,7 @@ function loadClassFile($filename)
|
|||||||
|
|
||||||
function setupMenuContext()
|
function setupMenuContext()
|
||||||
{
|
{
|
||||||
global $context, $modSettings, $user_info, $txt, $scripturl;
|
global $context, $modSettings, $user_info, $txt, $scripturl, $show_archived;
|
||||||
|
|
||||||
// Set up the menu privileges.
|
// Set up the menu privileges.
|
||||||
$context['allow_search'] = allowedTo('search_posts');
|
$context['allow_search'] = allowedTo('search_posts');
|
||||||
@ -3969,6 +3969,12 @@ function setupMenuContext()
|
|||||||
),
|
),
|
||||||
'is_last' => $context['right_to_left'],
|
'is_last' => $context['right_to_left'],
|
||||||
),
|
),
|
||||||
|
//xxx show archived boards
|
||||||
|
'show_archived' => array(
|
||||||
|
'title' => ($show_archived ? 'Hide' : 'Show').' Archived Boards',
|
||||||
|
'href' => $scripturl . '?show_archived='.($show_archived ? 0 : 1),
|
||||||
|
'show' => isset($show_archived),
|
||||||
|
),
|
||||||
'help' => array(
|
'help' => array(
|
||||||
'title' => $txt['help'],
|
'title' => $txt['help'],
|
||||||
'href' => $scripturl . '?action=help',
|
'href' => $scripturl . '?action=help',
|
||||||
|
Loading…
Reference in New Issue
Block a user