当前位置: 首页>>代码示例>>PHP>>正文


PHP mycred_label函数代码示例

本文整理汇总了PHP中mycred_label函数的典型用法代码示例。如果您正苦于以下问题:PHP mycred_label函数的具体用法?PHP mycred_label怎么用?PHP mycred_label使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了mycred_label函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Construct 
  */
 function __construct()
 {
     // Default settings
     $defaults = array('setup' => 'off', 'type' => 'mycred_default', 'rate' => 100, 'share' => 0, 'log' => array('purchase' => __('Payment for tickets to %link_with_title%', 'mycred'), 'refund' => __('Ticket refund for %link_with_title%', 'mycred')), 'refund' => 0, 'labels' => array('header' => __('Pay using your %_plural% balance', 'mycred'), 'button' => __('Pay Now', 'mycred'), 'link' => __('Pay', 'mycred'), 'checkout' => __('%plural% Cost', 'mycred')), 'messages' => array('success' => __('Thank you for your payment!', 'mycred'), 'error' => __("I'm sorry but you can not pay for these tickets using %_plural%", 'mycred')));
     // Settings
     $settings = get_option('mycred_eventsmanager_gateway_prefs');
     $this->prefs = mycred_apply_defaults($defaults, $settings);
     $this->mycred_type = $this->prefs['type'];
     // Load myCRED
     $this->core = mycred($this->mycred_type);
     // Apply Whitelabeling
     $this->label = mycred_label();
     $this->title = strip_tags($this->label);
     $this->status_txt = 'Paid using ' . strip_tags($this->label);
     parent::__construct();
     if (!$this->is_active()) {
         return;
     }
     // Currency
     add_filter('em_get_currencies', array($this, 'add_currency'));
     if ($this->single_currency()) {
         add_filter('em_get_currency_formatted', array($this, 'format_price'), 10, 4);
     }
     // Adjust Ticket Columns
     add_filter('em_booking_form_tickets_cols', array($this, 'ticket_columns'), 10, 2);
     add_action('em_booking_form_tickets_col_mycred', array($this, 'ticket_col'), 10, 2);
     add_filter('em_bookings_table_cols_col_action', array($this, 'bookings_table_actions'), 10, 2);
     add_action('em_cart_form_after_totals', array($this, 'checkout_total'));
     // Refund
     if ($this->prefs['refund'] != 0) {
         add_filter('em_booking_set_status', array($this, 'refunds'), 10, 2);
     }
 }
开发者ID:socialray,项目名称:surfied-2-0,代码行数:36,代码来源:mycred-eventsmanager-pro.php

示例2: myCRED_Widget_Transfer

 /**
  * Construct
  */
 function myCRED_Widget_Transfer()
 {
     // Basic details about our widget
     $widget_ops = array('classname' => 'widget-my-cred-transfer', 'description' => __('Allow transfers between users.', 'mycred'));
     $this->WP_Widget('mycred_widget_transfer', sprintf(__('(%s) Transfer', 'mycred'), mycred_label(true)), $widget_ops);
     $this->alt_option_name = 'mycred_widget_transfer';
 }
开发者ID:songlequang,项目名称:myclass,代码行数:10,代码来源:mycred-transfer-widgets.php

示例3: init

 /**
  * Init Widget
  */
 public static function init()
 {
     if (!current_user_can(apply_filters('mycred_overview_capability', 'edit_users'))) {
         return;
     }
     // Add widget
     wp_add_dashboard_widget(self::mycred_wid, sprintf(__('%s Overview', 'mycred'), mycred_label()), array('myCRED_Dashboard_Widget_Overview', 'widget'));
 }
开发者ID:socialray,项目名称:surfied-2-0,代码行数:11,代码来源:mycred-overview.php

示例4: __construct

 /**
  * Construct
  */
 function __construct()
 {
     // Default settings
     $defaults = array('setup' => 'off', 'type' => 'mycred_default', 'rate' => 100, 'share' => 0, 'log' => array('purchase' => __('Payment for tickets to %link_with_title%', 'mycred'), 'refund' => __('Ticket refund for %link_with_title%', 'mycred')), 'refund' => 0, 'labels' => array('header' => __('Pay using your %_plural% balance', 'mycred'), 'button' => __('Pay Now', 'mycred'), 'link' => __('Pay', 'mycred')), 'messages' => array('success' => __('Thank you for your payment!', 'mycred'), 'error' => __("I'm sorry but you can not pay for these tickets using %_plural%", 'mycred')));
     // Settings
     $settings = get_option('mycred_eventsmanager_gateway_prefs');
     $this->prefs = mycred_apply_defaults($defaults, $settings);
     $this->mycred_type = $this->prefs['type'];
     // Load myCRED
     $this->core = mycred($this->mycred_type);
     // Apply Whitelabeling
     $this->label = mycred_label();
 }
开发者ID:nfer,项目名称:mycred,代码行数:16,代码来源:mycred-eventsmanager.php

示例5: __construct

 /**
  * Construct
  */
 function __construct($type = 'mycred_default')
 {
     parent::__construct('myCRED_Stats_Module', array('module_name' => 'stats', 'register' => false), $type);
     $this->label = sprintf('%s %s', mycred_label(), __('Statistics', 'mycred'));
     $this->colors = mycred_get_type_color();
 }
开发者ID:suifengtec,项目名称:mycred,代码行数:9,代码来源:myCRED-addon-stats.php

示例6: sanitize_settings

 /**
  * Sanititze Settings
  * @filter 'mycred_save_core_prefs'
  * @since 0.1
  * @version 1.4.1
  */
 public function sanitize_settings($post)
 {
     $new_data = array();
     if ($this->mycred_type == 'mycred_default') {
         if (isset($post['types'])) {
             $types = array('mycred_default' => mycred_label());
             foreach ($post['types'] as $item => $data) {
                 // Make sure it is not marked as deleted
                 if (isset($post['delete_types']) && in_array($item, $post['delete_types'])) {
                     continue;
                 }
                 // Skip if empty
                 if (empty($data['key']) || empty($data['label'])) {
                     continue;
                 }
                 // Add if not in array already
                 if (!array_key_exists($data['key'], $types)) {
                     $key = str_replace(array(' ', '-'), '_', $data['key']);
                     $key = sanitize_key($key);
                     $types[$key] = sanitize_text_field($data['label']);
                 }
             }
             mycred_update_option('mycred_types', $types);
             unset($post['types']);
             if (isset($post['delete_types'])) {
                 unset($post['delete_types']);
             }
         }
         $new_data['format'] = $this->core->core['format'];
         if (isset($post['format']['type']) && $post['format']['type'] != '') {
             $new_data['format']['type'] = absint($post['format']['type']);
         }
         if (isset($post['format']['decimals'])) {
             $new_data['format']['decimals'] = absint($post['format']['decimals']);
         }
     } else {
         $main_settings = mycred_get_option('mycred_pref_core');
         $new_data['format'] = $main_settings['format'];
         if (isset($post['format']['decimals'])) {
             $new_decimals = absint($post['format']['decimals']);
             if ($new_decimals <= $main_settings['format']['decimals']) {
                 $new_data['format']['decimals'] = $new_decimals;
             }
         }
     }
     // Format
     $new_data['cred_id'] = $this->mycred_type;
     $new_data['format']['separators']['decimal'] = $this->maybe_whitespace($post['format']['separators']['decimal']);
     $new_data['format']['separators']['thousand'] = $this->maybe_whitespace($post['format']['separators']['thousand']);
     // Name
     $new_data['name'] = array('singular' => sanitize_text_field($post['name']['singular']), 'plural' => sanitize_text_field($post['name']['plural']));
     // Look
     $new_data['before'] = sanitize_text_field($post['before']);
     $new_data['after'] = sanitize_text_field($post['after']);
     // Capabilities
     $new_data['caps'] = array('plugin' => sanitize_text_field($post['caps']['plugin']), 'creds' => sanitize_text_field($post['caps']['creds']));
     // Max
     $new_data['max'] = $this->core->number($post['max']);
     // Make sure multisites uses capabilities that exists
     if (in_array($new_data['caps']['creds'], array('create_users', 'delete_themes', 'edit_plugins', 'edit_themes', 'edit_users')) && is_multisite()) {
         $new_data['caps']['creds'] = 'delete_users';
     }
     // Excludes
     $new_data['exclude'] = array('plugin_editors' => isset($post['exclude']['plugin_editors']) ? $post['exclude']['plugin_editors'] : 0, 'cred_editors' => isset($post['exclude']['cred_editors']) ? $post['exclude']['cred_editors'] : 0, 'list' => sanitize_text_field($post['exclude']['list']));
     // Remove Exclude users balances
     if ($new_data['exclude']['list'] != '') {
         $excluded_ids = explode(',', $new_data['exclude']['list']);
         if (!empty($excluded_ids)) {
             foreach ((array) $excluded_ids as $user_id) {
                 $user_id = absint(trim($user_id));
                 if ($user_id == 0) {
                     continue;
                 }
                 mycred_delete_user_meta($user_id, $this->mycred_type);
                 mycred_delete_user_meta($user_id, $this->mycred_type, '_total');
             }
         }
     }
     // User deletions
     $new_data['delete_user'] = isset($post['delete_user']) ? $post['delete_user'] : 0;
     $action_hook = '';
     if (!$this->is_main_type) {
         $action_hook = $this->mycred_type;
     }
     $new_data = apply_filters('mycred_save_core_prefs' . $action_hook, $new_data, $post, $this);
     return $new_data;
 }
开发者ID:suifengtec,项目名称:mycred,代码行数:93,代码来源:mycred-module-settings.php

示例7: metabox

        /**
         * Sell Meta Box
         * @since 0.1
         * @version 1.2
         */
        public function metabox($post)
        {
            // Make sure add-on has been setup
            if (!$this->is_installed()) {
                echo sprintf(__('%s Sell Content needs to be setup before you can use this feature.', 'mycred'), mycred_label());
                // Settings Link
                if ($this->core->can_edit_plugin(get_current_user_id())) {
                    echo ' <a href="' . $this->get_settings_url('sell_content_module') . '" title="' . __('Setup add-on', 'mycred') . '">' . __('Lets do it', 'mycred') . '</a>';
                }
                return;
            }
            $admin = false;
            $post_id = $post->ID;
            $post_type = $post->post_type;
            $user_id = get_current_user_id();
            $sell_content = $this->sell_content;
            $sales_data = $this->get_sale_prefs($post_id);
            // Mark admins
            if ($this->core->can_edit_plugin($user_id)) {
                $admin = true;
            }
            // Empty $sales_data means disabled same if the status is actually set to "disabled"
            if (empty($sales_data) || isset($sales_data['status']) && $sales_data['status'] == 'disabled') {
                $style = 'display:none;';
                $status = 'disabled';
            } else {
                $style = 'display:block;';
                $status = 'enabled';
            }
            $op = (bool) $sell_content['defaults']['overwrite_price'];
            $ob = (bool) $sell_content['defaults']['overwrite_buttonlabel'];
            ?>

<style type="text/css">
#mycred_sell_content .inside { margin: 0; padding: 0; }
#mycred_sell_content .inside p { padding: 0 12px; }
#mycred_sell_content .inside ul { margin: 0; padding: 0 0 12px 0; background-color: #F5F5F5; border-top: 1px solid #ccc; }
#mycred_sell_content .inside ul li { padding: 8px 12px 0 12px; margin: 0 0 0 0; }
#mycred_sell_content .inside ul li label { font-weight: bold; display: block; }
#mycred_sell_content .inside ul li.disabled { color: #ccc; }
input[name="myCRED_sell_content[button_label]"] { width: 100%; }
</style>
<p><label for="mycred-sell-this"><input type="checkbox" name="mycred_sell_this" id="mycred-sell-this"<?php 
            checked($status, 'enabled');
            ?>
 value="enabled" /> <?php 
            printf(__('Enable sale of this %s', 'mycred'), $post_type);
            ?>
</label></p>
<div id="mycred-sale-settings" style="<?php 
            echo $style;
            ?>
">
	<input type="hidden" name="mycred-sell-this-token" value="<?php 
            echo wp_create_nonce('mycred-sell-this');
            ?>
" />
	<input type="hidden" name="mycred-sell-this-status" value="<?php 
            echo $status;
            ?>
" />
	<ul>
		<li<?php 
            if ($op === false && !$admin) {
                echo ' class="disabled"';
            }
            ?>
>
			<label for="mycred-buy-prefs-"><?php 
            _e('Price', 'mycred');
            ?>
</label>
			<div class="formated"><?php 
            echo $this->core->before;
            ?>
 <input type="text" name="myCRED_sell_content[price]" id="mycred-buy-prefs-price" value="<?php 
            echo $sales_data['price'];
            ?>
" <?php 
            if ($op === false && !$admin) {
                echo 'disabled="disabled" class="disabled"';
            }
            ?>
 size="12" /> <?php 
            echo $this->core->after;
            ?>
</div>
		</li>
		<li<?php 
            if ($ob === false && !$admin) {
                echo ' class="disabled"';
            }
            ?>
>
			<label for="mycred-buy-prefs-"><?php 
//.........这里部分代码省略.........
开发者ID:suifengtec,项目名称:mycred,代码行数:101,代码来源:myCRED-addon-sell-content.php

示例8: admin_page

        /**
         * Admin Page
         * @since 0.1
         * @version 1.0
         */
        public function admin_page()
        {
            // Security
            if (!$this->core->can_edit_plugin(get_current_user_id())) {
                wp_die(__('Access Denied', 'mycred'));
            }
            // Available Imports
            if (empty($this->installed)) {
                $this->get();
            }
            ?>

	<div class="wrap list" id="myCRED-wrap">
		<div id="icon-myCRED" class="icon32"><br /></div>
		<h2><?php 
            echo sprintf(__('%s Import', 'mycred'), mycred_label());
            ?>
</h2>
<?php 
            // Errors
            if (!empty($this->errors)) {
                echo '<div class="error"><p>' . $this->errors . '</p></div>';
            } elseif ($this->import_ok !== false) {
                echo '<div class="updated"><p>' . $this->import_ok . '</p></div>';
            }
            ?>

		<p><?php 
            _e('Remember to de-activate this add-on once you are done importing!', 'mycred');
            ?>
</p>
			<div class="list-items expandable-li" id="accordion">
<?php 
            if (!empty($this->installed)) {
                foreach ($this->installed as $id => $data) {
                    $call = $id . '_form';
                    $this->{$call}($data);
                }
            }
            ?>

			</div>
	</div>
<?php 
            unset($this);
        }
开发者ID:nfer,项目名称:mycred,代码行数:51,代码来源:myCRED-addon-import.php

示例9: 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']);
//.........这里部分代码省略.........
开发者ID:nfer,项目名称:mycred,代码行数:101,代码来源:mycred-marketpress.php

示例10: setup_page

        /**
         * Setup page
         * Outputs the setup page.
         * @since 0.1
         * @version 1.1
         */
        public function setup_page()
        {
            $label = sprintf(__('%s Setup', 'mycred'), mycred_label());
            if ($this->step !== false) {
                $label .= ' <span>' . __('Step', 'mycred') . ' ' . $this->step . ' / 3';
            }
            ?>

<div class="wrap setup" id="myCRED-wrap">
	<h2><?php 
            echo $label;
            ?>
</span></h2>
	<?php 
            $this->get_view();
            ?>

</div>
<?php 
        }
开发者ID:nfer,项目名称:mycred,代码行数:26,代码来源:mycred-install.php

示例11: update_settings

 /**
  * Update Settings
  * @since 1.2
  * @version 1.2
  */
 public function update_settings()
 {
     // Apply Whitelabeling
     $this->label = mycred_label();
     // Security
     if (!wp_verify_nonce($_REQUEST['mycred-gateway-token'], 'mycred-espresso-update')) {
         return;
     }
     if (!$this->core->can_edit_plugin()) {
         return;
     }
     // Prep
     $new_settings = array();
     $post = $_POST['mycred_prefs'];
     if (!is_array($post) || empty($post)) {
         return;
     }
     // Labels
     $new_settings['labels']['gateway'] = strip_tags($post['labels']['gateway'], '<strong><em><span>');
     $new_settings['labels']['payment'] = strip_tags($post['labels']['payment'], '<strong><em><span>');
     $new_settings['labels']['button'] = sanitize_text_field($post['labels']['button']);
     // Point Type
     $new_settings['type'] = sanitize_text_field($post['type']);
     // Exchange Rate
     $new_settings['rate'] = sanitize_text_field($post['rate']);
     // Profit Share
     $new_settings['share'] = abs($post['share']);
     // Log
     $new_settings['log'] = sanitize_text_field($post['log']);
     // Messages
     $new_settings['messages']['solvent'] = sanitize_text_field(stripslashes($post['messages']['solvent']));
     $new_settings['messages']['insolvent'] = sanitize_text_field(stripslashes($post['messages']['insolvent']));
     $new_settings['messages']['visitors'] = sanitize_text_field(stripslashes($post['messages']['visitors']));
     // Let others play
     $new_settings = apply_filters('mycred_espresso_save_pref', $new_settings);
     // Save new settings
     $current = $this->prefs;
     $this->prefs = mycred_apply_defaults($current, $new_settings);
     update_option('mycred_espresso_gateway_prefs', $this->prefs);
     // Flag update
     $this->update = true;
 }
开发者ID:nfer,项目名称:mycred,代码行数:47,代码来源:mycred-eventespresso3.php

示例12: mycred_admin_menu

 function mycred_admin_menu()
 {
     $mycred = mycred();
     $name = mycred_label(true);
     global $mycred_types, $wp_version;
     $pages = array();
     $slug = 'myCRED';
     $menu_icon = 'dashicons-star-filled';
     if (version_compare($wp_version, '3.8', '<')) {
         $menu_icon = '';
     }
     foreach ($mycred_types as $type => $title) {
         $type_slug = 'myCRED';
         if ($type != 'mycred_default') {
             $type_slug = 'myCRED_' . trim($type);
         }
         $pages[] = add_menu_page($title, $title, $mycred->edit_creds_cap(), $type_slug, '', $menu_icon);
     }
     $about_label = sprintf(__('About %s', 'mycred'), $name);
     $pages[] = add_dashboard_page($about_label, $about_label, 'moderate_comments', 'mycred', 'mycred_about_page');
     $cred_label = __('Awesome People', 'mycred');
     $pages[] = add_dashboard_page($cred_label, $cred_label, 'moderate_comments', 'mycred-credit', 'mycred_about_credit_page');
     $pages = apply_filters('mycred_admin_pages', $pages, $mycred);
     foreach ($pages as $page) {
         add_action('admin_print_styles-' . $page, 'mycred_admin_page_styles');
     }
     // Let others play
     do_action('mycred_add_menu', $mycred);
 }
开发者ID:nfer,项目名称:mycred,代码行数:29,代码来源:mycred.php

示例13: mycred_init_wpecom_construct_gateway

 /**
  * Construct Gateway
  * @since 1.3
  * @version 1.0
  */
 function mycred_init_wpecom_construct_gateway()
 {
     if (!class_exists('wpsc_merchant')) {
         return;
     }
     global $nzshpcrt_gateways, $mycred_wpecom_settings;
     $mycred_wpecom_settings = shortcode_atts(array('log' => __('Payment for Order: #%order_id%', 'mycred'), 'type' => 'mycred_default', 'share' => 0, 'share_log' => __('Store sale', 'mycred'), 'rate' => 1, 'visitor' => __('You must be logged in to use this gateway', 'mycred'), 'low_funds' => __('Insufficient Funds.', 'mycred'), 'message' => __('Deduct the amount from your balance.', 'mycred')), (array) get_option('mycred_wpecom_settings', ''));
     // Add gateway
     $nzshpcrt_gateways[] = array('id' => 'mycred', 'name' => mycred_label(true), 'has_recurring_billing' => false, 'wp_admin_cannot_cancel' => false, 'requirements' => array('php_version' => '5.2.4'), 'form' => 'mycred_wpecom_gateway_settings', 'submit_function' => 'mycred_wpecom_gateway_settings_save', 'payment_type' => 'mycred', 'internalname' => 'mycred');
     class myCRED_WP_E_Commerce_Gateway
     {
         public $core = '';
         public $prefs = array();
         public $mycred_type = 'mycred_default';
         /**
          * Construct
          */
         function __construct()
         {
             global $mycred_wpecom_settings;
             $this->prefs = $mycred_wpecom_settings;
             $type = 'mycred_default';
             if (isset($mycred_wpecom_settings['type'])) {
                 $type = $mycred_wpecom_settings['type'];
             }
             $this->core = mycred($type);
             $this->mycred_type = $type;
             add_action('wpsc_submit_checkout_gateway', array($this, 'process_gateway'), 1, 2);
             add_filter('wpsc_gateway_checkout_form_mycred', array($this, 'checkout_form'));
             add_filter('mycred_parse_log_entry_wpecom_payment', array($this, 'parse_template_tags'), 10, 2);
         }
         /**
          * Process Payment
          * @since 1.3
          * @version 1.1
          */
         function process_gateway($gateway, $purchase_log)
         {
             if ($gateway != 'mycred') {
                 return;
             }
             // Prep
             $log_id = $purchase_log->get('id');
             // Load Gateway
             $merchant_instance = new wpsc_merchant_mycred($log_id, false, $this->prefs, $this->core, $this->mycred_type);
             $merchant_instance->construct_value_array();
             // Validate
             $merchant_instance->validate($purchase_log);
             // Charge
             do_action_ref_array('wpsc_pre_submit_gateway', array(&$merchant_instance));
             $merchant_instance->submit();
         }
         /**
          * Checkout Form
          * @since 1.3
          * @version 1.1
          */
         function checkout_form()
         {
             $output = '';
             if (!is_user_logged_in()) {
                 $output .= '<tr><td>' . $this->core->template_tags_general($this->prefs['visitor']) . '</td></tr>';
                 return $output;
             }
             $output .= '<tr><td><table width="100%"><thead><th class="cart-item">' . __('Item', 'mycred') . '</th><th class="cart-item-qt"></th><th class="cart-item-cost">' . $this->core->plural() . '</th></thead><tbody>';
             $total = 0;
             while (wpsc_have_cart_items()) {
                 wpsc_the_cart_item();
                 $price = wpsc_cart_item_price(false);
                 if ($this->prefs['rate'] != 1) {
                     $price = $this->prefs['rate'] * $price;
                 }
                 $total = $total + $price;
             }
             $output .= '<tr><td colspan="2">' . __('Total Cost', 'mycred') . '</td><td class="cart-item-cost">' . $this->core->format_creds($total) . '</td></tr>';
             $balance = $this->core->get_users_cred(get_current_user_id(), $this->mycred_type);
             if ($balance < $total) {
                 $highlight = ' style="color:red;"';
             } else {
                 $highlight = '';
             }
             $output .= '<tr><td class="cart-item" colspan="2">' . __('Your current balance', 'mycred') . '</td><td class="cart-item-cost"' . $highlight . '>' . $this->core->format_creds($balance) . '</td></tr></tdody></table></tr>';
             if (!empty($this->prefs['message'])) {
                 $output .= '<tr><td>' . $this->core->template_tags_general($this->prefs['message']) . '</td></tr>';
             }
             return apply_filters('mycred_wpecom_form', $output);
         }
         /**
          * Parse Custom Template Tags
          * @since 1.3
          * @version 1.0
          */
         function parse_template_tags($content, $log_entry)
         {
             if (!empty($log_entry->data)) {
//.........这里部分代码省略.........
开发者ID:socialray,项目名称:surfied-2-0,代码行数:101,代码来源:mycred-wpecommerce.php

示例14: mycred_about_credit_page

/**
 * myCRED Credit Page
 * @since 1.3.2
 * @version 1.0
 */
function mycred_about_credit_page()
{
    $name = mycred_label();
    ?>

<div class="wrap about-wrap" id="mycred-credit-wrap">
	<h1>Awesome People</h1>
	<?php 
    mycred_about_header($name);
    ?>

	<div class="changelog">
		<h3>myCRED Users</h3>
		<div class="feature-section col two-col">
			<div>
				<h4>Bug Finders</h4>
				<p>Users who have taken the time to report bugs helping me improve this plugin.</p>
				<ul>
					<li><a href="http://mycred.me/community/jommy99/">John Moore</a></li>
					<li><a href="http://mycred.me/community/keisermedia/">Lucas Keiser</a></li>
					<li><a href="http://mycred.me/community/lionelbernard/">Siargao</a></li>
					<li><a href="http://mycred.me/community/woekerzee/">woekerzee</a></li>
					<li><a href="http://mycred.me/community/jmaubert75/">JM AUBERT</a></li>
					<li><a href="http://mycred.me/community/NUHISON/">David J</a></li>
					<li><a href="http://mycred.me/community/shmoo/">Shmoo</a></li>
				</ul>
			</div>
			<div class="last-feature">
				<h4>Plugin Translators</h4>
				<p>Users who have helped with translating this plugin.</p>
				<ul>
					<li><a href="http://bp-fr.net/">Dan</a> <em>( French )</em></li>
					<li><a href="http://mycred.me/members/maniv-a/">Mani Akhtar</a> <em>( Persian )</em></li>
					<li><a href="http://www.merovingi.com/">Gabriel S Merovingi</a> <em>( Swedish )</em></li>
					<li><a href="http://robertrowshan.com/">Rob Row</a> <em>( Spanish )</em></li>
					<li>Skladchik <em>( Russian )</em></li>
					<lo>Guilherme <em>( Portuguese - Brazil )</em></li>
				</ul>
			</div>
		</div>
		<h3>Find out more</h3>
		<p>You can always find more information about this plugin on the <strong>my</strong>CRED <a href="http://mycred.me/">website</a>.</p>
	</div>
	<?php 
    mycred_about_footer();
    ?>

</div>
<?php 
}
开发者ID:nfer,项目名称:mycred,代码行数:55,代码来源:mycred-about.php

示例15: mycred_about_credit_page

/**
 * myCRED Credit Page
 * @since 1.3.2
 * @version 1.6.3
 */
function mycred_about_credit_page()
{
    $name = mycred_label();
    ?>

<div class="wrap about-wrap" id="mycred-credit-wrap">
	<h1>Awesome People</h1>
	<?php 
    mycred_about_header($name);
    ?>

	<div class="changelog">
		<h3>myCRED Users</h3>
		<div class="feature-section col two-col">
			<div>
				<h4>Bug Finders</h4>
				<p>Users who have taken the time to report bugs. A big thank you to all.</p>
				<ul>
					<li><a href="http://mycred.me/community/innergy4every1/">innergy4every1</a></li>
					<li><a href="http://mycred.me/community/kristoff/">Kristoff</a></li>
					<li><a href="http://mycred.me/community/colson/">colson</a></li>
					<li><a href="http://mycred.me/community/Martin/">Martin</a></li>
					<li><a href="http://mycred.me/community/orousal/">Orousal</a></li>
					<li><a href="http://mycred.me/community/joseph/">Joseph</a></li>
					<li>Maria Campbell</li>
				</ul>
			</div>
			<div class="last-feature">
				<h4>Plugin Translators</h4>
				<p>Users who have helped with translating this plugin.</p>
				<ul>
					<li><a href="http://bp-fr.net/">Dan</a> <em>( French )</em></li>
					<li><a href="http://mycred.me/members/maniv-a/">Mani Akhtar</a> <em>( Persian )</em></li>
					<li><a href="http://www.merovingi.com/">Gabriel S Merovingi</a> <em>( Swedish )</em></li>
					<li><a href="http://robertrowshan.com/">Robert Rowshan</a> <em>( Spanish )</em></li>
					<li>Skladchik <em>( Russian )</em></li>
					<li>Guilherme <em>( Portuguese - Brazil )</em></li>
					<li><a href="http://coolwp.com">suifengtec</a> <em>( Chinese )</em></li>
				</ul>
				<p>Remember that translators are rewarded with <strong>my</strong>CRED tokens for their help. Tokens can be used in the myCRED store to pay for premium add-ons.</p>
			</div>
		</div>
		<h3>Find out more</h3>
		<p>You can always find more information about this plugin on the <strong>my</strong>CRED <a href="http://mycred.me/">website</a>.</p>
	</div>
	<?php 
    mycred_about_footer();
    ?>

</div>
<?php 
}
开发者ID:socialray,项目名称:surfied-2-0,代码行数:57,代码来源:mycred-about.php


注:本文中的mycred_label函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。