本文整理汇总了PHP中mycred_types_select_from_dropdown函数的典型用法代码示例。如果您正苦于以下问题:PHP mycred_types_select_from_dropdown函数的具体用法?PHP mycred_types_select_from_dropdown怎么用?PHP mycred_types_select_from_dropdown使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mycred_types_select_from_dropdown函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: my_history_screen
/**
* My History Content
* @since 0.1
* @version 1.2
*/
public function my_history_screen()
{
global $bp;
$mycred_types = mycred_get_types();
$type = 'mycred_default';
if (isset($_REQUEST['show-ctype']) && array_key_exists($_REQUEST['show-ctype'], $mycred_types)) {
$type = $_REQUEST['show-ctype'];
}
$args = array('user_id' => bp_displayed_user_id(), 'number' => apply_filters('mycred_bp_history_num_to_show', $this->buddypress['history_num']), 'ctype' => $type);
if (isset($_GET['paged']) && $_GET['paged'] != '') {
$args['paged'] = $_GET['paged'];
}
if (isset($bp->canonical_stack['action']) && $bp->canonical_stack['action'] != $this->buddypress['history_url']) {
$args['time'] = $bp->canonical_stack['action'];
}
$log = new myCRED_Query_Log($args);
unset($log->headers['column-username']);
ob_start();
if (count($mycred_types) > 1) {
?>
<form action="" id="mycred-sort-cred-history-form" method="get" style="display: block; height: 48px; float: right;"><label>Show:</label> <?php
mycred_types_select_from_dropdown('show-ctype', 'mycred-select-type', $type);
?>
<input type="submit" class="btn btn-large btn-primary button button-large button-primary" value="<?php
_e('Go', 'mycred');
?>
" /></form>
<?php
}
?>
<style type="text/css">
.pagination-links { float: right; }
.tablenav { vertical-align: middle; }
</style>
<div class="wrap" id="myCRED-wrap">
<?php
$log->mobile_support();
?>
<form method="get" action="">
<div class="tablenav top clear clearfix">
<?php
if ($log->have_entries() && $log->max_num_pages > 1) {
$log->navigation('top');
}
?>
</div>
<?php
$log->display();
?>
<div class="tablenav bottom clear clearfix">
<?php
if ($log->have_entries() && $log->max_num_pages > 1) {
$log->navigation('bottom');
}
?>
</div>
</form>
</div>
<?php
$log->reset_query();
$output = ob_get_contents();
ob_end_clean();
echo apply_filters('mycred_bp_history_page', $output, $this);
}
示例2: gateway_settings
/**
* Gateway Settings
* Included first when the gateway is activated.
* @since 1.2
* @version 1.2
*/
public function gateway_settings()
{
global $org_options;
$exchange_message = sprintf(__('How many %s is 1 %s worth?', 'mycred'), $this->core->plural(), $org_options['currency_symbol']);
$mycred_types = mycred_get_types();
?>
<?php
if ($this->update) {
?>
<h2 style="color: green;"><?php
_e('Gateways Settings Successfully Updated', 'mycred');
?>
</h2>
<?php
}
?>
<form method="post" action="<?php
echo $_SERVER['REQUEST_URI'];
?>
#mycred-gate">
<?php
do_action('mycred_espresso_before_prefs');
?>
<table width="99%" border="0" cellspacing="5" cellpadding="5">
<tr>
<td valign="top">
<h4><?php
_e('Labels', 'mycred');
?>
</h4>
<ul>
<li>
<label for="mycred-prefs-gateway-labels"><?php
_e('Gateway Title', 'mycred');
?>
</label>
<input type="text" name="mycred_prefs[labels][gateway]" id="mycred-prefs-gateway-labels" size="30" value="<?php
echo $this->prefs['labels']['gateway'];
?>
" /><br />
<span class="description"><?php
_e('Title to show on Payment page', 'mycred');
?>
.</span>
</li>
<li>
<label for="mycred-prefs-payment-labels"><?php
_e('Payment Type', 'mycred');
?>
</label>
<input type="text" name="mycred_prefs[labels][payment]" id="mycred-prefs-payment-labels" size="30" value="<?php
echo $this->prefs['labels']['payment'];
?>
" /><br />
<span class="description"><?php
_e('Title to show on receipts and logs', 'mycred');
?>
.</span>
</li>
<li>
<label for="mycred-prefs-button-labels"><?php
_e('Button Label', 'mycred');
?>
</label>
<input type="text" name="mycred_prefs[labels][button]" id="mycred-prefs-button-labels" size="30" value="<?php
echo $this->prefs['labels']['button'];
?>
" /><br />
<span class="description"><?php
_e('Pay Button', 'mycred');
?>
</span>
</li>
</ul>
<?php
if (count($mycred_types) > 1) {
?>
<ul>
<li>
<label for="mycred-prefs-payment-type"><?php
_e('Point Type', 'mycred');
?>
</label>
<?php
mycred_types_select_from_dropdown('mycred_prefs[type]', 'mycred-prefs-payment-type', $this->prefs['type']);
?>
</li>
</ul>
<?php
} else {
//.........这里部分代码省略.........
示例3: mysettings
/**
* Getway Settings
* @since 1.3
* @version 1.3
*/
function mysettings()
{
global $page, $action;
$gateway_link = admin_url('edit.php?post_type=' . EM_POST_TYPE_EVENT . '&page=events-manager-options#bookings');
if ($this->prefs['setup'] == 'multi') {
$box = 'display: block;';
} else {
$box = 'display: none;';
}
$exchange_message = sprintf(__('How many %s is 1 %s worth?', 'mycred'), $this->core->plural(), em_get_currency_symbol());
$mycred_types = mycred_get_types();
do_action('mycred_em_before_settings', $this);
?>
<h4><?php
_e('Setup', 'mycred');
?>
</h4>
<table class="form-table">
<?php
if (count($mycred_types) > 1) {
?>
<tr>
<th scope="row"><?php
_e('Point Type', 'mycred');
?>
</th>
<td>
<?php
mycred_types_select_from_dropdown('mycred_gateway[type]', 'mycred-gateway-type', $this->prefs['type']);
?>
</td>
</tr>
<?php
} else {
?>
<input type="hidden" name="mycred_gateway[type]" value="mycred_default" />
<?php
}
?>
<tr>
<th scope="row"><?php
_e('Payments', 'mycred');
?>
</th>
<td>
<input type="radio" name="mycred_gateway[setup]" id="mycred-gateway-setup-off" value="off"<?php
checked($this->prefs['setup'], 'off');
?>
/> <label for="mycred-gateway-setup-off"><?php
echo $this->core->template_tags_general(__('Disabled - Users CAN NOT pay for tickets using %plural%.', 'mycred'));
?>
</label><br />
<input type="radio" name="mycred_gateway[setup]" id="mycred-gateway-setup-single" value="single"<?php
checked($this->prefs['setup'], 'single');
?>
/> <label for="mycred-gateway-setup-single"><?php
echo $this->core->template_tags_general(__('Single - Users can ONLY pay for tickets using %plural%.', 'mycred'));
?>
</label><br />
<input type="radio" name="mycred_gateway[setup]" id="mycred-gateway-setup-multi" value="multi"<?php
checked($this->prefs['setup'], 'multi');
?>
/> <label for="mycred-gateway-setup-multi"><?php
echo $this->core->template_tags_general(__('Multi - Users can pay for tickets using other gateways or %plural%.', 'mycred'));
?>
</label>
</td>
</tr>
<tr>
<th scope="row"><?php
_e('Refunds', 'mycred');
?>
</th>
<td>
<input name="mycred_gateway[refund]" type="text" id="mycred-gateway-log-refund" value="<?php
echo $this->prefs['refund'];
?>
" size="5" /> %<br />
<span class="description"><?php
_e('The percentage of the paid amount to refund if a user cancels their booking. Use zero for no refunds. No refunds are given to "Rejected" bookings!', 'mycred');
?>
</span>
</td>
</tr>
<tr>
<th scope="row"><?php
_e('Profit Sharing', 'mycred');
?>
</th>
<td>
//.........这里部分代码省略.........
示例4: after_general_settings
/**
* Settings Page
* @since 0.1
* @version 1.3
*/
public function after_general_settings($mycred)
{
$sell_content = $this->sell_content;
if (!isset($sell_content['defaults']['expire'])) {
$sell_content['defaults']['expire'] = 0;
}
$before = $this->core->before;
$after = $this->core->after;
$payees = array('none' => __('No Payout. Just charge.'), 'author' => __('Pay Content Author.'));
$available_payees = apply_filters('mycred_sell_content_payees', $payees, $sell_content);
?>
<h4><div class="icon icon-active"></div><?php
_e('Sell Content', 'mycred');
?>
</h4>
<div class="body" style="display:none;">
<label class="subheader" for="<?php
echo $this->field_id('post_types');
?>
"><?php
_e('Post Types', 'mycred');
?>
</label>
<ol id="myCRED-buy-postypes">
<li>
<div class="h2"><input type="text" name="<?php
echo $this->field_name('post_types');
?>
" id="<?php
echo $this->field_id('post_types');
?>
" value="<?php
echo $sell_content['post_types'];
?>
" class="long" /></div>
<span class="description"><?php
_e('Comma separated list of post types that can be sold.', 'mycred');
?>
</span>
</li>
</ol>
<?php
if (count($this->point_types) > 1) {
?>
<label class="subheader" for="<?php
echo $this->field_id('type');
?>
"><?php
_e('Point Type', 'mycred');
?>
</label>
<ol id="myCRED-buy-point-type">
<li>
<?php
mycred_types_select_from_dropdown($this->field_name('type'), $this->field_name('type'), $sell_content['type']);
?>
</li>
</ol>
<?php
} else {
?>
<input type="hidden" name="<?php
echo $this->field_name('type');
?>
" id="<?php
echo $this->field_name('type');
?>
" value="mycred_default" />
<?php
}
?>
<label class="subheader"><?php
_e('Payments', 'mycred');
?>
</label>
<ol id="myCRED-buy-payments">
<?php
if (!empty($available_payees)) {
foreach ($available_payees as $key => $description) {
?>
<li>
<input type="radio" name="<?php
echo $this->field_name('pay');
?>
" id="<?php
echo $this->field_id(array('pay' => $key));
?>
" <?php
checked($sell_content['pay'], $key);
?>
//.........这里部分代码省略.........
示例5: metabox_coupon_setup
/**
* Metabox: Coupon Setup
* @since 1.4
* @version 1.1
*/
public function metabox_coupon_setup($post)
{
global $mycred;
$value = get_post_meta($post->ID, 'value', true);
if (empty($value)) {
$value = 1;
}
$expires = get_post_meta($post->ID, 'expires', true);
$set_type = get_post_meta($post->ID, 'type', true);
?>
<style type="text/css">
table { width: 100%; }
table th { width: 20%; text-align: right; }
table th label { padding-right: 12px; }
table td { width: 80%; padding-bottom: 6px; }
table td textarea { width: 95%; }
#submitdiv .misc-pub-curtime, #submitdiv #visibility, #submitdiv #misc-publishing-actions { display: none; }
#submitdiv #minor-publishing-actions { padding-bottom: 10px; }
<?php
if ($post->post_status == 'publish') {
?>
#submitdiv #minor-publishing-actions { padding: 0 0 0 0; }
<?php
}
?>
</style>
<input type="hidden" name="mycred-coupon-nonce" value="<?php
echo wp_create_nonce('update-mycred-coupon');
?>
" />
<table class="table wide-fat">
<tbody>
<tr valign="top">
<th scope="row"><label for="mycred-coupon-value"><?php
_e('Value', 'mycred');
?>
</label></th>
<td>
<input type="text" name="mycred_coupon[value]" id="mycred-coupon-value" value="<?php
echo $mycred->number($value);
?>
" /><br />
<span class="description"><?php
echo $mycred->template_tags_general(__('The amount of %plural% this coupon is worth.', 'mycred'));
?>
</span>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mycred-coupon-value"><?php
_e('Point Type', 'mycred');
?>
</label></th>
<td>
<?php
if (count($this->point_types) > 1) {
?>
<?php
mycred_types_select_from_dropdown('mycred_coupon[type]', 'mycred-coupon-type', $set_type);
?>
<br />
<span class="description"><?php
_e('Select the point type that this coupon is applied.', 'mycred');
?>
</span>
<?php
} else {
?>
<?php
echo $this->core->plural();
?>
<?php
}
?>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mycred-coupon-value"><?php
_e('Expire', 'mycred');
?>
</label></th>
<td>
<input type="text" name="mycred_coupon[expires]" id="mycred-coupon-expire" value="<?php
echo $expires;
?>
" placeholder="YYYY-MM-DD" /><br />
<span class="description"><?php
_e('Optional date when this coupon expires. Expired coupons will be trashed.', 'mycred');
?>
</span>
//.........这里部分代码省略.........
示例6: form
/**
* Outputs the options form on admin
*/
function form($instance)
{
// Defaults
$title = isset($instance['title']) ? esc_attr($instance['title']) : __('Leaderboard', 'mycred');
$type = isset($instance['type']) ? $instance['type'] : 'mycred_default';
$based_on = isset($instance['based_on']) ? esc_attr($instance['based_on']) : 'balance';
$number = isset($instance['number']) ? abs($instance['number']) : 5;
$show_visitors = isset($instance['show_visitors']) ? $instance['show_visitors'] : 0;
$text = isset($instance['text']) ? esc_attr($instance['text']) : '#%position% %user_profile_link% %cred_f%';
$offset = isset($instance['offset']) ? esc_attr($instance['offset']) : 0;
$order = isset($instance['order']) ? esc_attr($instance['order']) : 'DESC';
$current = isset($instance['current']) ? $instance['current'] : 0;
$mycred = mycred($type);
$mycred_types = mycred_get_types();
?>
<p class="myCRED-widget-field">
<label for="<?php
echo esc_attr($this->get_field_id('title'));
?>
"><?php
_e('Title', 'mycred');
?>
:</label>
<input class="widefat" id="<?php
echo esc_attr($this->get_field_id('title'));
?>
" name="<?php
echo esc_attr($this->get_field_name('title'));
?>
" type="text" value="<?php
echo esc_attr($title);
?>
" />
</p>
<?php
if (count($mycred_types) > 1) {
?>
<p class="myCRED-widget-field">
<label for="<?php
echo esc_attr($this->get_field_id('type'));
?>
"><?php
_e('Point Type', 'mycred');
?>
:</label>
<?php
mycred_types_select_from_dropdown($this->get_field_name('type'), $this->get_field_id('type'), $type);
?>
</p>
<?php
} else {
?>
<?php
mycred_types_select_from_dropdown($this->get_field_name('type'), $this->get_field_id('type'), $type);
?>
<?php
}
?>
<p class="myCRED-widget-field">
<label for="<?php
echo esc_attr($this->get_field_id('based_on'));
?>
"><?php
_e('Based On', 'mycred');
?>
:</label>
<input class="widefat" id="<?php
echo esc_attr($this->get_field_id('based_on'));
?>
" name="<?php
echo esc_attr($this->get_field_name('based_on'));
?>
" type="text" value="<?php
echo esc_attr($based_on);
?>
" />
<small><?php
_e('Use "balance" to base the leaderboard on your users current balances or use a specific reference.', 'mycred');
?>
<a href="http://codex.mycred.me/reference-guide/log-references/" target="_blank"><?php
_e('Reference Guide', 'mycred');
?>
</a></small>
</p>
<p class="myCRED-widget-field">
<input type="checkbox" name="<?php
echo esc_attr($this->get_field_name('show_visitors'));
?>
" id="<?php
echo esc_attr($this->get_field_id('show_visitors'));
?>
" value="1"<?php
checked($show_visitors, 1);
//.........这里部分代码省略.........
示例7: mycred_wpecom_gateway_settings
function mycred_wpecom_gateway_settings()
{
global $wpdb, $mycred_wpecom_settings;
if (!isset($mycred_wpecom_settings['type'])) {
$type = 'mycred_default';
} else {
$type = $mycred_wpecom_settings['type'];
}
$mycred = mycred($type);
// Get current currency
$currency_data = $wpdb->get_results("SELECT * FROM `" . WPSC_TABLE_CURRENCY_LIST . "` ORDER BY `country` ASC", ARRAY_A);
$selected_currency = esc_attr(get_option('currency_type'));
foreach ($currency_data as $currency) {
if ($selected_currency != $currency['id']) {
continue;
} else {
if (!empty($currency['symbol_html'])) {
$selected_currency = $currency['symbol_html'];
} else {
$selected_currency = $currency['code'];
}
break;
}
}
$output = '
<tr>
<td colspan="2"><strong>' . __('General', 'mycred') . '</strong></td>
</tr>
<tr>
<td width="150">' . __('Log Template for Payments', 'mycred') . '</td>
<td><input type="text" name="mycred_gateway[log]" value="' . esc_attr($mycred_wpecom_settings['log']) . '" style="width:50%;" /><br /><span class="description">' . $mycred->available_template_tags(array('general'), '%order_id%') . '</span></td>
</tr>';
$mycred_types = mycred_get_types();
if (count($mycred_types) == 1) {
$output .= '<input type="hidden" name="mycred_gateway[type]" value="mycred_default" />';
} else {
$output .= '
<tr>
<td width="150">' . __('Point Type', 'mycred') . '</td>
<td>' . mycred_types_select_from_dropdown('mycred_gateway[type]', 'mycred-point-type', $type, true) . '</td>
</tr>';
}
$output .= '
<tr>
<td width="150">' . __('Exchange Rate', 'mycred') . '</td>
<td><input type="text" name="mycred_gateway[rate]" value="' . esc_attr($mycred_wpecom_settings['rate']) . '" style="width:50px;" /><br /><span class="description">' . sprintf(__('How much is 1 %s worth in %s', 'mycred'), $selected_currency, $mycred->plural()) . '</span></td>
</tr>
<tr>
<td colspan="2"><strong>' . __('Profit Sharing', 'mycred') . '</strong></td>
</tr>
<tr>
<td width="150">' . __('Payout', 'mycred') . '</td>
<td><input type="text" name="mycred_gateway[share]" value="' . esc_attr($mycred_wpecom_settings['share']) . '" style="width:50px;" /> %<br /><span class="description">' . __('Option to share sales with the product owner. Use zero to disable.', 'mycred') . '</span></td>
</tr>
<tr>
<td width="150">' . __('Log Template', 'mycred') . '</td>
<td><input type="text" name="mycred_gateway[share_log]" value="' . esc_attr($mycred_wpecom_settings['share_log']) . '" style="width:50%;" /><br /><span class="description">' . $mycred->available_template_tags(array('general', 'post')) . '</span></td>
</tr>
<tr>
<td colspan="2"><strong>' . __('Messages', 'mycred') . '</strong></td>
</tr>
<tr>
<td width="150">' . __('Instructions', 'mycred') . '</td>
<td><input type="text" name="mycred_gateway[message]" value="' . esc_attr($mycred_wpecom_settings['message']) . '" style="width:50%;" /><br /><span class="description">' . __('Optional instructions to show users when selecting this gateway. Leave empty to hide.', 'mycred') . '</span></td>
</tr>
<tr>
<td width="150">' . __('Visitors', 'mycred') . '</td>
<td><input type="text" name="mycred_gateway[visitor]" value="' . esc_attr($mycred_wpecom_settings['visitor']) . '" style="width:50%;" /><br /><span class="description">' . __('Message to show visitors who are not logged in.', 'mycred') . '</span></td>
</tr>
<tr>
<td width="150">' . __('Insufficient Funds', 'mycred') . '</td>
<td><input type="text" name="mycred_gateway[low_funds]" value="' . esc_attr($mycred_wpecom_settings['low_funds']) . '" style="width:50%;" /><br /><span class="description">' . $mycred->template_tags_general(__('Message to show when users does not have enough %plural% to pay using this gateway.', 'mycred')) . '</span></td>
</tr>';
return apply_filters('mycred_wpecom_settings', $output);
}
示例8: rank_settings
/**
* Rank Settings Metabox
* @since 1.1
* @version 1.1
*/
public function rank_settings($post)
{
// Get type
$type = get_post_meta($post->ID, 'ctype', true);
if ($type == '') {
$type = 'mycred_default';
update_post_meta($post->ID, 'ctype', $type);
}
// If a custom type has been requested via the URL
if (isset($_REQUEST['ctype']) && !empty($_REQUEST['ctype'])) {
$type = sanitize_text_field($_REQUEST['ctype']);
}
// Load the appropriate type object
$mycred = $this->core;
if ($type != 'mycred_default') {
$mycred = mycred($type);
}
// Get min and max setting for this rank
$min = get_post_meta($post->ID, 'mycred_rank_min', true);
$max = get_post_meta($post->ID, 'mycred_rank_max', true);
?>
<style type="text/css">
#submitdiv .misc-pub-curtime { display: none; }
#mycred_rank_settings .inside { margin: 0; padding: 0; clear: both; }
#mycred_rank_settings .inside #mycred-rank-setup-wrapper { float: none; clear: both; }
#mycred_rank_settings .inside #mycred-rank-setup-wrapper .box { width: 48%; float: left; margin: 0; padding: 0; }
#mycred_rank_settings .inside #mycred-rank-setup-wrapper .box .wrap { padding: 12px; margin: 0; }
#mycred_rank_settings .inside #mycred-rank-setup-wrapper .border { border-right: 1px solid #ddd; margin-right: -1px; }
#mycred_rank_settings .inside #mycred-rank-setup-wrapper p { margin: 0 0 0 0; }
#mycred_rank_settings .inside #mycred-rank-setup-wrapper ul li strong { display: inline-block; width: 60%; }
#mycred_rank_settings .inside #mycred-rank-setup-wrapper label { font-weight: bold; display: block; }
#mycred_rank_settings .inside #mycred-rank-setup-wrapper input[type="text"],
#mycred_rank_settings .inside #mycred-rank-setup-wrapper select { min-width: 60%; margin-bottom: 12px; }
</style>
<div id="mycred-rank-setup-wrapper">
<div class="box border">
<div class="wrap">
<p>
<label for="mycred-rank-min"><?php
echo $mycred->template_tags_general(__('Minimum %plural% to reach this rank', 'mycred'));
?>
:</label>
<input type="text" name="mycred_rank[min]" id="mycred-rank-min" value="<?php
echo $min;
?>
" />
</p>
<p>
<label for="mycred-rank-max"><?php
echo $mycred->template_tags_general(__('Maximum %plural% to be included in this rank', 'mycred'));
?>
:</label>
<input type="text" name="mycred_rank[max]" id="mycred-rank-max" value="<?php
echo $max;
?>
" />
</p>
<?php
if (count($this->point_types) > 1) {
?>
<p>
<label for="mycred-rank-point-type"><?php
_e('Point Type', 'mycred');
?>
</label>
<?php
mycred_types_select_from_dropdown('mycred_rank[ctype]', 'mycred-rank-point-type', $type);
?>
</p>
<?php
} else {
?>
<input type="hidden" name="mycred_rank[ctype]" value="mycred_default" />
<?php
}
?>
<?php
do_action('mycred_rank_after_req', $post, $this->core);
?>
</div>
</div>
<div class="box">
<div class="wrap">
<p><?php
_e('All Published Ranks', 'mycred');
?>
:</p>
<?php
//.........这里部分代码省略.........
示例9: metabox_badge_requirements
//.........这里部分代码省略.........
<input type="button" data-target="default-image" id="mycred-add-default-image" class="button button-primary mycred-badge-load-image" value="<?php
_e('Add Image', 'mycred');
?>
" />
<p><span class="description"><?php
_e('Optional image to show when a user has not yet earned this badge.', 'mycred');
?>
</span></p>
</td>
</tr>
<?php
foreach ($requirements as $row => $needs) {
// First row
if ($row == 0) {
if (!isset($needs['by'])) {
$needs = array('type' => '', 'reference' => '', 'amount' => '', 'by' => '');
}
?>
<tr class="badge-requires" id="badge-requirement-<?php
echo $row;
?>
">
<td class="level"><?php
printf(__('Level %d', 'mycred'), $row + 1);
?>
</td>
<td class="type">
<?php
if (count($this->point_types) == 1) {
echo $this->core->plural();
}
?>
<?php
mycred_types_select_from_dropdown('mycred_badge[req][' . $row . '][type]', 'default-badge-req-type', $needs['type']);
?>
</td>
<td class="for"><?php
_e('for', 'mycred');
?>
</td>
<td class="reference">
<select name="mycred_badge[req][<?php
echo $row;
?>
][reference]" id="default-badge-req-reference"><?php
foreach ($references as $ref => $label) {
echo '<option value="' . $ref . '"';
if ($needs['reference'] == $ref) {
echo ' selected="selected"';
}
echo '>' . $label . '</option>';
}
?>
</select>
</td>
<td class="amount">
<input type="text" size="8" name="mycred_badge[req][<?php
echo $row;
?>
][amount]" id="default-badge-req-amount" value="<?php
echo $needs['amount'];
?>
" />
</td>
<td class="sum">
<select name="mycred_badge[req][<?php
示例10: gateway_settings_box
/**
* myCRED Gateway Settings
* @since 1.1
* @version 1.3
*/
function gateway_settings_box($settings)
{
global $mp;
$settings = get_option('mp_settings');
$mycred = mycred();
$name = mycred_label(true);
$settings['gateways']['mycred'] = shortcode_atts(array('name' => $name . ' ' . $mycred->template_tags_general(__('%_singular% Balance', 'mycred')), 'logo' => $this->method_button_img_url, 'type' => 'mycred_default', 'log_template' => __('Payment for Order: #%order_id%', 'mycred'), 'exchange' => 1, 'profit_share_percent' => 0, 'profit_share_log' => __('Product Sale: %post_title%', 'mycred'), 'instructions' => __('Pay using your account balance.', 'mycred'), 'confirmation' => __('TOTAL amount has been deducted from your account. Your current balance is: %balance_f%', 'mycred'), 'lowfunds' => __('Insufficient funds.', 'mycred'), 'visitors' => __('You must be logged in to pay with %_plural%. Please <a href="%login_url_here%">login</a>.', 'mycred'), 'email' => $settings['email']['new_order_txt']), isset($settings['gateways']['mycred']) ? $settings['gateways']['mycred'] : array());
?>
<div id="mp_mycred_payments" class="postbox mp-pages-msgs">
<h3 class="handle"><span><?php
echo $name . ' ' . __('Settings', 'mycred');
?>
</span></h3>
<div class="inside">
<span class="description"><?php
echo sprintf(__('Let your users pay for items in their shopping cart using their %s Account. Note! This gateway requires your users to be logged in when making a purchase!', 'mycred'), $name);
?>
</span>
<table class="form-table">
<tr>
<th scope="row"><label for="mycred-method-name"><?php
_e('Method Name', 'mycred');
?>
</label></th>
<td>
<span class="description"><?php
_e('Enter a public name for this payment method that is displayed to users - No HTML', 'mycred');
?>
</span>
<p><input value="<?php
echo esc_attr($settings['gateways']['mycred']['name']);
?>
" style="width: 100%;" name="mp[gateways][mycred][name]" id="mycred-method-name" type="text" /></p>
</td>
</tr>
<tr>
<th scope="row"><label for="mycred-method-logo"><?php
_e('Gateway Logo URL', 'mycred');
?>
</label></th>
<td>
<p><input value="<?php
echo esc_attr($settings['gateways']['mycred']['logo']);
?>
" style="width: 100%;" name="mp[gateways][mycred][logo]" id="mycred-method-logo" type="text" /></p>
</td>
</tr>
<tr>
<th scope="row"><label for="mycred-method-type"><?php
_e('Point Type', 'mycred');
?>
</label></th>
<td>
<?php
mycred_types_select_from_dropdown('mp[gateways][mycred][type]', 'mycred-method-type', $settings['gateways']['mycred']['type']);
?>
</td>
</tr>
<tr>
<th scope="row"><label for="mycred-log-template"><?php
_e('Log Template', 'mycred');
?>
</label></th>
<td>
<span class="description"><?php
echo $mycred->available_template_tags(array('general'), '%order_id%, %order_link%');
?>
</span>
<p><input value="<?php
echo esc_attr($settings['gateways']['mycred']['log_template']);
?>
" style="width: 100%;" name="mp[gateways][mycred][log_template]" id="mycred-log-template" type="text" /></p>
</td>
</tr>
<?php
// Exchange rate
if ($this->use_exchange()) {
$exchange_desc = __('How much is 1 %_singular% worth in %currency%?', 'mycred');
$exchange_desc = $mycred->template_tags_general($exchange_desc);
$exchange_desc = str_replace('%currency%', $settings['currency'], $exchange_desc);
?>
<tr>
<th scope="row"><label for="mycred-exchange-rate"><?php
_e('Exchange Rate', 'mycred');
?>
</label></th>
<td>
<span class="description"><?php
echo $exchange_desc;
?>
</span>
<p><input value="<?php
echo esc_attr($settings['gateways']['mycred']['exchange']);
//.........这里部分代码省略.........
示例11: greet
/**
* greet function.
*/
function greet()
{
global $wpdb, $mycred;
$actions = array('' => __('Select what to import', 'mycred'), 'log' => __('Log Entries Only', 'mycred'), 'balance' => __('CubePoints Balances Only', 'mycred'), 'both' => __('Log Entries and Balances', 'mycred'));
$action = 'admin.php?import=mycred_import_cp&step=1';
$mycred_types = mycred_get_types();
echo '<div class="narrow">';
echo '<p>' . __('Import CubePoints log entries and / or balances.', 'mycred') . '</p>';
?>
<form id="import-setup" method="post" action="<?php
echo esc_attr(wp_nonce_url($action, 'import-upload'));
?>
">
<table class="form-table">
<tbody>
<tr>
<th>
<label for="import-action"><?php
_e('Import', 'mycred');
?>
</label>
</th>
<td>
<select name="action" id="import-action"><?php
foreach ($actions as $action => $label) {
echo '<option value="' . $action . '">' . $label . '</option>';
}
?>
</select><br />
<span class="description"><?php
_e('Warning! Importing CubePoints balances will replace your users myCRED balance!', 'mycred');
?>
</span>
</td>
</tr>
<tr>
<th>
<label for="import-action"><?php
_e('Point Type', 'mycred');
?>
</label>
</th>
<td>
<?php
if (count($mycred_types) == 1) {
?>
<strong><?php
echo $mycred->plural();
?>
</strong><input type="hidden" name="type" value="mycred_default" />
<?php
} else {
?>
<?php
mycred_types_select_from_dropdown('type', 'mycred-type', 'mycred_default');
?>
<?php
}
?>
</td>
</tr>
</tbody>
</table>
<p class="submit">
<input type="submit" class="button" value="<?php
esc_attr_e('Import Log');
?>
" />
</p>
</form>
<?php
echo '</div>';
}
示例12: metabox_wplms_setup
/**
* Metabox: wplms Setup
* @since 1.4
* @version 1.0
*/
public function metabox_wplms_setup($post)
{
global $mycred;
$value = get_post_meta($post->ID, 'value', true);
if (empty($value)) {
$value = 1;
}
$expires = get_post_meta($post->ID, 'expires', true);
?>
<style type="text/css">
table { width: 100%; }
table th { width: 20%; text-align: right; }
table th label { padding-right: 12px; }
table td { width: 80%; padding-bottom: 6px; }
table td textarea { width: 95%; }
</style>
<input type="hidden" name="mycred-wplms-nonce" value="<?php
echo wp_create_nonce('update-mycred-wplms');
?>
" />
<table class="table wide-fat">
<tbody>
<tr valign="top">
<th scope="row"><label for="mycred-wplms-value"><?php
_e('Value', 'wplms-mycred');
?>
</label></th>
<td>
<input type="text" name="mycred_wplms[value]" id="mycred-wplms-value" value="<?php
echo $mycred->number($value);
?>
" /><br />
<span class="description"><?php
echo $mycred->template_tags_general(__('The amount of %plural% this wplms is worth.', 'wplms-mycred'));
?>
</span>
<?php
if (count($mycred_types) > 1) {
?>
<br /><label for="mycred-wplms-type"><?php
_e('Point Type', 'wplms-mycred');
?>
</label><br /><?php
mycred_types_select_from_dropdown('mycred_wplms[type]', 'mycred-wplms-type', $set_type);
?>
<span class="description"><?php
_e('Select the point type that this wplms is applied.', 'wplms-mycred');
?>
</span>
<?php
}
?>
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="mycred-wplms-value"><?php
_e('Expire', 'wplms-mycred');
?>
</label></th>
<td>
<input type="text" name="mycred_wplms[expires]" id="mycred-wplms-expire" value="<?php
echo $expires;
?>
" placeholder="YYYY-MM-DD" /><br />
<span class="description"><?php
_e('Optional date when this wplms points criteria expires. Expired WPLMS points criterias will be trashed.', 'wplms-mycred');
?>
</span>
</td>
</tr>
</tbody>
</table>
<?php
do_action('mycred_wplms_after_setup', $post);
?>
<?php
}
示例13: metabox_badge_requirements
/**
* Badge Preferences Metabox
* @version 1.0
*/
public function metabox_badge_requirements($post)
{
$requirements = mycred_get_badge_requirements($post->ID, true);
$types = mycred_get_types();
$references = mycred_get_all_references();
$sums = array('count' => __('Time(s)', 'mycred'), 'sum' => __('In total', 'mycred'));
?>
<style type="text/css">
#mycred-remove-badge-connections { float: right; }
#mycred-badge-actions { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid #ccc; }
<?php
if ($post->post_status != 'publish') {
?>
#minor-publishing-actions { padding-bottom: 12px; }
<?php
} else {
?>
#minor-publishing-actions { display: none; }
<?php
}
?>
#misc-publishing-actions { display: none; display: none !important; }
table#setup-badge-reqs { width: 100%; }
table#setup-badge-reqs td.type { width: 25%; }
table#setup-badge-reqs td.for { width: 5%; }
table#setup-badge-reqs td.reference { width: 50%; }
table#setup-badge-reqs td.amount { width: 10%; }
table#setup-badge-reqs td.sum { width: 10%; }
p.actions { text-align: right; }
</style>
<script type="text/javascript">
jQuery(function($) {
$( '#postimagediv h3.hndle span' ).empty().text( '<?php
_e('Badge Image', 'mycred');
?>
' );
$( '#postimagediv div.inside p a' ).attr( 'title', '<?php
_e('Set badge image', 'mycred');
?>
' ).empty().text( '<?php
_e('Set badge image', 'mycred');
?>
' );
});
</script>
<p>To earn this badge, a user must have received:</p>
<table class="table" style="width: 100%;" id="setup-badge-reqs">
<?php
do_action('mycred_edit_badge_before_req', $post);
?>
<?php
foreach ($requirements as $row => $needs) {
if (!isset($needs['by'])) {
$needs = array('type' => '', 'reference' => '', 'amount' => '', 'by' => '');
}
?>
<tr class="badge-requires" id="badge-requirement-<?php
echo $row;
?>
">
<td class="type">
<?php
mycred_types_select_from_dropdown('mycred_badge[req][' . $row . '][type]', '', $needs['type']);
?>
</td>
<td class="for">for</td>
<td class="reference">
<select name="mycred_badge[req][<?php
echo $row;
?>
][reference]" id=""><?php
foreach ($references as $ref => $label) {
echo '<option value="' . $ref . '"';
if ($needs['reference'] == $ref) {
echo ' selected="selected"';
}
echo '>' . $label . '</option>';
}
?>
</select>
</td>
<td class="amount">
<input type="text" size="8" name="mycred_badge[req][<?php
echo $row;
?>
][amount]" id="" value="<?php
echo $needs['amount'];
?>
" />
</td>
<td class="sum">
<select name="mycred_badge[req][<?php
echo $row;
//.........这里部分代码省略.........