本文整理汇总了PHP中pmpro_isLevelFree函数的典型用法代码示例。如果您正苦于以下问题:PHP pmpro_isLevelFree函数的具体用法?PHP pmpro_isLevelFree怎么用?PHP pmpro_isLevelFree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pmpro_isLevelFree函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pmpro_getLevelCost
function pmpro_getLevelCost(&$level, $tags = true, $short = false)
{
//initial payment
if (!$short) {
$r = sprintf(__('The price for membership is <strong>%s</strong> now', 'pmpro'), pmpro_formatPrice($level->initial_payment));
} else {
$r = sprintf(__('<strong>%s</strong> now', 'pmpro'), pmpro_formatPrice($level->initial_payment));
}
//recurring part
if ($level->billing_amount != '0.00') {
if ($level->billing_limit > 1) {
if ($level->cycle_number == '1') {
$r .= sprintf(__(' and then <strong>%s per %s for %d more %s</strong>.', 'pmpro'), pmpro_formatPrice($level->billing_amount), pmpro_translate_billing_period($level->cycle_period), $level->billing_limit, pmpro_translate_billing_period($level->cycle_period, $level->billing_limit));
} else {
$r .= sprintf(__(' and then <strong>%s every %d %s for %d more %s</strong>.', 'pmpro'), pmpro_formatPrice($level->billing_amount), $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number), $level->billing_limit, pmpro_translate_billing_period($level->cycle_period, $level->billing_limit));
}
} elseif ($level->billing_limit == 1) {
$r .= sprintf(__(' and then <strong>%s after %d %s</strong>.', 'pmpro'), pmpro_formatPrice($level->billing_amount), $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number));
} else {
if ($level->billing_amount === $level->initial_payment) {
if ($level->cycle_number == '1') {
if (!$short) {
$r = sprintf(__('The price for membership is <strong>%s per %s</strong>.', 'pmpro'), pmpro_formatPrice($level->initial_payment), pmpro_translate_billing_period($level->cycle_period));
} else {
$r = sprintf(__('<strong>%s per %s</strong>.', 'pmpro'), pmpro_formatPrice($level->initial_payment), pmpro_translate_billing_period($level->cycle_period));
}
} else {
if (!$short) {
$r = sprintf(__('The price for membership is <strong>%s every %d %s</strong>.', 'pmpro'), pmpro_formatPrice($level->initial_payment), $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number));
} else {
$r = sprintf(__('<strong>%s every %d %s</strong>.', 'pmpro'), pmpro_formatPrice($level->initial_payment), $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number));
}
}
} else {
if ($level->cycle_number == '1') {
$r .= sprintf(__(' and then <strong>%s per %s</strong>.', 'pmpro'), pmpro_formatPrice($level->billing_amount), pmpro_translate_billing_period($level->cycle_period));
} else {
$r .= sprintf(__(' and then <strong>%s every %d %s</strong>.', 'pmpro'), pmpro_formatPrice($level->billing_amount), $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number));
}
}
}
} else {
$r .= '.';
}
//add a space
$r .= ' ';
//trial part
if ($level->trial_limit) {
if ($level->trial_amount == '0.00') {
if ($level->trial_limit == '1') {
$r .= ' ' . __('After your initial payment, your first payment is Free.', 'pmpro');
} else {
$r .= ' ' . sprintf(__('After your initial payment, your first %d payments are Free.', 'pmpro'), $level->trial_limit);
}
} else {
if ($level->trial_limit == '1') {
$r .= ' ' . sprintf(__('After your initial payment, your first payment will cost %s.', 'pmpro'), pmpro_formatPrice($level->trial_amount));
} else {
$r .= ' ' . sprintf(__('After your initial payment, your first %d payments will cost %s.', 'pmpro'), $level->trial_limit, pmpro_formatPrice($level->trial_amount));
}
}
}
//taxes part
$tax_state = pmpro_getOption("tax_state");
$tax_rate = pmpro_getOption("tax_rate");
if ($tax_state && $tax_rate && !pmpro_isLevelFree($level)) {
$r .= sprintf(__('Customers in %s will be charged %s%% tax.', 'pmpro'), $tax_state, round($tax_rate * 100, 2));
}
if (!$tags) {
$r = strip_tags($r);
}
$r = apply_filters("pmpro_level_cost_text", $r, $level, $tags, $short);
//passing $tags and $short since v2.0
return $r;
}
示例2: do_action
}
}
//no errors yet
if ($pmpro_msgt != "pmpro_error") {
//save user fields for PayPal Express
if ($gateway == "paypalexpress") {
if (!$current_user->ID) {
$_SESSION['pmpro_signup_username'] = $username;
$_SESSION['pmpro_signup_password'] = $password;
$_SESSION['pmpro_signup_email'] = $bemail;
}
//can use this hook to save some other variables to the session
do_action("pmpro_paypalexpress_session_vars");
}
//special check here now for the "check" gateway
if ($pmpro_requirebilling || $gateway == "check" && !pmpro_isLevelFree($pmpro_level)) {
$morder = new MemberOrder();
$morder->membership_id = $pmpro_level->id;
$morder->membership_name = $pmpro_level->name;
$morder->discount_code = $discount_code;
$morder->InitialPayment = $pmpro_level->initial_payment;
$morder->PaymentAmount = $pmpro_level->billing_amount;
$morder->ProfileStartDate = date("Y-m-d") . "T0:0:0";
$morder->BillingPeriod = $pmpro_level->cycle_period;
$morder->BillingFrequency = $pmpro_level->cycle_number;
if ($pmpro_level->billing_limit) {
$morder->TotalBillingCycles = $pmpro_level->billing_limit;
}
if (pmpro_isLevelTrial($pmpro_level)) {
$morder->TrialBillingPeriod = $pmpro_level->cycle_period;
$morder->TrialBillingFrequency = $pmpro_level->cycle_number;
示例3: wpautop
}
else
{
jQuery('#discount_code_message').html(responseHTML);
}
//enable invite button
jQuery('#discount_code_button').removeAttr('disabled');
}
});
}
});
</script>
<?php
if ($gateway == "check" && !pmpro_isLevelFree($pmpro_level)) {
$instructions = pmpro_getOption("instructions");
echo '<div class="pmpro_check_instructions">' . wpautop($instructions) . '</div>';
}
?>
<?php
if ($tospage && !$pmpro_review) {
?>
<table id="pmpro_tos_fields" class="pmpro_checkout top1em" width="100%" cellpadding="0" cellspacing="0" border="0">
<thead>
<tr>
<th><?php
echo $tospage->post_title;
?>
</th>
示例4: pmprosm_pmpro_checkout_boxes
//.........这里部分代码省略.........
if (empty($pmprosm_values['children_hide_password'])) {
?>
<label><?php
echo __("Password", "pmpro_sponsored_members");
?>
</label>
<input type="password" name="add_sub_accounts_password[]" value="" size="20" />
<?php
}
?>
<?php
do_action('pmprosm_children_fields', $i, $seats);
?>
</div>
<?php
}
echo "</div>";
/*
Get the HTML for the empty extra fields and save it to a variable.
*/
ob_start();
do_action("pmprosm_children_fields", false, $seats);
$empty_child_fields = ob_get_contents();
ob_end_clean();
//also clean it up a bit
$empty_child_fields = str_replace("\n", "", $empty_child_fields);
}
//if(!empty($pmprosm_values['sponsored_accounts_at_checkout']))
?>
<script>
jQuery(document).ready(function() {
var pmpro_base_level_is_free = <?php
if (pmpro_isLevelFree($pmpro_level)) {
echo "true";
} else {
echo "false";
}
?>
;
var seat_cost = <?php
echo intval($pmprosm_values['seat_cost']);
?>
;
var min_seats = <?php
if (!empty($pmprosm_values['min_seats'])) {
echo intval($pmprosm_values['min_seats']);
} else {
echo "0";
}
?>
;
var max_seats = <?php
if (!empty($pmprosm_values['max_seats'])) {
echo intval($pmprosm_values['max_seats']);
} else {
echo "false";
}
?>
;
//update things when the # of seats changes
jQuery('#seats, input.old_sub_accounts_active').bind("change", function() {
seatsChanged();
});
示例5: _e
_e('Full Name', 'pmpro');
?>
</label>
<input id="fullname" name="fullname" type="text" class="input <?php
echo pmpro_getClassForField("fullname");
?>
" size="30" value="" /> <strong><?php
_e('LEAVE THIS BLANK', 'pmpro');
?>
</strong>
</div>
<div class="pmpro_captcha">
<?php
global $recaptcha, $recaptcha_publickey;
if ($recaptcha == 2 || $recaptcha == 1 && pmpro_isLevelFree($pmpro_level)) {
echo recaptcha_get_html($recaptcha_publickey, NULL, true);
}
?>
</div>
<?php
do_action('pmpro_checkout_after_captcha');
?>
</td>
</tr>
</tbody>
</table>
<?php
示例6: elseif
?>
odd<?php
}
if ($current_level == $level) {
?>
active<?php
}
?>
">
<td><?php
echo $current_level ? "<strong>{$level->name}</strong>" : $level->name;
?>
</td>
<td>
<?php
if (pmpro_isLevelFree($level)) {
$cost_text = "<strong>" . __("Free", "pmpro") . "</strong>";
} else {
$cost_text = pmpro_getLevelCost($level, true, true);
}
$expiration_text = pmpro_getLevelExpiration($level);
if (!empty($cost_text) && !empty($expiration_text)) {
echo $cost_text . "<br />" . $expiration_text;
} elseif (!empty($cost_text)) {
echo $cost_text;
} elseif (!empty($expiration_text)) {
echo $expiration_text;
}
?>
</td>
<td>
示例7: pmpropbc_pmpro_checkout_after_payment_information_fields
function pmpropbc_pmpro_checkout_after_payment_information_fields()
{
global $gateway, $pmpro_level;
$options = pmpropbc_getOptions($pmpro_level->id);
if (!empty($options) && $options['setting'] > 0 && !pmpro_isLevelFree($pmpro_level)) {
$instructions = pmpro_getOption("instructions");
if ($gateway != 'check') {
$hidden = 'style="display:none;"';
} else {
$hidden = '';
}
echo '<div class="pmpro_check_instructions" ' . $hidden . '>' . wpautop($instructions) . '</div>';
}
}
示例8: sendCheckoutAdminEmail
function sendCheckoutAdminEmail($user = NULL, $invoice = NULL)
{
global $wpdb, $current_user, $pmpro_currency_symbol;
if(!$user)
$user = $current_user;
if(!$user)
return false;
//check settings
$send = pmpro_getOption("email_admin_checkout");
if(empty($send))
return true; //didn't send, but we also don't want to indicate failure because the settings say to not send
$this->email = get_bloginfo("admin_email");
$this->subject = "Member Checkout for " . $user->membership_level->name . " at " . get_option("blogname");
$this->data = array(
"subject" => $this->subject,
"name" => $user->display_name,
"user_login" => $user->user_login,
"sitename" => get_option("blogname"),
"siteemail" => pmpro_getOption("from_email"),
"membership_level_name" => $user->membership_level->name,
"membership_cost" => pmpro_getLevelCost($user->membership_level),
"login_link" => pmpro_url("account"),
"display_name" => $user->display_name,
"user_email" => $user->user_email,0
);
if($invoice)
{
if($invoice->gateway == "paypalexpress")
$this->template = "checkout_express_admin";
elseif($invoice->gateway == "check")
$this->template = "checkout_check_admin";
elseif(pmpro_isLevelTrial($user->membership_level))
$this->template = "checkout_trial_admin";
else
$this->template = "checkout_paid_admin";
$this->data["invoice_id"] = $invoice->code;
$this->data["invoice_total"] = $pmpro_currency_symbol . number_format($invoice->total, 2);
$this->data["invoice_date"] = date(get_option('date_format'), $invoice->timestamp);
$this->data["billing_name"] = $invoice->billing->name;
$this->data["billing_street"] = $invoice->billing->street;
$this->data["billing_city"] = $invoice->billing->city;
$this->data["billing_state"] = $invoice->billing->state;
$this->data["billing_zip"] = $invoice->billing->zip;
$this->data["billing_country"] = $invoice->billing->country;
$this->data["billing_phone"] = $invoice->billing->phone;
$this->data["cardtype"] = $invoice->cardtype;
$this->data["accountnumber"] = hideCardNumber($invoice->accountnumber);
$this->data["expirationmonth"] = $invoice->expirationmonth;
$this->data["expirationyear"] = $invoice->expirationyear;
if($invoice->getDiscountCode())
$this->data["discount_code"] = "<p>Discount Code: " . $invoice->discount_code->code . "</p>\n";
else
$this->data["discount_code"] = "";
}
elseif(pmpro_isLevelFree($user->membership_level))
{
$this->template = "checkout_free_admin";
global $discount_code;
if(!empty($discount_code))
$this->data["discount_code"] = "<p>Discount Code: " . $discount_code . "</p>\n";
else
$this->data["discount_code"] = "";
}
else
{
$this->template = "checkout_freetrial_admin";
$this->data["discount_code"] = "";
}
$enddate = $wpdb->get_var("SELECT UNIX_TIMESTAMP(enddate) FROM $wpdb->pmpro_memberships_users WHERE user_id = '" . $user->ID . "' AND status = 'active' LIMIT 1");
if($enddate)
$this->data["membership_expiration"] = "<p>This membership will expire on " . date(get_option('date_format'), $enddate) . ".</p>\n";
else
$this->data["membership_expiration"] = "";
return $this->sendEmail();
}
示例9: memberlitesc_signup_shortcode
//.........这里部分代码省略.........
<input type="hidden" id="level" name="level" value="<?php
echo $level;
?>
" />
<?php
if (!empty($current_user->ID)) {
?>
<p id="pmpro_account_loggedin">
<?php
printf(__('You are logged in as <strong>%s</strong>. If you would like to use a different account for this membership, <a href="%s">log out now</a>.', 'pmpro'), $current_user->user_login, wp_logout_url($_SERVER['REQUEST_URI']));
?>
</p>
<?php
} else {
?>
<div>
<label for="username">Username</label>
<input id="username" name="username" type="text" class="input" size="30" value="" />
</div>
<?php
do_action("pmpro_checkout_after_username");
?>
<div>
<label for="password">Password</label>
<input id="password" name="password" type="password" class="input" size="30" value="" />
</div>
<?php
if ($short) {
?>
<input type="hidden" name="password2_copy" value="1" />
<?php
} else {
?>
<div>
<label for="password2">Confirm Password</label>
<input id="password2" name="password2" type="password" class="input" size="30" value="" />
</div>
<?php
}
?>
<?php
do_action("pmpro_checkout_after_password");
?>
<div>
<label for="bemail">E-mail Address</label>
<input id="bemail" name="bemail" type="email" class="input" size="30" value="" />
</div>
<?php
if ($short) {
?>
<input type="hidden" name="bconfirmemail_copy" value="1" />
<?php
} else {
?>
<div>
<label for="bconfirmemail">Confirm E-mail</label>
<input id="bconfirmemail" name="bconfirmemail" type="email" class="input" size="30" value="" />
</div>
<?php
}
?>
<?php
do_action("pmpro_checkout_after_email");
?>
<div class="pmpro_hidden">
<label for="fullname">Full Name</label>
<input id="fullname" name="fullname" type="text" class="input" size="30" value="" /> <strong>LEAVE THIS BLANK</strong>
</div>
<div class="pmpro_captcha">
<?php
global $recaptcha, $recaptcha_publickey;
if ($recaptcha == 2 || $recaptcha == 1 && pmpro_isLevelFree($pmpro_level)) {
echo recaptcha_get_html($recaptcha_publickey, NULL, true);
}
?>
</div>
<?php
}
?>
<div>
<span id="pmpro_submit_span" >
<input type="hidden" name="submit-checkout" value="1" />
<input type="submit" class="pmpro_btn pmpro_btn-submit-checkout" value="<?php
echo $submit_button;
?>
" />
</span>
</div>
</form>
<?php
}
?>
<?php
$temp_content = ob_get_contents();
ob_end_clean();
return $temp_content;
}
示例10: pmprodon_pmpro_checkout_after_level_cost
//.........这里部分代码省略.........
?>
Enter an amount <?php
echo $pmpro_currency_symbol . $donfields['min_price'];
?>
or greater<?php
} elseif (!empty($donfields['max_price']) && empty($donfields['min_price'])) {
?>
Enter an amount <?php
echo $pmpro_currency_symbol . $donfields['max_price'];
?>
or less<?php
} elseif (!empty($donfields['max_price']) && !empty($donfields['min_price'])) {
?>
Enter an amount between <?php
echo $pmpro_currency_symbol . $donfields['min_price'];
?>
and <?php
echo $pmpro_currency_symbol . $donfields['max_price'];
}
}
?>
</p>
<script>
//some vars for keeping track of whether or not we show billing
var pmpro_gateway_billing = <?php
if (in_array($gateway, array("paypalexpress", "twocheckout")) !== false) {
echo "false";
} else {
echo "true";
}
?>
;
var pmpro_pricing_billing = <?php
if (!pmpro_isLevelFree($pmpro_level)) {
echo "true";
} else {
echo "false";
}
?>
;
var pmpro_donation_billing = pmpro_pricing_billing;
//this script will hide show billing fields based on the price set
jQuery(document).ready(function() {
//bind other field toggle to dropdown change
jQuery('#donation_dropdown').change(function() {
pmprodon_toggleOther();
});
//bind check to price field
var pmprodon_price_timer;
jQuery('#donation').bind('keyup change', function() {
pmprodon_price_timer = setTimeout(pmprodon_checkForFree, 500);
});
if(jQuery('input[name=gateway]'))
{
jQuery('input[name=gateway]').bind('click', function() {
pmprodon_price_timer = setTimeout(pmprodon_checkForFree, 500);
});
}
//check when page loads too
pmprodon_toggleOther();
pmprodon_checkForFree();
});
示例11: pmpro_getLevelCost
function pmpro_getLevelCost(&$level, $tags = true)
{
global $pmpro_currency_symbol;
$r = '
The price for membership is <strong>' . $pmpro_currency_symbol . number_format($level->initial_payment, 2) . '</strong> now';
if($level->billing_amount != '0.00')
{
$r .= ' and then <strong>' . $pmpro_currency_symbol . $level->billing_amount;
if($level->cycle_number == '1')
{
$r .= ' per ';
}
elseif($level->billing_limit == 1)
{
$r .= ' after ' . $level->cycle_number . ' ';
}
else
{
$r .= ' every ' . $level->cycle_number . ' ';
}
$r .= sornot($level->cycle_period,$level->cycle_number);
if($level->billing_limit > 1)
{
$r .= ' for ' . $level->billing_limit . ' more ' . sornot("payment",$level->billing_limit) . '.';
}
else
$r .= '.';
$r .= '</strong>';
}
else
$r .= '.';
if($level->trial_limit)
{
$r .= ' After your initial payment, your first ';
if($level->trial_amount == '0.00')
{
if($level->trial_limit == '1')
{
$r .= 'payment is Free.';
}
else
{
$r .= $level->trial_limit . ' payments are Free.';
}
}
else
{
$r .= $level->trial_limit.' ' .sornot("payment", $level->trial_limit) . ' will cost ' . $pmpro_currency_symbol . $level->trial_amount . '.';
}
}
//taxes?
$tax_state = pmpro_getOption("tax_state");
$tax_rate = pmpro_getOption("tax_rate");
if($tax_state && $tax_rate && !pmpro_isLevelFree($level))
{
$r .= " Customers in " . $tax_state . " will be charged " . round($tax_rate * 100, 2) . "% tax.";
}
if(!$tags)
$r = strip_tags($r);
$r = apply_filters("pmpro_level_cost_text", $r, $level);
return $r;
}
示例12: pmpro_checkout_after_payment_information_fields
/**
* Show instructions on checkout page
* Moved here from pages/checkout.php
* @since 1.8.9.3
*/
static function pmpro_checkout_after_payment_information_fields()
{
global $gateway;
global $pmpro_level;
if ($gateway == "check" && !pmpro_isLevelFree($pmpro_level)) {
$instructions = pmpro_getOption("instructions");
echo '<div class="pmpro_check_instructions">' . wpautop($instructions) . '</div>';
}
}
示例13: if
<?php
$sqlQuery = "SELECT * FROM $wpdb->pmpro_membership_levels ";
if($s)
$sqlQuery .= "WHERE name LIKE '%$s%' ";
$sqlQuery .= "ORDER BY id ASC";
$levels = $wpdb->get_results($sqlQuery, OBJECT);
foreach($levels as $level)
{
?>
<tr class="<?php if(!$level->allow_signups) { ?>pmpro_gray<?php } ?> <?php if(!pmpro_checkLevelForStripeCompatibility($level) || !pmpro_checkLevelForBraintreeCompatibility($level) || !pmpro_checkLevelForPayflowCompatibility($level)) { ?>pmpro_error<?php } ?>">
<td><?php echo $level->id?></td>
<td><?php echo $level->name?></td>
<td>
<?php if(pmpro_isLevelFree($level)) { ?>
FREE
<?php } else { ?>
<?php echo $pmpro_currency_symbol?><?php echo $level->initial_payment?>
<?php } ?>
</td>
<td>
<?php if(!pmpro_isLevelRecurring($level)) { ?>
--
<?php } else { ?>
<?php echo $pmpro_currency_symbol?><?php echo $level->billing_amount?> every <?php echo $level->cycle_number.' '.sornot($level->cycle_period,$level->cycle_number)?>
<?php if($level->billing_limit) { ?>(for <?php echo $level->billing_limit?> <?php echo sornot($level->cycle_period,$level->billing_limit)?>)<?php } ?>
<?php } ?>
</td>
示例14:
//hide/show billing
if (pmpro_isLevelFree($code_level) || pmpro_getGateway() == "paypalexpress" || pmpro_getGateway() == "paypalstandard" || pmpro_getGateway() == 'check') {
?>
jQuery('#pmpro_billing_address_fields').hide();
jQuery('#pmpro_payment_information_fields').hide();
<?php
} else {
?>
jQuery('#pmpro_billing_address_fields').show();
jQuery('#pmpro_payment_information_fields').show();
<?php
}
//hide/show paypal button
if (pmpro_getGateway() == "paypalexpress" || pmpro_getGateway() == "paypalstandard") {
if (pmpro_isLevelFree($code_level)) {
?>
jQuery('#pmpro_paypalexpress_checkout').hide();
jQuery('#pmpro_submit_span').show();
<?php
} else {
?>
jQuery('#pmpro_submit_span').hide();
jQuery('#pmpro_paypalexpress_checkout').show();
<?php
}
}
//filter to insert your own code
do_action('pmpro_applydiscountcode_return_js', $discount_code, $discount_code_id, $level_id, $code_level);
示例15: getLevels
function getLevels()
{
global $current_user;
if ($current_user->ID) {
$current_user->membership_level = pmpro_getMembershipLevelForUser($current_user->ID);
}
//is there a default level to redirect to?
if (defined("PMPRO_DEFAULT_LEVEL")) {
$default_level = intval(PMPRO_DEFAULT_LEVEL);
} else {
$default_level = false;
}
if ($default_level) {
wp_redirect(pmpro_url("checkout", "?level=" . $default_level));
exit;
}
global $wpdb, $pmpro_msg, $pmpro_msgt;
if (isset($_REQUEST['msg'])) {
if ($_REQUEST['msg'] == 1) {
$pmpro_msg = __('Your membership status has been updated - Thank you!', 'pmpro');
} else {
$pmpro_msg = __('Sorry, your request could not be completed - please try again in a few moments.', 'pmpro');
$pmpro_msgt = "pmpro_error";
}
} else {
$pmpro_msg = false;
}
global $pmpro_levels;
$pmpro_levels = pmpro_getAllLevels(false, true);
$pmpro_levels = apply_filters("pmpro_levels_array", $pmpro_levels);
if ($pmpro_msg) {
?>
<div class="pmpro_message <?php
echo $pmpro_msgt;
?>
"><?php
echo $pmpro_msg;
?>
</div>
<?php
}
?>
<div id="main" class="site-main clr">
<div id="membership-wrapper">
<?php
$count = 0;
$count_levels = count($pmpro_levels);
$tmp = 0;
foreach ($pmpro_levels as $level) {
if (isset($current_user->membership_level->ID)) {
$current_level = $current_user->membership_level->ID == $level->id;
} else {
$current_level = false;
}
?>
<?php
$last = $count_levels - $tmp;
?>
<?php
$tmp = $tmp + 1;
?>
<div class="box-level <?php
if ($count++ % 2 == 0) {
?>
odd<?php
} else {
?>
even<?php
}
if ($current_level == $level) {
?>
active<?php
}
if ($last == 2 || $last == 1) {
?>
last-box<?php
}
?>
">
<h1><?php
echo $current_level ? "<strong>{$level->name}</strong>" : $level->name;
?>
</h1>
<div class="copy">
<?php
if (pmpro_isLevelFree($level)) {
$cost_text = "<strong>Free</strong>";
} else {
$cost_text = pmpro_getLevelCost($level, true, true);
}
$expiration_text = pmpro_getLevelExpiration($level);
if (!empty($cost_text) && !empty($expiration_text)) {
echo $cost_text . "<br />" . $expiration_text;
} elseif (!empty($cost_text)) {
echo $cost_text;
} elseif (!empty($expiration_text)) {
//.........这里部分代码省略.........