本文整理汇总了PHP中pmpro_getAllLevels函数的典型用法代码示例。如果您正苦于以下问题:PHP pmpro_getAllLevels函数的具体用法?PHP pmpro_getAllLevels怎么用?PHP pmpro_getAllLevels使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pmpro_getAllLevels函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: pmpro_upgrade_1_8_9_3_ajax
function pmpro_upgrade_1_8_9_3_ajax()
{
global $wpdb;
$debug = false;
$run = true;
//some vars
$all_levels = pmpro_getAllLevels(true, true);
//keeping track of which user we're working on
$last_user_id = get_option('pmpro_upgrade_1_8_9_3_last_user_id', 0);
//get all active users during the period where things may have been broken
$user_ids = $wpdb->get_col("SELECT user_id FROM {$wpdb->pmpro_memberships_users} WHERE status = 'active' AND modified > '2016-05-19' AND user_id > {$last_user_id} ORDER BY user_id LIMIT 10");
//track progress
$first_load = get_transient('pmpro_updates_first_load');
if ($first_load) {
$total_users = $wpdb->get_var("SELECT COUNT(user_id) FROM {$wpdb->pmpro_memberships_users} WHERE status = 'active' AND modified > '2016-05-19' ORDER BY user_id");
update_option('pmpro_upgrade_1_8_9_3_total', $total_users, 'no');
$progress = 0;
} else {
$total_users = get_option('pmpro_upgrade_1_8_9_3_total', 0);
$progress = get_option('pmpro_upgrade_1_8_9_3_progress', 0);
}
update_option('pmpro_upgrade_1_8_9_3_progress', $progress + count($user_ids), 'no');
global $pmpro_updates_progress;
if ($total_users > 0) {
$pmpro_updates_progress = "[" . $progress . "/" . $total_users . "]";
} else {
$pmpro_updates_progress = "";
}
if (empty($user_ids)) {
//done with this update
pmpro_removeUpdate('pmpro_upgrade_1_8_9_3_ajax');
delete_option('pmpro_upgrade_1_8_9_3_last_user_id');
delete_option('pmpro_upgrade_1_8_9_3_total');
delete_option('pmpro_upgrade_1_8_9_3_progress');
} else {
foreach ($user_ids as $user_id) {
$last_user_id = $user_id;
//keeping track of the last user we processed
$user = get_userdata($user_id);
//user not found for some reason
if (empty($user)) {
if ($debug) {
echo "User #" . $user_id . " not found.\n";
}
continue;
}
//get level
$user->membership_level = pmpro_getMembershipLevelForUser($user->ID);
//has a start and end date already
if (!empty($user->membership_level->enddate) && !empty($user->membership_level->startdate)) {
if ($debug) {
echo "User #" . $user_id . ", " . $user->user_email . " already has a start and end date.\n";
}
continue;
}
//get order
$last_order = new MemberOrder();
$last_order->getLastMemberOrder();
/*
Figure out if this user should have been given an end date.
The level my have an end date.
They might have used a discount code.
They might be using the set-expiration-dates code.
They might have custom code setting the end date.
Let's setup some vars as if we are at checkout.
Then pass recreate the level with the pmpro_checkout_level filter.
And use the end date there if there is one.
*/
global $pmpro_level, $discount_code, $discount_code_id;
//level
$level_id = $user->membership_level->id;
$_REQUEST['level'] = $level_id;
//gateway
if (!empty($last_order) && !empty($last_order->gateway)) {
$_REQUEST['gateway'] = $last_order->gateway;
} else {
$_REQUEST['gateway'] = pmpro_getGateway();
}
//discount code
$discount_code_id = $user->membership_level->code_id;
$discount_code = $wpdb->get_var("SELECT code FROM {$wpdb->pmpro_discount_codes} WHERE id = '" . $discount_code_id . "' LIMIT 1");
//get level
if (!empty($discount_code_id)) {
$sqlQuery = "SELECT l.id, cl.*, l.name, l.description, l.allow_signups FROM {$wpdb->pmpro_discount_codes_levels} cl LEFT JOIN {$wpdb->pmpro_membership_levels} l ON cl.level_id = l.id LEFT JOIN {$wpdb->pmpro_discount_codes} dc ON dc.id = cl.code_id WHERE dc.code = '" . $discount_code . "' AND cl.level_id = '" . (int) $level_id . "' LIMIT 1";
$pmpro_level = $wpdb->get_row($sqlQuery);
//if the discount code doesn't adjust the level, let's just get the straight level
if (empty($pmpro_level)) {
$pmpro_level = $all_levels[$level_id];
}
//filter adjustments to the level
$pmpro_level->code_id = $discount_code_id;
$pmpro_level = apply_filters("pmpro_discount_code_level", $pmpro_level, $discount_code_id);
}
//no level yet, use default
if (empty($pmpro_level)) {
$pmpro_level = $all_levels[$level_id];
}
//no level for some reason
if (empty($pmpro_level) && empty($pmpro_level->id)) {
//.........这里部分代码省略.........
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:101,代码来源:upgrade_1_8_9_3.php
示例2: pmpro_levels
function pmpro_levels($course_id = null)
{
if (in_array('paid-memberships-pro/paid-memberships-pro.php', apply_filters('active_plugins', get_option('active_plugins'))) && function_exists('pmpro_getAllLevels')) {
$levels = pmpro_getAllLevels();
// Get all the PMPro Levels
?>
<li class="course_membership"><strong><?php
_e('Set Course Memberships', 'wplms-front-end');
?>
<span>
<select id="vibe_pmpro_membership" class="chosen" multiple>
<?php
if (isset($levels) && is_array($levels)) {
foreach ($levels as $level) {
if (!is_Array($course_pricing['vibe_pmpro_membership'])) {
$course_pricing['vibe_pmpro_membership'] = array();
}
if (is_object($level)) {
echo '<option value="' . $level->id . '" ' . (in_array($level->id, $course_pricing['vibe_pmpro_membership']) ? 'selected' : '') . '>' . $level->name . '</option>';
}
}
}
?>
</select>
</span>
</strong>
</li>
<?php
}
}
开发者ID:nikitansk,项目名称:devschool,代码行数:30,代码来源:class.generate_fields.php
示例3: pmprolpv_admin_init
/**
* Register settings sections and fields.
*
* @since 0.3.0
*/
function pmprolpv_admin_init()
{
// Register limits settings section.
add_settings_section('pmprolpv_limits', 'Membership Post View Limits', 'pmprolpv_settings_section_limits', 'pmpro-limitpostviews');
// Register redirection settings section.
add_settings_section('pmprolpv_redirection', 'Redirection', 'pmprolpv_settings_section_redirection', 'pmpro-limitpostviews');
// Register limits settings fields.
$levels = pmpro_getAllLevels(true, true);
$levels[0] = new stdClass();
$levels[0]->name = __('Non-members', 'pmpro');
asort($levels);
foreach ($levels as $id => $level) {
$title = $level->name;
add_settings_field('pmprolpv_limit_' . $id, $title, 'pmprolpv_settings_field_limits', 'pmpro-limitpostviews', 'pmprolpv_limits', $id);
// Register JavaScript setting.
register_setting('pmpro-limitpostviews', 'pmprolpv_limit_' . $id, 'pmprolpv_sanitize_limit');
}
// Register redirection settings field.
add_settings_field('pmprolpv_redirect_page', 'Redirect to', 'pmprolpv_settings_field_redirect_page', 'pmpro-limitpostviews', 'pmprolpv_redirection');
// Register redirection setting.
register_setting('pmpro-limitpostviews', 'pmprolpv_redirect_page');
// Register JavaScript settings field.
add_settings_field('pmprolpv_use_js', 'Use JavaScript redirection', 'pmprolpv_settings_field_use_js', 'pmpro-limitpostviews', 'pmprolpv_redirection');
// Register JavaScript setting.
register_setting('pmpro-limitpostviews', 'pmprolpv_use_js');
}
开发者ID:eighty20results,项目名称:pmpro-limit-post-views,代码行数:31,代码来源:admin.php
示例4: wplms_sell_quiz_as_product
function wplms_sell_quiz_as_product($metabox)
{
if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) {
$metabox['vibe_quiz_product'] = array('label' => __('Associated Product', 'vibe-customtypes'), 'desc' => __('Associated Product with the Course.', 'vibe-customtypes'), 'id' => 'vibe_quiz_product', 'type' => 'selectcpt', 'post_type' => 'product', 'std' => '');
}
if (in_array('paid-memberships-pro/paid-memberships-pro.php', apply_filters('active_plugins', get_option('active_plugins'))) && is_user_logged_in()) {
$levels = pmpro_getAllLevels();
foreach ($levels as $level) {
$level_array[] = array('value' => $level->id, 'label' => $level->name);
}
$metabox['vibe_quiz_pmpro_membership'] = array('label' => __('PMPro Membership', 'vibe-customtypes'), 'desc' => __('Required Membership level for this quiz', 'vibe-customtypes'), 'id' => 'vibe_quiz_pmpro_membership', 'type' => 'multiselect', 'options' => $level_array);
}
if (in_array('wplms-mycred-addon/wplms-mycred-addon.php', apply_filters('active_plugins', get_option('active_plugins')))) {
$metabox['vibe_quiz_mycred_points'] = array('label' => __('MyCred Points', 'vibe-customtypes'), 'desc' => __('MyCred Points required to take this quiz.', 'vibe-customtypes'), 'id' => 'vibe_quiz_mycred_points', 'type' => 'number');
}
return $metabox;
}
开发者ID:VibeThemes,项目名称:wplms_sell_quiz,代码行数:17,代码来源:sell_quiz.php
示例5: pmproet_admin_init_test_order
function pmproet_admin_init_test_order()
{
global $current_user, $pmproet_test_order_id;
//make sure PMPro is activated
if (!class_exists('MemberOrder')) {
return;
}
$pmproet_test_order_id = get_option('pmproet_test_order_id');
$test_order = new MemberOrder($pmproet_test_order_id);
if (empty($test_order->id)) {
$all_levels = pmpro_getAllLevels();
if (!empty($all_levels)) {
$first_level = array_shift($all_levels);
$test_order->membership_id = $first_level->id;
$test_order->InitialPayment = $first_level->initial_payment;
} else {
$test_order->membership_id = 1;
$test_order->InitialPayment = 1;
}
$test_order->user_id = $current_user->ID;
$test_order->cardtype = "Visa";
$test_order->accountnumber = "4111111111111111";
$test_order->expirationmonth = date('m', current_time('timestamp'));
$test_order->expirationyear = intval(date('Y', current_time('timestamp'))) + 1;
$test_order->ExpirationDate = $test_order->expirationmonth . $test_order->expirationyear;
$test_order->CVV2 = '123';
$test_order->FirstName = 'Jane';
$test_order->LastName = 'Doe';
$test_order->Address1 = '123 Street';
$test_order->billing = new stdClass();
$test_order->billing->name = 'Jane Doe';
$test_order->billing->street = '123 Street';
$test_order->billing->city = 'City';
$test_order->billing->state = 'ST';
$test_order->billing->country = 'US';
$test_order->billing->zip = '12345';
$test_order->billing->phone = '5558675309';
$test_order->gateway_environment = 'sandbox';
$test_order->notes = __('This is a test order used with the PMPro Email Templates addon.', 'pmpro');
$test_order->saveOrder();
$pmproet_test_order_id = $test_order->id;
update_option('pmproet_test_order_id', $pmproet_test_order_id);
}
}
开发者ID:audiblePi,项目名称:fccTest,代码行数:44,代码来源:init.php
示例6: register_my_members_menu
function register_my_members_menu()
{
//make sure PMPro is activated
if (!function_exists('pmpro_getAllLevels')) {
return;
}
$my_theme = wp_get_theme();
$menus = get_registered_nav_menus();
foreach ($menus as $location => $description) {
register_nav_menu('members-' . $location, __($description . ' - Members', $my_theme->get('Template')));
$levels = pmpro_getAllLevels(true, true);
foreach ($levels as $level) {
$level_nav_menu = get_option('pmpro_nav_menu_hidden_level_' . $level->id, false);
if (!empty($level_nav_menu)) {
register_nav_menu('members-' . $level->id . '-' . $location, __($description . ' - ' . $level->name . ' Members', 'pmpro'));
}
}
}
}
开发者ID:greathmaster,项目名称:pmpro-nav-menus,代码行数:19,代码来源:pmpro-nav-menus.php
示例7: javo_item_price_callback
public function javo_item_price_callback($atts, $content = "")
{
global $post;
$temp = $post;
$errors = new wp_error();
if (!defined('PMPRO_VERSION')) {
$errors->add('test-error', __('Please activate "Paid Membership Pro" plugin to use price table shortcodes.', 'javo_fr'));
}
extract(shortcode_atts(array('title' => '', 'sub_title' => '', 'title_text_color' => '#000', 'sub_title_text_color' => '#000', 'line_color' => '#fff'), $atts));
if ($errors->get_error_code() != null) {
ob_start();
?>
<div class="alert alert-danger">
<strong><?php
_e('Error!', 'javo_fr');
?>
</strong>
<div><?php
echo $errors->get_error_message();
?>
</div>
</div>
<?php
return ob_get_clean();
}
$pmpro_levels = pmpro_getAllLevels();
ob_start();
echo apply_filters('javo_shortcode_title', $title, $sub_title, array('title' => 'color:' . $title_text_color . ';', 'subtitle' => 'color:' . $sub_title_text_color . ';', 'line' => 'border-color:' . $line_color . ';'));
$post->post_content = "[pmpro_levels]";
if (function_exists('pmpro_wp')) {
pmpro_wp();
}
echo do_shortcode('[pmpro_levels]');
$post = $temp;
return ob_get_clean();
}
开发者ID:ksingh812,项目名称:epb,代码行数:36,代码来源:javo-item-price.php
示例8: wplms_unit_check_pmpro_membership
function wplms_unit_check_pmpro_membership($content)
{
global $post;
if ($post->post_type != 'unit' || !is_user_logged_in()) {
return $content;
}
$unit_id = $post->ID;
$user_id = get_current_user_id();
if (in_array('paid-memberships-pro/paid-memberships-pro.php', apply_filters('active_plugins', get_option('active_plugins'))) && function_exists('pmpro_getAllLevels')) {
$membership_ids = get_post_meta($unit_id, 'vibe_pmpro_membership', true);
if (!empty($membership_ids) && count($membership_ids) >= 1) {
if (pmpro_hasMembershipLevel($membership_ids, $user_id)) {
return $content;
} else {
$levels = pmpro_getAllLevels($membership_ids);
foreach ($levels as $level) {
$level_array[$level->id] = $level->name;
}
$content = 'Please purchase membership plan ';
}
}
}
return $content;
}
开发者ID:VibeThemes,项目名称:wplms-pmpro-unit-addon,代码行数:24,代码来源:wplms-pmpro-unit-addon.php
示例9: pmpro_getAllLevels
<?php
global $wpdb, $pmpro_msg, $pmpro_msgt, $current_user;
$pmpro_levels = pmpro_getAllLevels(false, true);
$pmpro_level_order = pmpro_getOption('level_order');
if (!empty($pmpro_level_order)) {
$order = explode(',', $pmpro_level_order);
//reorder array
$reordered_levels = array();
foreach ($order as $level_id) {
foreach ($pmpro_levels as $key => $level) {
if ($level_id == $level->id) {
$reordered_levels[] = $pmpro_levels[$key];
}
}
}
$pmpro_levels = $reordered_levels;
}
$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
}
?>
开发者ID:MediaPreneur,项目名称:paid-memberships-pro,代码行数:31,代码来源:levels.php
示例10: pmpro_shortcode_account
function pmpro_shortcode_account($atts, $content = null, $code = "")
{
global $wpdb, $pmpro_msg, $pmpro_msgt, $pmpro_levels, $current_user, $levels;
// $atts ::= array of attributes
// $content ::= text within enclosing form of shortcode element
// $code ::= the shortcode found, when == callback name
// examples: [pmpro_account] [pmpro_account sections="membership,profile"/]
extract(shortcode_atts(array('section' => '', 'sections' => 'membership,profile,invoices,links'), $atts));
//did they use 'section' instead of 'sections'?
if (!empty($section)) {
$sections = $section;
}
//Extract the user-defined sections for the shortcode
$sections = array_map('trim', explode(",", $sections));
ob_start();
//if a member is logged in, show them some info here (1. past invoices. 2. billing information with button to update.)
if (pmpro_hasMembershipLevel()) {
$ssorder = new MemberOrder();
$ssorder->getLastMemberOrder();
$mylevels = pmpro_getMembershipLevelsForUser();
$pmpro_levels = pmpro_getAllLevels(false, true);
// just to be sure - include only the ones that allow signups
$invoices = $wpdb->get_results("SELECT *, UNIX_TIMESTAMP(timestamp) as timestamp FROM {$wpdb->pmpro_membership_orders} WHERE user_id = '{$current_user->ID}' AND status NOT IN('refunded', 'review', 'token', 'error') ORDER BY timestamp DESC LIMIT 6");
?>
<div id="pmpro_account">
<?php
if (in_array('membership', $sections) || in_array('memberships', $sections)) {
?>
<div id="pmpro_account-membership" class="pmpro_box">
<h3><?php
_e("My Memberships", "pmpro");
?>
</h3>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<thead>
<tr>
<th><?php
_e("Level", "pmpro");
?>
</th>
<th><?php
_e("Billing", "pmpro");
?>
</th>
<th><?php
_e("Expiration", "pmpro");
?>
</th>
</tr>
</thead>
<tbody>
<?php
foreach ($mylevels as $level) {
?>
<tr>
<td class="pmpro_account-membership-levelname">
<?php
echo $level->name;
?>
<div class="pmpro_actionlinks">
<?php
do_action("pmpro_member_action_links_before");
?>
<?php
if (array_key_exists($level->id, $pmpro_levels) && pmpro_isLevelExpiringSoon($level)) {
?>
<a href="<?php
echo pmpro_url("checkout", "?level=" . $level->id, "https");
?>
"><?php
_e("Renew", "pmpro");
?>
</a>
<?php
}
?>
<?php
if (isset($ssorder->status) && $ssorder->status == "success" && (isset($ssorder->gateway) && in_array($ssorder->gateway, array("authorizenet", "paypal", "stripe", "braintree", "payflow", "cybersource"))) && pmpro_isLevelRecurring($level)) {
?>
<a href="<?php
echo pmpro_url("billing", "", "https");
?>
"><?php
_e("Update Billing Info", "pmpro");
?>
</a>
<?php
}
?>
<?php
//To do: Only show CHANGE link if this level is in a group that has upgrade/downgrade rules
if (count($pmpro_levels) > 1 && !defined("PMPRO_DEFAULT_LEVEL")) {
?>
<a href="<?php
echo pmpro_url("levels");
//.........这里部分代码省略.........
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:101,代码来源:pmpro_account.php
示例11: pmproup_adminpage
function pmproup_adminpage()
{
global $wpdb;
//get options
$options = pmproup_getOptions();
//saving?
if (!empty($_REQUEST['savesettings'])) {
//get parent page
$parent_page = intval($_REQUEST['parent_page']);
//get levels and make sure they are all ints
if (!empty($_REQUEST['levels'])) {
$olevels = $_REQUEST['levels'];
} else {
$olevels = array();
}
$levels = array();
foreach ($olevels as $olevel) {
$levels[] = intval($olevel);
}
//update options
$options['parent_page'] = $parent_page;
$options['levels'] = $levels;
update_option('pmpro_user_pages', $options);
//see if existing member checkbox is checked
if (!empty($_REQUEST['existing_members']) && !empty($levels)) {
//find all members
$member_ids = $wpdb->get_col("SELECT user_id FROM {$wpdb->pmpro_memberships_users} WHERE status = 'active' AND membership_id IN('" . implode("','", $levels) . "')");
//loop through
if (!empty($member_ids)) {
echo "<p>Generating user pages... ";
$count = 0;
foreach ($member_ids as $member_id) {
//check for user page
$user_page_id = get_user_meta($member_id, "pmproup_user_page", true);
//no page, create one
if (empty($user_page_id)) {
$count++;
echo ". ";
pmproup_pmpro_after_checkout($member_id);
}
}
echo " Done. " . $count . " " . _n('member', 'members', $count) . " setup.</p>";
}
}
}
require_once PMPRO_DIR . "/adminpages/admin_header.php";
?>
<form action="" method="post" enctype="multipart/form-data">
<h2>User Pages Settings</h2>
<?php
if (defined('PMPROUP_PARENT_PAGE_ID') || defined('PMPROUP_LEVELS')) {
?>
<div id="message" class="error"><p><strong>Warning:</strong> PMPROUP_PARENT_PAGE_ID and PMPROUP_LEVELS seem to be defined already... maybe in your wp-config.php. These constants are no longer needed and you should find their definitions and delete them. The settings here will control the User Pages addon.</p></div>
<?php
}
?>
<p>The User Pages addon can be used to create a "user page" for new members of specific levels. The user pages will only be visible to site admins and the user it was created for.</p>
<hr />
<p>The <strong>Top Level Page</strong> is the WordPress page under which all user pages will be created. You can create a page called "User Pages" and then choose it from the dropdown below.</p>
<table class="form-table">
<tbody>
<tr>
<th scope="row" valign="top">
<label for="parent_page"><?php
_e('Top Level Page', 'pmpro');
?>
:</label>
</th>
<td>
<?php
wp_dropdown_pages(array("name" => "parent_page", "show_option_none" => "-- Choose One --", "selected" => $options['parent_page']));
?>
</td>
</tr>
</tbody>
</table>
<hr />
<p>Only members of the levels specified below will have user pages created for them. Hold the Control button (or Command button on Macs) and click to select/deselect multiple levels.</p>
<table class="form-table">
<tbody>
<tr>
<th scope="row" valign="top">
<label for="levels"><?php
_e('User Pages Levels', 'pmpro');
?>
:</label>
</th>
<td>
<select id="levels" name="levels[]" multiple="yes">
<?php
$levels = pmpro_getAllLevels(true, true);
//.........这里部分代码省略.........
开发者ID:TakenCdosG,项目名称:admissionsrevolution_new,代码行数:101,代码来源:settings.php
示例12: pmpro_update_existing_subscriptions
//.........这里部分代码省略.........
<table class="form-table">
<tbody>
<tr>
<th scope="row">
<label for="pmproues_gateway"><?php
_e('Gateway', 'pmproues');
?>
</label>
</th>
<td>
<select name="pmproues_gateway" id="pmproues_gateway">
<option value="stripe"><?php
_e('Stripe', 'pmproues');
?>
</option>
</select>
</td>
</tr>
<tr>
<th scope="row">
<label for="pmproues_level"><?php
_e('Level', 'pmproues');
?>
</label>
</th>
<td>
<select name="pmproues_level" id="pmproues_level">
<option value="">- <?php
_e('Choose One', 'pmproues');
?>
-</option>
<?php
$levels = pmpro_getAllLevels(true, true);
foreach ($levels as $level) {
?>
<option value="<?php
echo $level->id;
?>
"><?php
echo $level->name;
?>
</option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<th scope="row" valign="top"><label for="pmproues_billing_amount"><?php
_e('New Billing Amount', 'pmproues');
?>
:</label></th>
<td>
<?php
if (pmpro_getCurrencyPosition() == "left") {
echo $pmpro_currency_symbol;
}
?>
<input id="pmproues_billing_amount" name="pmproues_billing_amount" type="text" size="20" value="<?php
echo esc_attr($pmproues_billing_amount);
?>
" />
<?php
开发者ID:strangerstudios,项目名称:pmpro-update-existing-subscriptions,代码行数:67,代码来源:pmpro-update-existing-subscriptions.php
示例13: selected
<option value="<?php
echo "Last Year";
?>
" <?php
selected($predefined_date, "Last Year");
?>
><?php
echo "Last Year";
?>
</option>
</select>
<?php
//Note: only orders belonging to current levels can be filtered. There is no option for orders belonging to deleted levels
$levels = pmpro_getAllLevels();
?>
<select id="l" name="l">
<?php
foreach ($levels as $level) {
?>
<option value="<?php
echo $level->id;
?>
" <?php
selected($l, $level->id);
?>
><?php
echo $level->name;
?>
</option>
开发者ID:srimai,项目名称:paid-memberships-pro,代码行数:31,代码来源:orders.php
示例14: bp_course_get_course_credits
function bp_course_get_course_credits($args = NULL)
{
$defaults = array('id' => get_the_ID(), 'currency' => 'CREDITS', 'bypass' => 0);
$r = wp_parse_args($args, $defaults);
extract($r, EXTR_SKIP);
$private = 0;
$credits_html = '';
$credits = array();
if (!empty($bypass)) {
if (is_user_logged_in()) {
$user_id = get_current_user_id();
$expire_check = get_user_meta($user_id, $id, true);
if ($expire > time()) {
return '';
}
}
}
$free_course = get_post_meta($id, 'vibe_course_free', true);
if (vibe_validate($free_course)) {
$credits[] = '<strong>' . apply_filters('wplms_free_course_price', __('FREE', 'vibe')) . '</strong>';
} else {
$product_id = get_post_meta($id, 'vibe_product', true);
if (isset($product_id) && $product_id != '' && function_exists('get_product')) {
//WooCommerce installed
$product = get_product($product_id);
if (is_object($product)) {
$link = get_permalink($product_id);
$check = vibe_get_option('direct_checkout');
if (isset($check) && $check) {
$link .= '?redirect';
}
$price_html = str_replace('class="amount"', 'class="amount"', $product->get_price_html());
$credits[$link] = '<strong>' . $price_html . '</strong>';
}
}
if (in_array('paid-memberships-pro/paid-memberships-pro.php', apply_filters('active_plugins', get_option('active_plugins')))) {
$membership_ids = vibe_sanitize(get_post_meta($id, 'vibe_pmpro_membership', false));
if (isset($membership_ids) && is_Array($membership_ids) && count($membership_ids) && function_exists('pmpro_getAllLevels')) {
//$membership_id = min($membership_ids);
$levels = pmpro_getAllLevels();
foreach ($levels as $level) {
if (in_array($level->id, $membership_ids)) {
$link = get_option('pmpro_levels_page_id');
$link = get_permalink($link) . '#' . $level->id;
$credits[$link] = '<strong>' . $level->name . '</strong>';
}
}
}
}
$course_credits = get_post_meta($id, 'vibe_course_credits', true);
if (isset($course_credits) && $course_credits != '') {
$credits[] = '<strong>' . $course_credits . '</strong>';
}
}
// End Else
$credits = apply_filters('wplms_course_credits_array', $credits, $id);
if (count($credits) > 1) {
$credits_html .= '<div class="pricing_course">
<div class="result"><span>' . __('Price Options +', 'vibe') . '</span></div>
<div class="drop">';
$first = 1;
foreach ($credits as $key => $credit) {
$credits_html .= '<label data-value="' . $key . '"><span class="font-text">' . $credit . '</span></label>';
$first = 0;
}
$credits_html .= '</div>
</div>';
/*$credits_html .='<ul class="pricing_course">';
$first = 1;
foreach($credits as $key=>$credit){
$credits_html .='<li data-value="'.$key.'" '.(($first)?'class="active"':'').'> '.$credit.'</li>';
$first=0;
}
$credits_html .='</ul>';*/
} else {
if (count($credits)) {
foreach ($credits as $credit) {
$credits_html .= $credit;
}
if (is_singular('course')) {
$credits_html .= '<i class="icon-wallet-money right"></i>';
}
}
}
$credits_html .= '';
$credits_html = apply_filters('wplms_course_credits', $credits_html, $id);
return $credits_html;
}
开发者ID:akshayxhtmljunkies,项目名称:brownglock,代码行数:88,代码来源:bp-course-template.php
示例15: vibe_meta_box_arrays
function vibe_meta_box_arrays($metabox)
{
// References added to Pick labels for Import/Export
$prefix = 'vibe_';
$sidebars = $GLOBALS['wp_registered_sidebars'];
$sidebararray = array();
foreach ($sidebars as $sidebar) {
if (!in_array($sidebar['id'], array('student_sidebar', 'instructor_sidebar'))) {
$sidebararray[] = array('label' => $sidebar['name'], 'value' => $sidebar['id']);
}
}
$course_duration_parameter = apply_filters('vibe_course_duration_parameter', 86400);
$drip_duration_parameter = apply_filters('vibe_drip_duration_parameter', 86400);
$unit_duration_parameter = apply_filters('vibe_unit_duration_parameter', 60);
$quiz_duration_parameter = apply_filters('vibe_quiz_duration_parameter', 60);
$product_duration_parameter = apply_filters('vibe_product_duration_parameter', 86400);
$assignment_duration_parameter = apply_filters('vibe_assignment_duration_parameter', 86400);
switch ($metabox) {
case 'post':
$metabox_settings = array($prefix . 'subtitle' => array('label' => __('Post Sub-Title', 'vibe-customtypes'), 'desc' => __('Post Sub- Title.', 'vibe-customtypes'), 'id' => $prefix . 'subtitle', 'type' => 'textarea', 'std' => ''), $prefix . 'template' => array('label' => __('Post Template', 'vibe-customtypes'), 'desc' => __('Select a post template for showing content.', 'vibe-customtypes'), 'id' => $prefix . 'template', 'type' => 'select', 'options' => array(1 => array('label' => __('Content on Left', 'vibe-customtypes'), 'value' => ''), 2 => array('label' => __('Content on Right', 'vibe-customtypes'), 'value' => 'right'), 3 => array('label' => __('Full Width', 'vibe-customtypes'), 'value' => 'full')), 'std' => ''), $prefix . 'sidebar' => array('label' => __('Sidebar', 'vibe-customtypes'), 'desc' => __('Select a Sidebar | Default : mainsidebar', 'vibe-customtypes'), 'id' => $prefix . 'sidebar', 'type' => 'select', 'options' => $sidebararray), $prefix . 'title' => array('label' => __('Show Page Title', 'vibe-customtypes'), 'desc' => __('Show Page/Post Title.', 'vibe-customtypes'), 'id' => $prefix . 'title', 'type' => 'showhide', 'options' => array(array('value' => 'H', 'label' => 'Hide'), array('value' => 'S', 'label' => 'Show')), 'std' => 'S'), $prefix . 'author' => array('label' => __('Show Author Information', 'vibe-customtypes'), 'desc' => __('Author information below post content.', 'vibe-customtypes'), 'id' => $prefix . 'author', 'type' => 'showhide', 'options' => array(array('value' => 'H', 'label' => 'Hide'), array('value' => 'S', 'label' => 'Show')), 'std' => 'H'), $prefix . 'breadcrumbs' => array('label' => __('Show Breadcrumbs', 'vibe-customtypes'), 'desc' => __('Show breadcrumbs.', 'vibe-customtypes'), 'id' => $prefix . 'breadcrumbs', 'options' => array(array('value' => 'H', 'label' => 'Hide'), array('value' => 'S', 'label' => 'Show')), 'std' => 'S'), $prefix . 'prev_next' => array('label' => __('Show Prev/Next Arrows', 'vibe-customtypes'), 'desc' => __('Show previous/next links on top below the Subheader.', 'vibe-customtypes'), 'id' => $prefix . 'prev_next', 'type' => 'showhide', 'options' => array(array('value' => 'H', 'label' => 'Hide'), array('value' => 'S', 'label' => 'Show')), 'std' => 'H'));
break;
case 'page':
$metabox_settings = array($prefix . 'title' => array('label' => __('Show Page Title', 'vibe-customtypes'), 'desc' => __('Show Page/Post Title.', 'vibe-customtypes'), 'id' => $prefix . 'title', 'type' => 'showhide', 'options' => array(array('value' => 'H', 'label' => 'Hide'), array('value' => 'S', 'label' => 'Show')), 'std' => 'S'), $prefix . 'subtitle' => array('label' => __('Page Sub-Title', 'vibe-customtypes'), 'desc' => __('Page Sub- Title.', 'vibe-customtypes'), 'id' => $prefix . 'subtitle', 'type' => 'textarea', 'std' => ''), $prefix . 'breadcrumbs' => array('label' => __('Show Breadcrumbs', 'vibe-customtypes'), 'desc' => __('Show breadcrumbs.', 'vibe-customtypes'), 'id' => $prefix . 'breadcrumbs', 'type' => 'showhide', 'options' => array(array('value' => 'H', 'label' => 'Hide'), array('value' => 'S', 'label' => 'Show')), 'std' => 'S'), $prefix . 'sidebar' => array('label' => __('Sidebar', 'vibe-customtypes'), 'desc' => __('Select Sidebar | Sidebar : mainsidebar', 'vibe-customtypes'), 'id' => $prefix . 'sidebar', 'type' => 'select', 'options' => $sidebararray));
break;
case 'course':
$metabox_settings = array($prefix . 'sidebar' => array('label' => __('Sidebar', 'vibe-customtypes'), 'desc' => __('Select a Sidebar | Default : mainsidebar', 'vibe-customtypes'), 'id' => $prefix . 'sidebar', 'type' => 'select', 'options' => $sidebararray, 'std' => 'coursesidebar'), $prefix . 'duration' => array('label' => __('Total Duration of Course', 'vibe-customtypes'), 'desc' => sprintf(__('Duration of Course (in %s)', 'vibe-customtypes'), calculate_duration_time($course_duration_parameter)), 'id' => $prefix . 'duration', 'type' => 'number', 'std' => 10), $prefix . 'students' => array('label' => __('Total number of Students in Course', 'vibe-customtypes'), 'desc' => __('Total number of Students who have taken this Course.', 'vibe-customtypes'), 'id' => $prefix . 'students', 'type' => 'number', 'std' => 0), $prefix . 'course_auto_eval' => array('label' => __('Auto Evaluation', 'vibe-customtypes'), 'desc' => __('Evalute Courses based on Quizes scores available in Course (* Requires atleast 1 Quiz in course)', 'vibe-customtypes'), 'id' => $prefix . 'course_auto_eval', 'type' => 'yesno', 'options' => array(array('value' => 'H', 'label' => 'Hide'), array('value' => 'S', 'label' => 'Show')), 'std' => 'H'), $prefix . 'start_date' => array('label' => __('Course Start Date', 'vibe-customtypes'), 'desc' => __('Date from which Course Begins', 'vibe-customtypes'), 'id' => $prefix . 'start_date', 'type' => 'date'), $prefix . 'max_students' => array('label' => __('Maximum Students in Course', 'vibe-customtypes'), 'desc' => __('Maximum number of students who can pursue the course at a time.', 'vibe-customtypes'), 'id' => $prefix . 'max_students', 'type' => 'number'), $prefix . 'course_badge' => array('label' => __('Excellence Badge', 'vibe-customtypes'), 'desc' => __('Upload badge image which Students recieve upon course completion', 'vibe-customtypes'), 'id' => $prefix . 'course_badge', 'type' => 'image'), $prefix . 'course_badge_percentage' => array('label' => __('Badge Percentage', 'vibe-customtypes'), 'desc' => __('Badge is given to people passing above percentage (out of 100)', 'vibe-customtypes'), 'id' => $prefix . 'course_badge_percentage', 'type' => 'number'), $prefix . 'course_badge_title' => array('label' => __('Badge Title', 'vibe-customtypes'), 'desc' => __('Title is shown on hovering the badge.', 'vibe-customtypes'), 'id' => $prefix . 'course_badge_title', 'type' => 'text'), $prefix . 'course_certificate' => array('label' => __('Completion Certificate', 'vibe-customtypes'), 'desc' => __('Enable Certificate image which Students recieve upon course completion (out of 100)', 'vibe-customtypes'), 'id' => $prefix . 'course_certificate', 'type' => 'showhide', 'options' => array(array('value' => 'H', 'label' => 'Hide'), array('value' => 'S', 'label' => 'Show')), 'std' => 'H'), $prefix . 'certificate_template' => array('label' => __('Certificate Template', 'vibe-customtypes'), 'desc' => __('Select a Certificate Template', 'vibe-customtypes'), 'id' => $prefix . 'certificate_template', 'type' => 'selectcpt', 'post_type' => 'certificate'), $prefix . 'course_passing_percentage' => array('label' => __('Passing Percentage', 'vibe-customtypes'), 'desc' => __('Course passing percentage, for completion certificate', 'vibe-customtypes'), 'id' => $prefix . 'course_passing_percentage', 'type' => 'number'), $prefix . 'course_drip' => array('label' => __('Drip Feed', 'vibe-customtypes'), 'desc' => __('Enable Drip Feed course', 'vibe-customtypes'), 'id' => $prefix . 'course_drip', 'type' => 'yesno', 'options' => array(array('value' => 'H', 'label' => 'Hide'), array('value' => 'S', 'label' => 'Show')), 'std' => 'H'), $prefix . 'course_drip_duration' => array('label' => __('Drip Feed Duration', 'vibe-customtypes'), 'desc' => __('Duration between consecutive Drip feed units (in ', 'vibe-customtypes') . calculate_duration_time($drip_duration_parameter) . ' )', 'id' => $prefix . 'course_drip_duration', 'type' => 'number'), $prefix . 'course_curriculum' => array('label' => __('Course Curriculum', 'vibe-customtypes'), 'desc' => __('Set Course Curriculum, prepare units and quizes before setting up curriculum', 'vibe-customtypes'), 'id' => $prefix . 'course_curriculum', 'post_type1' => 'unit', 'post_type2' => 'quiz', 'type' => 'curriculum'), $prefix . 'pre_course' => array('label' => __('Pre-Required Course', 'vibe-customtypes'), 'desc' => __('Pre Required course for this course', 'vibe-customtypes'), 'id' => $prefix . 'pre_course', 'type' => 'selectmulticpt', 'post_type' => 'course'), $prefix . 'course_retakes' => array('label' => __('Course Retakes', 'vibe-customtypes'), 'desc' => __('Set number of times a student can re-take the course (0 to disable)', 'vibe-customtypes'), 'id' => $prefix . 'course_retakes', 'type' => 'number', 'std' => 0), $prefix . 'forum' => array('label' => __('Course Forum', 'vibe-customtypes'), 'desc' => __('Connect Forum with Course.', 'vibe-customtypes'), 'id' => $prefix . 'forum', 'type' => 'selectcpt', 'post_type' => 'forum'), $prefix . 'group' => array('label' => __('Course Group', 'vibe-customtypes'), 'desc' => __('Connect a Group with Course.', 'vibe-customtypes'), 'id' => $prefix . 'group', 'type' => 'groups'), $prefix . 'course_instructions' => array('label' => __('Course specific instructions', 'vibe-customtypes'), 'desc' => __('Course s
|
请发表评论