function addMemberLink($parent, $leg)
 {
     if ($leg == 'right') {
         $leg = 1;
     } else {
         $leg = 0;
     }
     $reg_page_id = wpmlm_get_the_post_id_by_shortcode('[registration]');
     $reg_page_link = '?page_id=' . $reg_page_id . '&k=' . $parent . '&l=' . $leg;
     return $reg_page_link;
 }
    include wpmlm_get_template_file_path('classes/wpmlm-my-dashboard.class.php');
    $objMyDashboard = new MyDashboard($key);
    $userDetail = $objMyDashboard->GetUserInfoById($userId);
    $totalBus = $objMyDashboard->TotalBusiness($userId);
    $myLeftArr = $objMyDashboard->MyTop5LeftLegMember($userId);
    $myRightArr = $objMyDashboard->MyTop5RightLegMember($userId);
    $myPerSalesArr = $objMyDashboard->MyTop5PersonalSales($userId);
    $payoutArr = $objMyDashboard->MyTop5PayoutDetails($userId);
    $myRightTotal = $objMyDashboard->MyRightLegMemberTotal($userId);
    $myLeftTotal = $objMyDashboard->MyLeftLegMemberTotal($userId);
    $myPerSalesTotal = $objMyDashboard->MyPersonalSalesTotal($userId);
    //echo "<pre>";print_r($myLeftArr); exit;
    global $current_user;
    get_currentuserinfo();
    $sponsor_name = $current_user->user_login;
    $reg_page_id = wpmlm_get_the_post_id_by_shortcode('[registration]');
    $affiliateURL = get_permalink($reg_page_id) . '&sp=' . $key;
}
?>
<div class="dashboard">
	<br />
	<p class="affiliate_url"><strong>Affiliate URL :</strong> <?php 
echo $affiliateURL;
?>
 </p>
	<div class="leftSide">
		<div id="personaldetails" class="widgetbox">
			<div class="title"><h3>Personal Details</h3></div>
			<table cellspacing="0" cellpadding="0" border="0" class="stdtable">
				<colgroup>
					<col class="con1" width="30%">
/**
 * Checks and replaces the Page title with the category title if on a category page
 * @access public
 *
 * @since 3.8
 * @param $title (string) The Page Title
 * @param $id (int) The Page ID
 * @return $title (string) the new title
 */
function wpmlm_the_category_title($title = '', $id = '')
{
    global $wp_query;
    $post = get_post($id);
    // If its the category page
    if (wpmlm_is_viewable_taxonomy() && isset($wp_query->posts[0]) && $wp_query->posts[0]->post_title == $post->post_title && $wp_query->is_archive && !is_admin() && isset($wp_query->query_vars['wpmlm_product_category'])) {
        $category = get_term_by('slug', $wp_query->query_vars['wpmlm_product_category'], 'wpmlm_product_category');
        remove_filter('the_title', 'wpmlm_the_category_title');
    }
    // If its the product_tag page
    if (isset($wp_query->query_vars['taxonomy']) && 'product_tag' == $wp_query->query_vars['taxonomy'] && $wp_query->posts[0]->post_title == $post->post_title) {
        $category = get_term_by('slug', $wp_query->query_vars['term'], 'product_tag');
        remove_filter('the_title', 'wpmlm_the_category_title');
    }
    //if this is paginated products_page
    if ($wp_query->in_the_loop && empty($category->name) && isset($wp_query->query_vars['paged']) && $wp_query->query_vars['paged'] && isset($wp_query->query_vars['page']) && $wp_query->query_vars['page'] && 'wpmlm-product' == $wp_query->query_vars['post_type']) {
        $post_id = wpmlm_get_the_post_id_by_shortcode('[productspage]');
        $post = get_post($post_id);
        $title = $post->post_title;
        remove_filter('the_title', 'wpmlm_the_category_title');
    }
    if (!empty($category->name)) {
        return $category->name;
    } else {
        return $title;
    }
}