Exemplo n.º 1
0
 function do_subscriptiondetails_shortcode($atts, $content = null, $code = "")
 {
     global $wp_query;
     $defaults = array("holder" => '', "holderclass" => '', "item" => '', "itemclass" => '', "postfix" => '', "prefix" => '', "wrapwith" => '', "wrapwithclass" => '', "subscription" => '');
     extract(shortcode_atts($defaults, $atts));
     if (empty($subscription)) {
         return '';
     }
     $html = '';
     if (!empty($holder)) {
         $html .= "<{$holder} class='{$holderclass}'>";
     }
     if (!empty($item)) {
         $html .= "<{$item} class='{$itemclass}'>";
     }
     $html .= $prefix;
     // The title
     if (!empty($wrapwith)) {
         $html .= "<{$wrapwith} class='{$wrapwithclass}'>";
     }
     $sub = new M_Subscription((int) $subscription);
     $html .= stripslashes($sub->sub_description());
     if (!empty($wrapwith)) {
         $html .= "</{$wrapwith}>";
     }
     $html .= $postfix;
     if (!empty($item)) {
         $html .= "</{$item}>";
     }
     if (!empty($holder)) {
         $html .= "</{$holder}>";
     }
     return $html;
 }
        function handle_profile_member_page()
        {
            ?>
			<div class='wrap'>
				<div class="icon32" id="icon-users"><br></div>
				<h2><?php 
            _e('Membership details', 'membership');
            ?>
</h2>

				<?php 
            if (isset($_GET['msg'])) {
                echo '<div id="message" class="updated fade"><p>' . $messages[(int) $_GET['msg']] . '</p></div>';
                $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
            }
            if (!current_user_is_member()) {
                // Not a member so show the message and signup forms
                ?>
						<div class='nonmembermessage'>
						<h3><?php 
                _e('Not called yet', 'membership');
                ?>
</h3>
						<?php 
                _e('Not called yet', 'membership');
                ?>
						</div>
						<div class='signups'>
						<h3><?php 
                _e('Select a subscription', 'membership');
                ?>
</h3>
						<p>
							<?php 
                _e('Please select a subscription from the options below.', 'membership');
                ?>
						</p>
						<?php 
                do_action('membership_subscription_form_before_subscriptions', $user_id);
                $subs = $this->get_subscriptions();
                do_action('membership_subscription_form_before_paid_subscriptions', $user_id);
                foreach ((array) $subs as $key => $sub) {
                    $subscription = new M_Subscription($sub->id);
                    ?>
								<div class="subscription">
									<div class="description">
										<h3><?php 
                    echo $subscription->sub_name();
                    ?>
</h3>
										<p><?php 
                    echo $subscription->sub_description();
                    ?>
</p>
									</div>

								<?php 
                    $pricing = $subscription->get_pricingarray();
                    if ($pricing) {
                        ?>
										<div class='priceforms'>
											<?php 
                        do_action('membership_purchase_button', $subscription, $pricing, $user_id);
                        ?>
										</div>
										<?php 
                    }
                    ?>
								</div>
								<?php 
                }
                do_action('membership_subscription_form_after_paid_subscriptions', $user_id);
                do_action('membership_subscription_form_after_subscriptions', $user_id);
                ?>
						</div>
					<?php 
            } else {
                if (current_user_has_subscription()) {
                    // User has a subscription already. Display the details - and an action to enable upgrading / not upgrading to take place.
                    ?>
							<div class='nonmembermessage'>
							<h3><?php 
                    _e('Not called yet', 'membership');
                    ?>
</h3>
							<?php 
                    _e('Not called yet', 'membership');
                    ?>
							</div>
						<?php 
                }
            }
            ?>
			</div> <!-- wrap -->
			<?php 
        }
Exemplo n.º 3
0
do_action('membership_subscription_form_before_subscriptions');
$subs = $this->get_subscriptions();
$subs = apply_filters('membership_override_subscriptions', $subs);
foreach ((array) $subs as $key => $sub) {
    $subscription = new M_Subscription($sub->id);
    ?>
				<div class="pricebox subscriptionbox" id='subscriptionbox-<?php 
    echo $subscription->id;
    ?>
'>
					<div class="topbar"><span class='title'><?php 
    echo $subscription->sub_name();
    ?>
</span></div>
					<div class="pricedetails"><?php 
    echo $subscription->sub_description();
    ?>
</div>
					<div class="bottombar"><span class='price'><?php 
    echo $subscription->sub_pricetext();
    ?>
</span>
					<?php 
    $pricing = $subscription->get_pricingarray();
    if ($pricing) {
        ?>
							<span class='link'>
								<?php 
        if (isset($M_options['formtype']) && $M_options['formtype'] == 'new') {
            // pop up form
            $link = admin_url('admin-ajax.php');