</div>

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

	<?php 
wp_idea_stream_users_the_user_nav();
?>

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

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

		<?php 
    wp_idea_stream_template_part('user', 'comments');
    ?>

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

	<?php 
} else {
    ?>

		<?php 
/**
 * Set the document title for IdeaStream pages
 *
 * @since  2.3.0
 *
 * @param  array  $document_title The WordPress Document title
 * @return array                  The IdeaStream Document title
 */
function wp_idea_stream_document_title_parts($document_title = array())
{
    if (!wp_idea_stream_is_ideastream()) {
        return $document_title;
    }
    $new_document_title = $document_title;
    // Reset the document title if needed
    if (!wp_idea_stream_is_single_idea()) {
        $title = (array) wp_idea_stream_title();
        // On user's profile, add some piece of info
        if (wp_idea_stream_is_user_profile() && count($title) === 1) {
            // Seeing comments of the user
            if (wp_idea_stream_is_user_profile_comments()) {
                $title[] = __('Idea Comments', 'wp-idea-stream');
                // Get the pagination page
                if (get_query_var(wp_idea_stream_cpage_rewrite_id())) {
                    $cpage = get_query_var(wp_idea_stream_cpage_rewrite_id());
                } elseif (!empty($_GET[wp_idea_stream_cpage_rewrite_id()])) {
                    $cpage = $_GET[wp_idea_stream_cpage_rewrite_id()];
                }
                if (!empty($cpage)) {
                    $title['page'] = sprintf(__('Page %s', 'wp-idea-stream'), (int) $cpage);
                }
                // Seeing Ratings for the user
            } elseif (wp_idea_stream_is_user_profile_rates()) {
                $title[] = __('Idea Ratings', 'wp-idea-stream');
                // Seeing The root profile
            } else {
                $title[] = __('Ideas', 'wp-idea-stream');
            }
        }
        // Get WordPress Separator
        $sep = apply_filters('document_title_separator', '-');
        $new_document_title['title'] = implode(" {$sep} ", array_filter($title));
    }
    // Set the site name if not already set.
    if (!isset($new_document_title['site'])) {
        $new_document_title['site'] = get_bloginfo('name', 'display');
    }
    // Unset tagline for IdeaStream Pages
    if (isset($new_document_title['tagline'])) {
        unset($new_document_title['tagline']);
    }
    return apply_filters('wp_idea_stream_document_title_parts', $new_document_title, $document_title);
}
/**
 * Builds user's profile nav
 *
 * @package WP Idea Stream
 * @subpackage users/functions
 *
 * @since 2.0.0
 * @since 2.3.0 Added the $nofilter parameter to skip filters
 *
 * @param  int $user_id User id
 * @param  string $user_nicename Optional. User nicename
 * @param  bool $nofilter. Whether to fire filters or not.
 * @uses   wp_idea_stream_users_get_user_profile_url() to get user main profile url
 * @uses   wp_idea_stream_is_user_profile_ideas() to check whether main profile is currently displayed
 * @uses   sanitize_title() to sanitize the nav slug
 * @uses   wp_idea_stream_users_get_user_comments_url() to get user comments profile url
 * @uses   wp_idea_stream_is_user_profile_comments() to check whether comments profile is currently displayed
 * @uses   wp_idea_stream_user_comments_slug() to get user comments slug
 * @uses   wp_idea_stream_is_rating_disabled() to check ratings functionnality is available
 * @uses   wp_idea_stream_users_get_user_rates_url() to get user rates profile url
 * @uses   wp_idea_stream_is_user_profile_rates() to check whether rates profile is currently displayed
 * @uses   wp_idea_stream_user_rates_slug() to get user rates slug
 * @uses   apply_filters() Calls 'wp_idea_stream_users_get_profile_nav_items' to override/add new datas
 * @return array the nav items organized in an associative array
 */
function wp_idea_stream_users_get_profile_nav_items($user_id = 0, $username = '', $nofilter = false)
{
    // Bail if no id or username are provided.
    if (empty($user_id) || empty($username)) {
        return array();
    }
    $nav_items = array('profile' => array('title' => __('Published', 'wp-idea-stream'), 'url' => wp_idea_stream_users_get_user_profile_url($user_id, $username), 'current' => wp_idea_stream_is_user_profile_ideas(), 'slug' => sanitize_title(_x('ideas', 'user ideas profile slug for BuddyPress use', 'wp-idea-stream'))), 'comments' => array('title' => __('Commented', 'wp-idea-stream'), 'url' => wp_idea_stream_users_get_user_comments_url($user_id, $username), 'current' => wp_idea_stream_is_user_profile_comments(), 'slug' => wp_idea_stream_user_comments_slug()));
    if (!wp_idea_stream_is_rating_disabled()) {
        $nav_items['rates'] = array('title' => __('Rated', 'wp-idea-stream'), 'url' => wp_idea_stream_users_get_user_rates_url($user_id, $username), 'current' => wp_idea_stream_is_user_profile_rates(), 'slug' => wp_idea_stream_user_rates_slug());
    }
    if (false === $nofilter) {
        /**
         * Filter the available user's profile nav items
         *
         * @param array  $nav_items     the nav items
         * @param int    $user_id       the user ID
         * @param string $username the username
         */
        return apply_filters('wp_idea_stream_users_get_profile_nav_items', $nav_items, $user_id, $username);
    } else {
        return $nav_items;
    }
}