<li class="selected" id="papers-all"><a href="<?php 
echo esc_url(get_post_type_archive_link('cacsp_paper'));
?>
"><?php 
printf(__('All Papers <span>%s</span>', 'social-paper'), $GLOBALS['wp_query']->found_posts);
?>
</a></li>

				<?php 
if (is_user_logged_in()) {
    ?>
					<li id="papers-personal"><a href="<?php 
    echo bp_loggedin_user_domain() . 'papers/';
    ?>
"><?php 
    printf(__('My Papers <span>%s</span>', 'social-paper'), cacsp_get_total_paper_count_for_user(bp_loggedin_user_id(), true));
    ?>
</a></li>
				<?php 
}
?>

				<?php 
/**
 * Fires inside the papers directory tab.
 */
do_action('bp_papers_directory_tabs');
?>

				<?php 
if (is_user_logged_in()) {
/**
 * Output the total paper count for a specified user.
 *
 * @param int $user_id The numeric ID of the user
 */
function cacsp_total_paper_count_for_user($user_id = 0, $include_drafts = false)
{
    echo cacsp_get_total_paper_count_for_user($user_id, $include_drafts);
}