// error notice
if (isset($_GET['unsubscribe_errors'])) {
    echo sprintf('<p><div class="error">%s</div></p>', urldecode(strip_tags($_GET['unsubscribe_errors'])));
}
?>

	<div id="poststuff">
		<div class="minhightwidhtauto">					
			<div class="postbox mgm_profile_subscription_info" >
				<h3><b><?php 
_e('Subscription Information', 'mgm');
?>
</b></h3>
				<div class="inside">
					<?php 
echo mgm_user_subscription_info();
?>

				</div>
			</div>			
			<div class="postbox mgm_profile_membership_info">
				<h3><b><?php 
_e('Membership Information', 'mgm');
?>
</b></h3>
				<div class="inside">
				<?php 
echo mgm_user_membership_info();
?>
	
				</div>
function mgm_membership_details($user_id = NULL)
{
    $css_group = mgm_get_css_group();
    // get
    if ($user_id) {
        $user = get_userdata($user_id);
    }
    // get current user
    if (!isset($user->ID)) {
        $user = wp_get_current_user();
    }
    // return when no user
    if (!$user->ID) {
        return sprintf(__('You need to <a href="%s">login</a> to see that Page'), mgm_get_custom_url('login'));
        // return mgm_redirect(mgm_get_custom_url('login'), NULL, 'javascript', true);
    }
    // init
    $html = '';
    //issue #867
    if ($css_group != 'none') {
        //expand this if needed
        $css_link_format = '<link rel="stylesheet" href="%s" type="text/css" media="all" />';
        $css_file = MGM_ASSETS_URL . 'css/' . $css_group . '/mgm.pages.css';
        $html .= sprintf($css_link_format, $css_file);
    }
    // error
    if (isset($_GET['unsubscribe_errors']) && !empty($_GET['unsubscribe_errors'])) {
        $errors = new WP_Error();
        $errors->add('unsubscribe_errors', urldecode(strip_tags($_GET['unsubscribe_errors'])), isset($_GET['unsubscribed']) ? 'message' : 'error');
        $html .= mgm_set_errors($errors, true);
        unset($errors);
    }
    // subscription_info
    if ($subinfo_html = mgm_user_subscription_info($user_id)) {
        $html .= sprintf('<h3>%s</h3><p>%s</p>', __('Subscription Information', 'mgm'), $subinfo_html);
    }
    // membership_info
    if ($membinfo_html = mgm_user_membership_info($user_id)) {
        $html .= sprintf('<h3>%s</h3><p>%s</p>', __('Membership Information', 'mgm'), $membinfo_html);
    }
    // other subscriptions
    if ($oth_subinfo_html = mgm_user_other_subscriptions_info()) {
        $html .= $oth_subinfo_html;
    }
    //issue #1635
    $membership_details_html = '<div class="mgm_membership_details_container">' . $html . '</div>';
    // return
    return $membership_details_html;
}