<?php
/**
 * Single User Content Part
 *
 * @package bbPress
 * @subpackage Theme
 */

// Exit if accessed directly
defined('ABSPATH') || exit;
?>

<div id="bbpress-forums" class="bbpress-wrapper">

    <?php do_action('bbp_template_notices'); ?>

    <?php do_action('bbp_template_before_user_wrapper'); ?>

    <div id="bbp-user-wrapper" class="frmx-row">

        <?php bbp_get_template_part('user', 'details'); ?>

        <div class="frmx-col-md-9">
            <div class="frmx-shadow-lg frmx-p-md-5 frmx-p-3 frmx-mx-3 bbp-user-body">
                <?php if (bbp_is_favorites())
                    bbp_get_template_part('user', 'favorites'); ?>
                <?php if (bbp_is_subscriptions())
                    bbp_get_template_part('user', 'subscriptions'); ?>
                <?php if (bbp_is_single_user_engagements())
                    bbp_get_template_part('user', 'engagements'); ?>
                <?php if (bbp_is_single_user_topics())
                    bbp_get_template_part('user', 'topics-created'); ?>
                <?php if (bbp_is_single_user_replies())
                    bbp_get_template_part('user', 'replies-created'); ?>
                <?php if (bbp_is_single_user_edit())
                    bbp_get_template_part('form', 'user-edit'); ?>
                <?php
                /**
                 * Render badges & gamification tab content.
                 *
                 * When the frmx_tab=badges query parameter is set,
                 * display the gamification section instead of the
                 * default profile content.
                 */
                $frmx_active_tab = isset( $_GET['frmx_tab'] ) ? sanitize_text_field( wp_unslash( $_GET['frmx_tab'] ) ) : '';

                if ( 'badges' === $frmx_active_tab && function_exists( 'frmx_display_user_profile_gamification' ) ) {
                    frmx_display_user_profile_gamification();
                } elseif ( bbp_is_single_user_profile() ) {
                    bbp_get_template_part('user', 'profile');
                }
                ?>
            </div>
        </div>
    </div>

    <?php do_action('bbp_template_after_user_wrapper'); ?>

</div>