$section = isset($_GET['section']) ? strip_tags($_GET['section']) : 'all';
?>

		
		<?php 
if (in_array($section, array('all', 'accessible'))) {
    ?>

		<div class="postbox margin10px0px">
			<h3><?php 
    echo sprintf(__('Your Membership Level "%s" Accessible Contents', 'mgm'), mgm_stripslashes_deep($data['membership_level']));
    ?>
</h3>
			<div class="inside">
				<?php 
    echo mgm_member_accessible_contents('admin');
    ?>

			</div>
		</div>
		<?php 
}
?>

		
		<?php 
if (in_array($section, array('all', 'purchased'))) {
    ?>

		<div class="postbox margin10px0px">
			<h3><?php 
function mgm_membership_contents()
{
    global $user_ID, $current_user, $post;
    $html = '';
    $css_group = mgm_get_css_group();
    //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);
    }
    if ($user_ID) {
        $section = isset($_GET['section']) ? strip_tags($_GET['section']) : 'all';
        $html .= '<div>';
        //accessible contents
        if (in_array($section, array('all', 'accessible'))) {
            $arr_mtlabel = mgm_get_subscribed_membershiptypes_with_label($user_ID);
            $html .= '<div class="postbox mgm_margin10px0px" >' . '<h3>' . sprintf(__('Your Membership Level "%s" Accessible Contents', 'mgm'), mgm_stripslashes_deep(implode(', ', $arr_mtlabel))) . '</h3>' . '<div class="inside">' . mgm_member_accessible_contents('user') . '</div>' . '</div>';
        }
        //already purchased contents
        if (in_array($section, array('all', 'purchased'))) {
            $html .= '<div class="postbox mgm_margin10px0px">' . '<h3>' . __('Purchased Contents', 'mgm') . '</h3>' . '<div class="inside">' . mgm_member_purchased_contents('user') . '</div></div>';
        }
        //purchasable contents
        if (in_array($section, array('all', 'purchasable'))) {
            $html .= '<div class="postbox mgm_margin10px0px">' . '<h3>' . __('Purchasable Contents', 'mgm') . '</h3>' . '<div class="inside">' . mgm_member_purchasable_contents('user') . '</div>' . '</div>';
        }
        //purchased postpacks
        if (in_array($section, array('all', 'purchased_postpacks'))) {
            $html .= '<div class="postbox mgm_margin10px0px">' . '<h3>' . __('Purchased Post Packs', 'mgm') . '</h3>' . '<div class="inside">' . mgm_member_purchased_postpacks('user') . '</div>' . '</div>';
        }
        //purchasable postpacks
        if (in_array($section, array('all', 'purchasable_postpacks'))) {
            $html .= '<div class="postbox mgm_margin10px0px">' . '<h3>' . __('Purchasable Post Packs', 'mgm') . '</h3>' . '<div class="inside">' . mgm_member_purchasable_postpacks('user') . '</div>' . '</div>';
        }
        $html .= '</div>';
    } else {
        $template = mgm_get_template('private_text_template', array(), 'templates');
        $html = 'You need to be logged in to access this page.';
        $html .= sprintf(__(' Please <a href="%s"><b>login</b> here.</a>', 'mgm'), mgm_get_custom_url('login', false, array('redirect_to' => get_permalink($post->ID))));
        $html = str_replace('[message]', $html, $template);
    }
    $html = apply_filters('mgm_membership_contents_html', $html);
    //issue #1635
    $membership_contents_html = '<div class="mgm_membership_contents_container">' . $html . '</div>';
    // return
    return $membership_contents_html;
}