/**
 * Displays the edit user form.
 *
 * @since  1.0.0
 * @access public
 * @return void
 */
function mb_user_edit_form()
{
    mb_get_template_part('form-user', 'edit');
}
    ?>

<?php 
} elseif (mb_is_topic_edit()) {
    // If viewing the topic edit page.
    ?>

	<?php 
    mb_get_template_part('form-topic', 'edit');
    ?>

<?php 
} elseif (mb_is_reply_edit()) {
    // If viewing the reply edit page.
    ?>

	<?php 
    mb_get_template_part('form-reply', 'edit');
    ?>

<?php 
} elseif (mb_is_user_edit()) {
    // If viewing the user edit page.
    ?>

	<?php 
    mb_get_template_part('form-user', 'edit');
    ?>

<?php 
}
<?php

/**
 * This template part outputs the forum archive content.  The forum archive is the board home page if 
 * the plugin is set to show forums on front (default).
 *
 * Theme authors can overwrite this template by placing a `/board/content-archive-forum.php` template 
 * in their theme folder.
 */
?>

<header class="mb-page-header">
	<h1 class="mb-page-title"><?php 
the_archive_title();
?>
</h1>
</header><!-- .mb-page-header -->

<?php 
/**
 Loads the `loop-forum-hierarchical.php` template part if the forum archive should be hierarchical. 
 Otherwise, it uses the `loop-forum-flat.php` template part.  Falls back to the `loop-forum.php` 
 template part.
*/
mb_get_template_part('loop-forum', mb_show_hierarchical_forums() ? 'hierarchical' : 'flat');
?>

<?php 
/* Loads the `form-forum-new.php` template part.  Falls back to the `form-forum.php` template part. */
mb_get_template_part('form-forum', 'new');
<?php

/**
 * This template part outputs the search form page.
 */
?>

<header class="mb-page-header">
	<h1 class="mb-page-title"><?php 
mb_search_page_title();
?>
</h1>
</header><!-- .mb-page-header -->

<?php 
/* Loads the `form-search-advanced.php` template part. */
mb_get_template_part('form-search', 'advanced');
	<ol id="mb-thread" class="mb-thread">

		<?php 
    if (mb_reply_query()) {
        ?>

			<?php 
        while (mb_reply_query()) {
            ?>

				<?php 
            mb_the_reply();
            ?>

				<?php 
            mb_get_template_part('thread', 'reply');
            ?>

			<?php 
        }
        ?>

		<?php 
    }
    ?>

	</ol><!-- #thread -->

<?php 
}
<?php

/**
 * This template part outputs the single role content.
 */
?>

<header class="mb-page-header">
	<h1 class="mb-page-title"><?php 
mb_single_role_title();
?>
</h1>
</header><!-- .mb-page-header -->

<?php 
/* Loads the `loop-user.php` template part.  Falls back to the `loop.php` template part. */
mb_get_template_part('loop', 'user');
<?php 
if (current_user_can('read_forum', mb_get_forum_id())) {
    // Check if the current user can read the forum.
    ?>

	<?php 
    mb_get_template_part('loop-forum', mb_show_hierarchical_forums() ? 'hierarchical' : 'flat');
    ?>

	<?php 
    if (mb_forum_type_allows_topics(mb_get_forum_type())) {
        // Only show topics if they're allowed.
        ?>

		<?php 
        mb_get_template_part('loop', 'topic');
        ?>

	<?php 
    }
    // End show topics check.
    ?>

<?php 
}
// End check to see if user can read forum.
?>

<?php 
mb_get_template_part('form-topic', 'new');
<?php

/**
 * This template part outputs the role archive content.
 */
?>

<header class="mb-page-header">
	<h1 class="mb-page-title"><?php 
the_archive_title();
?>
</h1>
</header><!-- .mb-page-header -->

<?php 
/* Loads the `loop-role.php` template part.  Falls back to the `loop.php` template part. */
mb_get_template_part('loop', 'role');
<?php

/**
 * This template part outputs the reply archive content (latest replies).
 */
?>

<header class="mb-page-header">
	<h1 class="mb-page-title"><?php 
the_archive_title();
?>
</h1>
</header><!-- .mb-page-header -->

<?php 
/* Loads the `loop-reply.php` template part.  Falls back to the `loop.php` template part. */
mb_get_template_part('loop', 'reply');
?>

<?php 
/* Loads the `form-reply-new.php` template part.  Falls back to the `form-reply.php` template part. */
mb_get_template_part('form-reply', 'new');
    ?>

<?php 
} elseif (mb_is_user_page(array('topics', 'topic-subscriptions', 'bookmarks'))) {
    ?>

	<?php 
    mb_get_template_part('loop-topic');
    ?>

<?php 
} elseif (mb_is_user_page('replies')) {
    ?>

	<?php 
    mb_get_template_part('loop-reply');
    ?>

<?php 
} else {
    ?>

	<?php 
    echo get_avatar(mb_get_user_id());
    ?>

	<div class="mb-user-info">

		<ul>
			<li><?php 
    printf(__('Forum role: %s', 'message-board'), mb_get_role_link(mb_get_user_role()));
<?php

/**
 * This template part outputs the search results content.
 */
?>

<?php 
/* Loads the `form-search-basic.php` template part. */
mb_get_template_part('form-search', 'basic');
?>

<?php 
/* Loads the `loop-search.php` template part.  Falls back to the `loop.php` template part. */
mb_get_template_part('loop', 'search');
/**
 * Displays the edit forum form.
 *
 * @since  1.0.0
 * @access public
 * @return void
 */
function mb_forum_edit_form()
{
    mb_get_template_part('form-forum', 'edit');
}
/**
 * Displays the edit topic form.
 *
 * @since  1.0.0
 * @access public
 * @return void
 */
function mb_topic_edit_form()
{
    mb_get_template_part('form-topic', 'edit');
}