Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 46 additions & 31 deletions Themes/default/BoardIndex.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,43 @@ function template_boardindex()
</div>
<div id="category_', $category['id'], '_boards" ', (!empty($category['css_class']) ? ('class="' . $category['css_class'] . '"') : ''), $category['is_collapsed'] ? ' style="display: none;"' : '', '>';

/* Each board in each category's boards has:
new (is it new?), id, name, description, moderators (see below), link_moderators (just a list.),
children (see below.), link_children (easier to use.), children_new (are they new?),
topics (# of), posts (# of), link, href, and last_post. (see below.) */
foreach ($category['boards'] as $board) {
echo '
template_bi_board_list($category['boards']);

echo '
</div><!-- #category_[id]_boards -->
</div><!-- .main_container -->';
}

echo '
</div><!-- #boardindex_table -->';

// Show the mark all as read button?
if (!User::$me->is_guest && !empty(Utils::$context['categories'])) {
echo '
<div class="mark_read">
', template_button_strip(Utils::$context['mark_read_button'], 'right'), '
</div>';
}
}

/**
* Outputs a list of boards, each one drawn by the template_bi_* helpers below.
*
* The board index calls this once per category, and the message index calls it
* for the child boards of the board being viewed. Both used to carry their own
* copy of this loop.
*
* Each board has: new (is it new?), id, name, description, moderators (see
* below), link_moderators (just a list.), children (see below.), link_children
* (easier to use.), children_new (are they new?), topics (# of), posts (# of),
* link, href, and last_post. (see below.)
*
* @param array $boards The boards to draw, in the order they go in.
*/
function template_bi_board_list(array $boards): void
{
foreach ($boards as $board) {
echo '
<div id="board_', $board['id'], '" class="up_contain ', (!empty($board['css_class']) ? $board['css_class'] : ''), '">
<div class="board_icon">
', function_exists('template_bi_' . $board['type'] . '_icon') ? call_user_func('template_bi_' . $board['type'] . '_icon', $board) : template_bi_board_icon($board), '
Expand All @@ -96,43 +127,27 @@ function template_boardindex()
', function_exists('template_bi_' . $board['type'] . '_info') ? call_user_func('template_bi_' . $board['type'] . '_info', $board) : template_bi_board_info($board), '
</div><!-- .info -->';

// Show some basic information about the number of posts, etc.
echo '
// Show some basic information about the number of posts, etc.
echo '
<div class="board_stats">
', function_exists('template_bi_' . $board['type'] . '_stats') ? call_user_func('template_bi_' . $board['type'] . '_stats', $board) : template_bi_board_stats($board), '
</div>';

// Show the last post if there is one.
echo'
// Show the last post if there is one.
echo '
<div class="lastpost">
', function_exists('template_bi_' . $board['type'] . '_lastpost') ? call_user_func('template_bi_' . $board['type'] . '_lastpost', $board) : template_bi_board_lastpost($board), '
</div>';

// Won't somebody think of the children!
if (function_exists('template_bi_' . $board['type'] . '_children')) {
call_user_func('template_bi_' . $board['type'] . '_children', $board);
} else {
// Won't somebody think of the children!
if (function_exists('template_bi_' . $board['type'] . '_children')) {
call_user_func('template_bi_' . $board['type'] . '_children', $board);
} else {
template_bi_board_children($board);
}

echo '
</div><!-- #board_[id] -->';
}

echo '
</div><!-- #category_[id]_boards -->
</div><!-- .main_container -->';
}

echo '
</div><!-- #boardindex_table -->';

// Show the mark all as read button?
if (!User::$me->is_guest && !empty(Utils::$context['categories'])) {
echo '
<div class="mark_read">
', template_button_strip(Utils::$context['mark_read_button'], 'right'), '
</div>';
</div><!-- #board_[id] -->';
}
}

Expand Down
33 changes: 1 addition & 32 deletions Themes/default/MessageIndex.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,38 +79,7 @@ function template_main()
<h3 class="catbg">', Lang::getTxt('sub_boards', file: 'General'), '</h3>
</div>';

foreach (Utils::$context['boards'] as $board) {
echo '
<div id="board_', $board['id'], '" class="up_contain ', (!empty($board['css_class']) ? $board['css_class'] : ''), '">
<div class="board_icon">
', function_exists('template_bi_' . $board['type'] . '_icon') ? call_user_func('template_bi_' . $board['type'] . '_icon', $board) : template_bi_board_icon($board), '
</div>
<div class="info">
', function_exists('template_bi_' . $board['type'] . '_info') ? call_user_func('template_bi_' . $board['type'] . '_info', $board) : template_bi_board_info($board), '
</div><!-- .info -->';

// Show some basic information about the number of posts, etc.
echo '
<div class="board_stats">
', function_exists('template_bi_' . $board['type'] . '_stats') ? call_user_func('template_bi_' . $board['type'] . '_stats', $board) : template_bi_board_stats($board), '
</div>';

// Show the last post if there is one.
echo '
<div class="lastpost">
', function_exists('template_bi_' . $board['type'] . '_lastpost') ? call_user_func('template_bi_' . $board['type'] . '_lastpost', $board) : template_bi_board_lastpost($board), '
</div>';

// Won't somebody think of the children!
if (function_exists('template_bi_' . $board['type'] . '_children')) {
call_user_func('template_bi_' . $board['type'] . '_children', $board);
} else {
template_bi_board_children($board);
}

echo '
</div><!-- #board_[id] -->';
}
template_bi_board_list(Utils::$context['boards']);

echo '
</div><!-- #board_[current_board]_childboards -->';
Expand Down