refactor: rename the theme brand and every identifier from AKSRT to Jio

Full-project rename. `git grep -i aksrt` is now empty apart from the
DBMigrator 3.3.0 changelog note that documents the rename itself.

Code identifiers
- PHP namespace AKSRT\ -> Jio\ (composer PSR-4 + 378 declarations)
- global constants AKSRT_* -> JIO_* (VERSION/DIR/URI, PAY_TYPE_*, CAPTCHA_*)
- procedural functions, hooks, options, meta keys, table names,
  cookies, query vars, ajax actions and nonces: aksrt_ -> jio_
- text domain aksrt -> jio; Theme Name -> Jio
- JS globals: aksrtData/aksrtAdminData/... -> jioData/jioAdminData/...,
  window.AKSRTCaptcha & friends -> window.JioCaptcha, Aksrt* -> Jio*
- Vue components Aks*.vue -> Jio*.vue (15 files renamed + imports)
- CSS classes/data-attrs/custom properties: aksrt- -> jio-
- REST namespace aksrt/v1 -> jio/v1 (incl. payment gateway callbacks)

Storage layer
- DB tables {prefix}aksrt_* -> {prefix}jio_*; SCHEMA_VERSION 3.2.0 -> 3.3.0
  so dbDelta creates the new names on install
- widget id_base aksrt_widget_* -> jio_widget_*
- uninstall.php drop list rebuilt from the actual migrator tables
  (dropped 3 stale entries, added the 17 missing ones)

Removed
- hardcoded https://api.aksrt.com/version.json default update endpoint;
  get_endpoint() now reads the 「更新端点」 setting and do_check() no-ops
  when it is empty

Files renamed: inc/helpers/aksrt-*.php -> jio-*.php (54),
assets/admin/src/components/form/Aks*.vue -> Jio*.vue (15).
Build artifacts regenerated: assets/css/build, assets/js/runtime,
assets/admin/build.

Verified: audit-psr4-paths errors=0, audit-admin-contracts errors=0
(warnings=56, unchanged baseline), 813/813 widget-system tests,
44/44 phpunit, php -l clean across all PHP.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Opus 5 committed 2026-11-01 20:05:04 +08:00
1 parent 5b16bc6e15
commit 35bb96e82f
997 files changed
+28216 -28188

No files matched your search

+90 -90
View File
@@ -6,15 +6,15 @@
* specific visuals are treated as content variants rather than a separate page
* system.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
$post_id = get_the_ID();
$meta = get_query_var('aksrt_resource_meta', null);
$meta = get_query_var('jio_resource_meta', null);
if (!is_array($meta)) {
$meta = function_exists('aksrt_get_download_box_meta') ? aksrt_get_download_box_meta($post_id) : null;
$meta = function_exists('jio_get_download_box_meta') ? jio_get_download_box_meta($post_id) : null;
}
if (!is_array($meta)) return;
@@ -24,50 +24,50 @@ if ($pay_type !== 'download' || empty($downloads)) {
return;
}
$is_resource_context = function_exists('aksrt_is_resource_post') && aksrt_is_resource_post($post_id);
$is_resource_context = function_exists('jio_is_resource_post') && jio_is_resource_post($post_id);
$context_variant = $is_resource_context ? 'resource' : 'content';
$subject_label = trim((string) ($meta['subject_label'] ?? ''));
if ($subject_label === '') {
$subject_label = $is_resource_context ? __('资源', 'aksrt') : __('内容', 'aksrt');
$subject_label = $is_resource_context ? __('资源', 'jio') : __('内容', 'jio');
}
$price_label = function_exists('aksrt_get_pay_price_label')
? aksrt_get_pay_price_label($post_id)
$price_label = function_exists('jio_get_pay_price_label')
? jio_get_pay_price_label($post_id)
: ['text' => '', 'free' => true];
// 下载策略检查
$gate = function_exists('aksrt_can_download') ? aksrt_can_download($post_id) : true;
$gate = function_exists('jio_can_download') ? jio_can_download($post_id) : true;
$gate_blocked = is_wp_error($gate);
$gate_code = $gate_blocked ? $gate->get_error_code() : '';
$gate_data = $gate_blocked ? (array) $gate->get_error_data() : [];
$paid_settings = class_exists('\AKSRT\Settings\Settings')
? \AKSRT\Settings\Settings::get_paid_content_settings()
$paid_settings = class_exists('\Jio\Settings\Settings')
? \Jio\Settings\Settings::get_paid_content_settings()
: ['download_credit' => true];
$access = class_exists('\AKSRT\Content\Visibility')
? \AKSRT\Content\Visibility::get_post_access_state($post_id)
$access = class_exists('\Jio\Content\Visibility')
? \Jio\Content\Visibility::get_post_access_state($post_id)
: [];
$has_paid_access = !empty($access['has_paid_access']);
$priced = function_exists('aksrt_get_user_pay_price') ? aksrt_get_user_pay_price($post_id) : null;
$priced = function_exists('jio_get_user_pay_price') ? jio_get_user_pay_price($post_id) : null;
$pay_modo = is_array($priced)
? ((($priced['modo'] ?? '0') === 'points') ? 'points' : '0')
: ((($meta['pay_modo'] ?? '0') === 'points') ? 'points' : '0');
$user_amount = is_array($priced) ? (float) ($priced['amount'] ?? 0) : (float) ($meta['price'] ?? 0);
$login_url = (string) ($gate_data['login_url'] ?? wp_login_url(get_permalink($post_id)));
$vip_url = function_exists('aksrt_get_user_center_tab_url')
? aksrt_get_user_center_tab_url('credits')
: (function_exists('aksrt_get_user_center_url') ? aksrt_get_user_center_url() : home_url('/'));
$vip_url = function_exists('jio_get_user_center_tab_url')
? jio_get_user_center_tab_url('credits')
: (function_exists('jio_get_user_center_url') ? jio_get_user_center_url() : home_url('/'));
$is_need_login = $gate_blocked && $gate_code === 'aksrt_need_login';
$is_need_vip = $gate_blocked && $gate_code === 'aksrt_need_vip';
$is_need_purchase = $gate_blocked && $gate_code === 'aksrt_need_purchase';
$is_need_login = $gate_blocked && $gate_code === 'jio_need_login';
$is_need_vip = $gate_blocked && $gate_code === 'jio_need_vip';
$is_need_purchase = $gate_blocked && $gate_code === 'jio_need_purchase';
// Points unpaid may also surface as need_purchase; treat low balance only after cashier.
$is_low_credit = false;
$allow_guest_buy = !is_user_logged_in()
&& function_exists('aksrt_allow_guest_content_pay')
&& aksrt_allow_guest_content_pay($post_id)
&& function_exists('jio_allow_guest_content_pay')
&& jio_allow_guest_content_pay($post_id)
&& $pay_modo !== 'points'
&& $user_amount > 0
&& empty($access['need_vip']);
@@ -83,11 +83,11 @@ $price_amount = (float) ($price_label['amount'] ?? $user_amount);
// legacy down_alone_page: single entry to independent download page.
$alone_page = !empty($paid_settings['down_alone_page']) || !empty($paid_settings['download']['alone_page']);
$alone_url = '';
if ($alone_page && function_exists('aksrt_get_single_download_page_url')) {
$alone_url = aksrt_get_single_download_page_url($post_id);
if ($alone_page && function_exists('jio_get_single_download_page_url')) {
$alone_url = jio_get_single_download_page_url($post_id);
}
$use_alone_entry = $alone_page && $alone_url !== '' && !$is_need_login && !$is_need_vip && !$is_need_purchase && !$gate_blocked;
if (!empty($GLOBALS['aksrt_on_download_file_page'])) {
if (!empty($GLOBALS['jio_on_download_file_page'])) {
$use_alone_entry = false;
}
@@ -119,35 +119,35 @@ $display_count = max($download_count, $sales_count);
$show_sales = !isset($meta['show_sales']) || !empty($meta['show_sales']);
// 付费类型徽章
$pay_type_badge = function_exists('aksrt_get_pay_type_badge') ? aksrt_get_pay_type_badge($pay_type) : '';
$pay_type_badge = function_exists('jio_get_pay_type_badge') ? jio_get_pay_type_badge($pay_type) : '';
// 货币名称
$currency = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_currency_name() : __('积分', 'aksrt');
$currency = class_exists('\Jio\Settings\Settings') ? \Jio\Settings\Settings::get_currency_name() : __('积分', 'jio');
$cash_symbol = '¥';
if (class_exists('\AKSRT\Settings\Settings')) {
$paid_display = \AKSRT\Settings\Settings::get_paid_content_settings();
if (class_exists('\Jio\Settings\Settings')) {
$paid_display = \Jio\Settings\Settings::get_paid_content_settings();
$cash_symbol = (string) ($paid_display['display']['currency_symbol'] ?? '¥');
}
$format_vip = static function (float $amount) use ($pay_modo, $currency, $cash_symbol): string {
if ($amount <= 0) {
return (string) __('免费', 'aksrt');
return (string) __('免费', 'jio');
}
$n = function_exists('aksrt_format_price') ? aksrt_format_price($amount) : (string) $amount;
$n = function_exists('jio_format_price') ? jio_format_price($amount) : (string) $amount;
return $pay_modo === 'points' ? ($n . ' ' . $currency) : ($cash_symbol . $n);
};
$purchase_label = '';
if ($is_need_purchase && $user_amount > 0) {
$purchase_label = $pay_modo === 'points'
? sprintf(__('立即购买(%s %s)', 'aksrt'), aksrt_format_price($user_amount), $currency)
: sprintf(__('立即购买(%s%s)', 'aksrt'), $cash_symbol, aksrt_format_price($user_amount));
? sprintf(__('立即购买(%s %s)', 'jio'), jio_format_price($user_amount), $currency)
: sprintf(__('立即购买(%s%s)', 'jio'), $cash_symbol, jio_format_price($user_amount));
} elseif ($is_need_purchase) {
$purchase_label = __('购买后下载', 'aksrt');
$purchase_label = __('购买后下载', 'jio');
}
?>
<section class="widget resource-download-box resource-download-box--v2<?php echo $gate_blocked ? ' is-blocked' : ''; ?><?php echo $has_paid_access ? ' is-purchased' : ''; ?> resource-download-box--<?php echo esc_attr($context_variant); ?>"
data-aksrt-download-box
data-jio-download-box
data-post-id="<?php echo esc_attr((string) $post_id); ?>"
data-price="<?php echo esc_attr((string) $base_price); ?>"
data-amount="<?php echo esc_attr((string) $user_amount); ?>"
@@ -155,35 +155,35 @@ if ($is_need_purchase && $user_amount > 0) {
data-pay-limit="<?php echo esc_attr((string) $pay_limit); ?>"
data-has-paid="<?php echo $has_paid_access ? '1' : '0'; ?>"
data-credit="0"
aria-label="<?php esc_attr_e('下载区', 'aksrt'); ?>">
aria-label="<?php esc_attr_e('下载区', 'jio'); ?>">
<?php if ($has_paid_access && $user_amount > 0) : ?>
<span class="resource-download-box__sales-badge resource-download-box__paid-badge">
<i class="fa fas fa-check-circle" aria-hidden="true"></i>
<?php esc_html_e('已购买', 'aksrt'); ?>
<?php esc_html_e('已购买', 'jio'); ?>
</span>
<?php elseif ($show_sales && $display_count > 0) : ?>
<span class="resource-download-box__sales-badge">
<i class="fa fas fa-fire" aria-hidden="true"></i>
<?php
/* translators: %s: 下载/销量数 */
$sales_label = function_exists('aksrt_format_number') ? aksrt_format_number($display_count) : number_format_i18n($display_count);
printf(esc_html__('已售 %s', 'aksrt'), $sales_label);
$sales_label = function_exists('jio_format_number') ? jio_format_number($display_count) : number_format_i18n($display_count);
printf(esc_html__('已售 %s', 'jio'), $sales_label);
?>
</span>
<?php endif; ?>
<?php
$paid_order = null;
if ($has_paid_access && is_user_logged_in() && function_exists('aksrt_get_user_content_paid_order')) {
$paid_order = aksrt_get_user_content_paid_order((int) $post_id);
if ($has_paid_access && is_user_logged_in() && function_exists('jio_get_user_content_paid_order')) {
$paid_order = jio_get_user_content_paid_order((int) $post_id);
}
?>
<div class="resource-download-box__body">
<?php if ($has_thumbnail) : ?>
<div class="resource-download-box__thumb-col">
<img<?php echo aksrt_get_lazy_attr('lazy_other', (string) $thumbnail, 'resource-download-box__thumb'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="<?php echo esc_attr(get_the_title()); ?>">
<img<?php echo jio_get_lazy_attr('lazy_other', (string) $thumbnail, 'resource-download-box__thumb'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="<?php echo esc_attr(get_the_title()); ?>">
<?php if ($pay_type_badge) : ?>
<div class="resource-download-box__pay-tag"><?php echo $pay_type_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
<?php endif; ?>
@@ -193,36 +193,36 @@ if ($is_need_purchase && $user_amount > 0) {
<div class="resource-download-box__content-col">
<header class="resource-download-box__header">
<div>
<p class="resource-download-box__eyebrow"><?php echo esc_html(sprintf(__('%s付费 / 下载能力', 'aksrt'), $subject_label)); ?></p>
<p class="resource-download-box__eyebrow"><?php echo esc_html(sprintf(__('%s付费 / 下载能力', 'jio'), $subject_label)); ?></p>
<h2 class="resource-download-box__title">
<i class="fa fas fa-cloud-download-alt" aria-hidden="true"></i>
<?php echo $has_paid_access ? esc_html__('资源下载', 'aksrt') : esc_html__('解锁下载', 'aksrt'); ?>
<?php echo $has_paid_access ? esc_html__('资源下载', 'jio') : esc_html__('解锁下载', 'jio'); ?>
</h2>
</div>
<span class="resource-download-box__count">
<?php echo esc_html(sprintf(_n('%s 个下载源', '%s 个下载源', count($downloads), 'aksrt'), number_format_i18n(count($downloads)))); ?>
<?php echo esc_html(sprintf(_n('%s 个下载源', '%s 个下载源', count($downloads), 'jio'), number_format_i18n(count($downloads)))); ?>
</span>
</header>
<?php if ($has_paid_access && $user_amount > 0) : ?>
<div class="resource-download-box__pricing">
<span class="resource-download-box__price is-free"><?php esc_html_e('已解锁', 'aksrt'); ?></span>
<span class="resource-download-box__price is-free"><?php esc_html_e('已解锁', 'jio'); ?></span>
<?php echo $pay_type_badge && !$has_thumbnail ? $pay_type_badge : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
<?php if (is_array($paid_order) && !empty($paid_order['order_number'])) : ?>
<div class="resource-download-box__paid-meta">
<span><?php printf(esc_html__('订单号:%s', 'aksrt'), esc_html((string) $paid_order['order_number'])); ?></span>
<span><?php printf(esc_html__('订单号:%s', 'jio'), esc_html((string) $paid_order['order_number'])); ?></span>
<?php if (!empty($paid_order['paid_at'])) : ?>
<span><?php printf(esc_html__('支付时间:%s', 'aksrt'), esc_html((string) $paid_order['paid_at'])); ?></span>
<span><?php printf(esc_html__('支付时间:%s', 'jio'), esc_html((string) $paid_order['paid_at'])); ?></span>
<?php endif; ?>
<span>
<?php
$paid_amt = (float) ($paid_order['amount'] ?? 0);
$paid_cur = (string) ($paid_order['currency'] ?? '');
if ($paid_cur === 'points') {
printf(esc_html__('实付:%s %s', 'aksrt'), esc_html(function_exists('aksrt_format_price') ? aksrt_format_price($paid_amt) : (string) $paid_amt), esc_html($currency));
printf(esc_html__('实付:%s %s', 'jio'), esc_html(function_exists('jio_format_price') ? jio_format_price($paid_amt) : (string) $paid_amt), esc_html($currency));
} else {
printf(esc_html__('实付:%s%s', 'aksrt'), esc_html($cash_symbol), esc_html(function_exists('aksrt_format_price') ? aksrt_format_price($paid_amt) : (string) $paid_amt));
printf(esc_html__('实付:%s%s', 'jio'), esc_html($cash_symbol), esc_html(function_exists('jio_format_price') ? jio_format_price($paid_amt) : (string) $paid_amt));
}
?>
</span>
@@ -233,7 +233,7 @@ if ($is_need_purchase && $user_amount > 0) {
<span class="resource-download-box__price<?php echo !empty($price_label['free']) || $has_paid_access ? ' is-free' : ''; ?>">
<?php
if ($has_paid_access && $user_amount > 0) {
esc_html_e('已解锁', 'aksrt');
esc_html_e('已解锁', 'jio');
} else {
echo esc_html((string) ($price_label['text'] ?? ''));
}
@@ -244,8 +244,8 @@ if ($is_need_purchase && $user_amount > 0) {
<?php
echo esc_html(
$pay_modo === 'points'
? (aksrt_format_price($original_price) . ' ' . $currency)
: ($cash_symbol . aksrt_format_price($original_price))
? (jio_format_price($original_price) . ' ' . $currency)
: ($cash_symbol . jio_format_price($original_price))
);
?>
</span>
@@ -261,7 +261,7 @@ if ($is_need_purchase && $user_amount > 0) {
<i class="fa fas fa-certificate" aria-hidden="true"></i>
<?php
/* translators: %s: VIP1 价格 */
printf(esc_html__('VIP1 %s', 'aksrt'), $format_vip($vip1_price));
printf(esc_html__('VIP1 %s', 'jio'), $format_vip($vip1_price));
?>
</span>
<?php endif; ?>
@@ -270,7 +270,7 @@ if ($is_need_purchase && $user_amount > 0) {
<i class="fa fas fa-gem" aria-hidden="true"></i>
<?php
/* translators: %s: VIP2 价格 */
printf(esc_html__('VIP2 %s', 'aksrt'), $format_vip($vip2_price));
printf(esc_html__('VIP2 %s', 'jio'), $format_vip($vip2_price));
?>
</span>
<?php endif; ?>
@@ -278,8 +278,8 @@ if ($is_need_purchase && $user_amount > 0) {
<?php endif; ?>
<?php
if (function_exists('aksrt_get_pay_attributes_html')) {
echo aksrt_get_pay_attributes_html($post_id); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
if (function_exists('jio_get_pay_attributes_html')) {
echo jio_get_pay_attributes_html($post_id); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
?>
@@ -291,11 +291,11 @@ if ($is_need_purchase && $user_amount > 0) {
<div class="mt10 resource-download-box__vip-gate">
<a href="<?php echo esc_url($vip_url); ?>" class="resource-download-box__btn btn-primary resource-download-box__btn--vip">
<i class="fa fas fa-certificate" aria-hidden="true"></i>
<span><?php echo esc_html($gate instanceof WP_Error ? $gate->get_error_message() : __('开通会员后下载', 'aksrt')); ?></span>
<span><?php echo esc_html($gate instanceof WP_Error ? $gate->get_error_message() : __('开通会员后下载', 'jio')); ?></span>
</a>
<?php
if (function_exists('aksrt_get_demo_link_html')) {
echo aksrt_get_demo_link_html($post_id); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
if (function_exists('jio_get_demo_link_html')) {
echo jio_get_demo_link_html($post_id); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
?>
</div>
@@ -304,8 +304,8 @@ if ($is_need_purchase && $user_amount > 0) {
<button
type="button"
class="resource-download-box__btn btn-primary resource-download-box__btn--purchase cashier-link <?php echo $pay_modo === 'points' ? 'is-points' : 'is-cash'; ?>"
data-action="aksrt-need-purchase"
data-aksrt-pay-content="<?php echo esc_attr((string) $post_id); ?>"
data-action="jio-need-purchase"
data-jio-pay-content="<?php echo esc_attr((string) $post_id); ?>"
data-post-id="<?php echo esc_attr((string) $post_id); ?>"
data-pay-modo="<?php echo esc_attr($pay_modo); ?>"
data-amount="<?php echo esc_attr((string) $user_amount); ?>"
@@ -314,8 +314,8 @@ if ($is_need_purchase && $user_amount > 0) {
<span><?php echo esc_html($purchase_label); ?></span>
</button>
<?php
if (function_exists('aksrt_get_demo_link_html')) {
echo aksrt_get_demo_link_html($post_id); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
if (function_exists('jio_get_demo_link_html')) {
echo jio_get_demo_link_html($post_id); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
?>
</div>
@@ -323,11 +323,11 @@ if ($is_need_purchase && $user_amount > 0) {
<div class="mt10 resource-download-box__alone">
<a target="_blank" rel="nofollow" href="<?php echo esc_url($alone_url); ?>" class="resource-download-box__btn btn-primary resource-download-box__btn--alone">
<i class="fa fas fa-download" aria-hidden="true"></i>
<span><?php esc_html_e('资源下载', 'aksrt'); ?></span>
<span><?php esc_html_e('资源下载', 'jio'); ?></span>
</a>
<?php
if (function_exists('aksrt_get_demo_link_html')) {
echo aksrt_get_demo_link_html($post_id); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
if (function_exists('jio_get_demo_link_html')) {
echo jio_get_demo_link_html($post_id); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
?>
</div>
@@ -349,16 +349,16 @@ if ($is_need_purchase && $user_amount > 0) {
$button_class = isset($row['class']) ? trim((string) $row['class']) : '';
$has_copy = $copy_val !== '';
$service = function_exists('aksrt_detect_cloud_service') ? aksrt_detect_cloud_service($url) : ['key' => 'other', 'name' => $label, 'color' => '#6b7280'];
$service = function_exists('jio_detect_cloud_service') ? jio_detect_cloud_service($url) : ['key' => 'other', 'name' => $label, 'color' => '#6b7280'];
if ($label === '') {
$label = strpos($service['name'], '本地') === 0 ? sprintf(__('下载源 %d', 'aksrt'), $idx + 1) : (string) $service['name'];
$label = strpos($service['name'], '本地') === 0 ? sprintf(__('下载源 %d', 'jio'), $idx + 1) : (string) $service['name'];
}
$icon_markup = $icon !== '' && function_exists('aksrt_icon_markup') ? aksrt_icon_markup($icon) : '';
$icon_markup = $icon !== '' && function_exists('jio_icon_markup') ? jio_icon_markup($icon) : '';
if ($is_need_login) {
$btn_href = $login_url;
$btn_text = __('登录后下载', 'aksrt');
$btn_text = __('登录后下载', 'jio');
$btn_icon = $icon_markup !== '' ? $icon_markup : '<i class="fa fas fa-sign-in-alt" aria-hidden="true"></i>';
$btn_extra_class = '';
$btn_modifier = ' resource-download-box__btn--login';
@@ -391,18 +391,18 @@ if ($is_need_purchase && $user_amount > 0) {
</a>
<?php if ($has_extract || $has_copy) : ?>
<button type="button" class="resource-download-box__btn resource-download-box__btn--extract"
<?php if ($has_copy && $copy_key !== '') : ?>data-toggle="tooltip" title="<?php echo esc_attr(sprintf(__('点击复制%s', 'aksrt'), $copy_key)); ?>"<?php endif; ?>
data-clipboard-tag="<?php echo esc_attr($has_copy ? ($copy_key !== '' ? $copy_key : __('内容', 'aksrt')) : __('提取码', 'aksrt')); ?>"
<?php if ($has_copy && $copy_key !== '') : ?>data-toggle="tooltip" title="<?php echo esc_attr(sprintf(__('点击复制%s', 'jio'), $copy_key)); ?>"<?php endif; ?>
data-clipboard-tag="<?php echo esc_attr($has_copy ? ($copy_key !== '' ? $copy_key : __('内容', 'jio')) : __('提取码', 'jio')); ?>"
data-clipboard-text="<?php echo esc_attr($has_copy ? $copy_val : $extract_code); ?>"
><?php echo esc_html($has_extract ? $extract_code : ($copy_key !== '' ? $copy_key : __('复制内容', 'aksrt'))); ?></button>
><?php echo esc_html($has_extract ? $extract_code : ($copy_key !== '' ? $copy_key : __('复制内容', 'jio'))); ?></button>
<?php endif; ?>
</div>
</li>
<?php endforeach; ?>
</ul>
<?php
if (function_exists('aksrt_get_demo_link_html')) {
$demo = aksrt_get_demo_link_html($post_id);
if (function_exists('jio_get_demo_link_html')) {
$demo = jio_get_demo_link_html($post_id);
if ($demo !== '') {
echo '<div class="mt10 resource-download-box__demo-row">' . $demo . '</div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
@@ -411,31 +411,31 @@ if ($is_need_purchase && $user_amount > 0) {
<?php endif; ?>
<?php
if (is_user_logged_in() && $user_amount <= 0 && function_exists('aksrt_get_user_free_download_limit')) {
$dl_limit = aksrt_get_user_free_download_limit();
if (is_user_logged_in() && $user_amount <= 0 && function_exists('jio_get_user_free_download_limit')) {
$dl_limit = jio_get_user_free_download_limit();
if ($dl_limit > 0) {
$dl_used = function_exists('aksrt_get_user_free_downloaded_number') ? aksrt_get_user_free_downloaded_number() : 0;
$dl_used = function_exists('jio_get_user_free_downloaded_number') ? jio_get_user_free_downloaded_number() : 0;
$dl_surplus = max(0, $dl_limit - $dl_used);
$vip_lv = function_exists('aksrt_get_user_vip_level') ? aksrt_get_user_vip_level() : 0;
$vip_lv = function_exists('jio_get_user_vip_level') ? jio_get_user_vip_level() : 0;
$over_price = max(0.0, (float) ($meta['download_limit_over_price'] ?? 0));
if ($dl_surplus <= 0) {
echo '<div class="resource-download-box__quota-notice"><span class="badg c-red btn-block">' . esc_html__('您今日下载免费资源个数已超限,请明日再下载。', 'aksrt') . '</span></div>';
echo '<div class="resource-download-box__quota-notice"><span class="badg c-red btn-block">' . esc_html__('您今日下载免费资源个数已超限,请明日再下载。', 'jio') . '</span></div>';
if ($over_price > 0 && !$has_paid_access) {
$over_label = $pay_modo === 'points'
? sprintf(__('立即购买(%s %s)', 'aksrt'), function_exists('aksrt_format_price') ? aksrt_format_price($over_price) : (string) $over_price, $currency)
: sprintf(__('立即购买(%s%s)', 'aksrt'), $cash_symbol, function_exists('aksrt_format_price') ? aksrt_format_price($over_price) : (string) $over_price);
? sprintf(__('立即购买(%s %s)', 'jio'), function_exists('jio_format_price') ? jio_format_price($over_price) : (string) $over_price, $currency)
: sprintf(__('立即购买(%s%s)', 'jio'), $cash_symbol, function_exists('jio_format_price') ? jio_format_price($over_price) : (string) $over_price);
echo '<div class="mt10 resource-download-box__purchase-gate">';
echo '<button type="button" class="resource-download-box__btn btn-primary resource-download-box__btn--purchase cashier-link" data-action="aksrt-need-purchase" data-aksrt-pay-content="' . esc_attr((string) $post_id) . '" data-post-id="' . esc_attr((string) $post_id) . '" data-price-type="download_limit_over" data-pay-modo="' . esc_attr($pay_modo) . '" data-amount="' . esc_attr((string) $over_price) . '">';
echo '<button type="button" class="resource-download-box__btn btn-primary resource-download-box__btn--purchase cashier-link" data-action="jio-need-purchase" data-jio-pay-content="' . esc_attr((string) $post_id) . '" data-post-id="' . esc_attr((string) $post_id) . '" data-price-type="download_limit_over" data-pay-modo="' . esc_attr($pay_modo) . '" data-amount="' . esc_attr((string) $over_price) . '">';
echo '<i class="fa fas fa-shopping-cart" aria-hidden="true"></i><span>' . esc_html($over_label) . '</span></button></div>';
}
} else {
$who = $vip_lv > 0 ? esc_html__('您是尊贵的会员,', 'aksrt') : esc_html__('您', 'aksrt');
echo '<div class="resource-download-box__quota-notice"><span class="badg c-red btn-block">' . $who . esc_html(sprintf(__('今日还可下载 %s 个免费资源', 'aksrt'), number_format_i18n($dl_surplus))) . '</span></div>';
$who = $vip_lv > 0 ? esc_html__('您是尊贵的会员,', 'jio') : esc_html__('您', 'jio');
echo '<div class="resource-download-box__quota-notice"><span class="badg c-red btn-block">' . $who . esc_html(sprintf(__('今日还可下载 %s 个免费资源', 'jio'), number_format_i18n($dl_surplus))) . '</span></div>';
}
}
}
?>
<?php $service_html = aksrt_get_pay_service_html(); ?>
<?php $service_html = jio_get_pay_service_html(); ?>
<?php if ($service_html !== '') : ?>
<div class="resource-download-box__guarantees">
<?php echo $service_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
@@ -447,24 +447,24 @@ if ($is_need_purchase && $user_amount > 0) {
<?php if ($is_need_login) : ?>
<p class="resource-download-box__hint resource-download-box__hint--login">
<i class="fa fas fa-info-circle" aria-hidden="true"></i>
<?php echo ($price_amount <= 0) ? esc_html__('免费资源,请登录后下载。', 'aksrt') : esc_html__('登录后可解锁并下载该内容。', 'aksrt'); ?>
<?php echo ($price_amount <= 0) ? esc_html__('免费资源,请登录后下载。', 'jio') : esc_html__('登录后可解锁并下载该内容。', 'jio'); ?>
</p>
<?php elseif ($is_need_vip || $member_blocked) : ?>
<p class="resource-download-box__hint resource-download-box__hint--vip">
<i class="fa fas fa-info-circle" aria-hidden="true"></i>
<?php echo esc_html($gate instanceof WP_Error ? $gate->get_error_message() : __('该资源仅限会员购买/下载。', 'aksrt')); ?>
<?php echo esc_html($gate instanceof WP_Error ? $gate->get_error_message() : __('该资源仅限会员购买/下载。', 'jio')); ?>
</p>
<?php elseif ($is_need_purchase) : ?>
<p class="resource-download-box__hint resource-download-box__hint--purchase">
<i class="fa fas fa-info-circle" aria-hidden="true"></i>
<?php esc_html_e('请先完成购买后再下载该资源。', 'aksrt'); ?>
<?php esc_html_e('请先完成购买后再下载该资源。', 'jio'); ?>
</p>
<?php endif; ?>
<footer class="resource-download-box__footer">
<p class="resource-download-box__notice-text">
<i class="fa fas fa-info-circle" aria-hidden="true"></i>
<?php esc_html_e('下载能力是统一付费内容的一部分,请确认内容适用性后再使用。', 'aksrt'); ?>
<?php esc_html_e('下载能力是统一付费内容的一部分,请确认内容适用性后再使用。', 'jio'); ?>
</p>
</footer>
</section>