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:
1 parent
5b16bc6e15
commit
35bb96e82f
997 files changed
+28216
-28188
No files matched your search
@@ -2,19 +2,19 @@
|
||||
/**
|
||||
* Shared authentication renderer for the modal and /sign/ page.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
$aksrt_auth_context = isset($aksrt_auth_context) && is_array($aksrt_auth_context) ? $aksrt_auth_context : [];
|
||||
$auth_tab = sanitize_key((string) ($aksrt_auth_context['tab'] ?? 'signin'));
|
||||
$jio_auth_context = isset($jio_auth_context) && is_array($jio_auth_context) ? $jio_auth_context : [];
|
||||
$auth_tab = sanitize_key((string) ($jio_auth_context['tab'] ?? 'signin'));
|
||||
$allowed_tabs = ['signin', 'signup', 'resetpassword', 'bind', 'oauth'];
|
||||
$auth_tab = in_array($auth_tab, $allowed_tabs, true) ? $auth_tab : 'signin';
|
||||
$is_modal = ($aksrt_auth_context['surface'] ?? '') === 'modal';
|
||||
$settings = class_exists('\AKSRT\Settings\Settings') ? '\AKSRT\Settings\Settings' : null;
|
||||
$obk = sanitize_text_field((string) ($aksrt_auth_context['obk'] ?? ''));
|
||||
$oauth_bind_data = $obk !== '' && class_exists('\AKSRT\Auth\Service') ? \AKSRT\Auth\Service::get_oauth_bind_context($obk) : null;
|
||||
$is_modal = ($jio_auth_context['surface'] ?? '') === 'modal';
|
||||
$settings = class_exists('\Jio\Settings\Settings') ? '\Jio\Settings\Settings' : null;
|
||||
$obk = sanitize_text_field((string) ($jio_auth_context['obk'] ?? ''));
|
||||
$oauth_bind_data = $obk !== '' && class_exists('\Jio\Auth\Service') ? \Jio\Auth\Service::get_oauth_bind_context($obk) : null;
|
||||
$is_oauth_bind = is_array($oauth_bind_data);
|
||||
$registration_open = $is_oauth_bind
|
||||
? ($settings ? $settings::oauth_registration_enabled() : (bool) get_option('users_can_register'))
|
||||
@@ -29,15 +29,15 @@ $signup_type = $settings ? $settings::signup_verification_type() : 'email';
|
||||
$signup_type = $signup_verify ? $signup_type : 'email';
|
||||
$reset_type = $settings ? $settings::reset_password_verification_type() : 'email';
|
||||
$omit_confirm = $signup_verify && ($settings ? $settings::signup_omit_password_confirmation() : false);
|
||||
$agreement = function_exists('aksrt_get_auth_agreement_view') ? aksrt_get_auth_agreement_view() : ['enabled' => false, 'required' => false, 'label_html' => '', 'field_name' => 'agree_terms'];
|
||||
$agreement = function_exists('jio_get_auth_agreement_view') ? jio_get_auth_agreement_view() : ['enabled' => false, 'required' => false, 'label_html' => '', 'field_name' => 'agree_terms'];
|
||||
$referral = $settings ? $settings::get_referral_registration_settings() : ['enabled' => false, 'register_field' => 'hidden'];
|
||||
$ref_mode = !empty($referral['enabled']) ? (string) ($referral['register_field'] ?? 'hidden') : 'hidden';
|
||||
$ref_hint = $ref_mode === 'required' ? (string) ($referral['required_desc'] ?? '') : (string) ($referral['open_desc'] ?? '');
|
||||
$ref_value = !empty($_GET['ref']) ? sanitize_key(wp_unslash((string) $_GET['ref'])) : (!empty($_COOKIE['aksrt_referral']) ? sanitize_key(wp_unslash((string) $_COOKIE['aksrt_referral'])) : '');
|
||||
$ref_value = !empty($_GET['ref']) ? sanitize_key(wp_unslash((string) $_GET['ref'])) : (!empty($_COOKIE['jio_referral']) ? sanitize_key(wp_unslash((string) $_COOKIE['jio_referral'])) : '');
|
||||
$invite_code_settings = $settings ? $settings::get_invite_code_registration_settings() : ['enabled' => false, 'register_field' => 'hidden', 'open_desc' => '', 'required_desc' => ''];
|
||||
$invite_mode = !empty($invite_code_settings['enabled']) ? (string) ($invite_code_settings['register_field'] ?? 'hidden') : 'hidden';
|
||||
$invite_hint = $invite_mode === 'required' ? (string) ($invite_code_settings['required_desc'] ?? '') : (string) ($invite_code_settings['open_desc'] ?? '');
|
||||
$oauth_providers = class_exists('\AKSRT\Auth\OAuth') ? \AKSRT\Auth\OAuth::get_instance()->get_auth_providers_data() : [];
|
||||
$oauth_providers = class_exists('\Jio\Auth\OAuth') ? \Jio\Auth\OAuth::get_instance()->get_auth_providers_data() : [];
|
||||
$wechat_qr = false;
|
||||
foreach ($oauth_providers as $provider) {
|
||||
if (($provider['name'] ?? '') === 'weixingzh') {
|
||||
@@ -45,107 +45,107 @@ foreach ($oauth_providers as $provider) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
$show_logo = !empty($aksrt_auth_context['show_logo']);
|
||||
$show_logo = !empty($jio_auth_context['show_logo']);
|
||||
$oauth_large = $settings ? (bool) $settings::get_value('oauth_button_lg', false) : false;
|
||||
$redirect_to = esc_url_raw((string) ($aksrt_auth_context['redirect_to'] ?? home_url('/')));
|
||||
$redirect_to = esc_url_raw((string) ($jio_auth_context['redirect_to'] ?? home_url('/')));
|
||||
$unique = $is_modal ? 'modal' : 'page';
|
||||
$oauth_user_data = $is_oauth_bind && !empty($oauth_bind_data['user_data']) && is_array($oauth_bind_data['user_data']) ? $oauth_bind_data['user_data'] : [];
|
||||
$oauth_name = sanitize_user((string) ($oauth_user_data['name'] ?? $oauth_user_data['nickname'] ?? $oauth_user_data['login'] ?? ''), true);
|
||||
$oauth_email = sanitize_email((string) ($oauth_user_data['email'] ?? ''));
|
||||
$oauth_provider_name = $is_oauth_bind ? \AKSRT\Auth\Service::get_oauth_provider_name((string) ($oauth_bind_data['provider'] ?? '')) : '';
|
||||
$oauth_intent = sanitize_key((string) ($aksrt_auth_context['oauth_intent'] ?? ($_GET['oauth_intent'] ?? 'login')));
|
||||
$oauth_provider_name = $is_oauth_bind ? \Jio\Auth\Service::get_oauth_provider_name((string) ($oauth_bind_data['provider'] ?? '')) : '';
|
||||
$oauth_intent = sanitize_key((string) ($jio_auth_context['oauth_intent'] ?? ($_GET['oauth_intent'] ?? 'login')));
|
||||
$oauth_intent = $oauth_intent === 'bind' ? 'bind' : 'login';
|
||||
$oauth_bind_pass = $oauth_intent === 'bind'
|
||||
? sanitize_text_field((string) ($aksrt_auth_context['bind_pass'] ?? ($_GET['bind_pass'] ?? '')))
|
||||
? sanitize_text_field((string) ($jio_auth_context['bind_pass'] ?? ($_GET['bind_pass'] ?? '')))
|
||||
: '';
|
||||
?>
|
||||
<div class="sign aksrt-auth<?php echo $oauth_large ? ' oauth-button-lg' : ''; ?>" data-aksrt-auth data-surface="<?php echo esc_attr($unique); ?>" data-initial-tab="<?php echo esc_attr($auth_tab); ?>" data-passwordless-mode="<?php echo esc_attr($passwordless_mode); ?>" data-redirect-to="<?php echo esc_attr($redirect_to); ?>" data-oauth-intent="<?php echo esc_attr($oauth_intent); ?>" data-bind-pass="<?php echo esc_attr($oauth_bind_pass); ?>">
|
||||
<div class="sign jio-auth<?php echo $oauth_large ? ' oauth-button-lg' : ''; ?>" data-jio-auth data-surface="<?php echo esc_attr($unique); ?>" data-initial-tab="<?php echo esc_attr($auth_tab); ?>" data-passwordless-mode="<?php echo esc_attr($passwordless_mode); ?>" data-redirect-to="<?php echo esc_attr($redirect_to); ?>" data-oauth-intent="<?php echo esc_attr($oauth_intent); ?>" data-bind-pass="<?php echo esc_attr($oauth_bind_pass); ?>">
|
||||
<?php if ($show_logo) : ?>
|
||||
<div class="sign-logo"><?php echo function_exists('aksrt_get_auth_sign_logo_html') ? aksrt_get_auth_sign_logo_html() : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
|
||||
<div class="sign-logo"><?php echo function_exists('jio_get_auth_sign_logo_html') ? jio_get_auth_sign_logo_html() : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<section id="<?php echo esc_attr($unique); ?>-auth-panel-signin" class="sign-panel" role="tabpanel" data-auth-panel="signin" <?php echo $auth_tab !== 'signin' ? 'hidden' : ''; ?>>
|
||||
<div class="sign-header"><h2><?php esc_html_e('登录', 'aksrt'); ?></h2><?php if ($registration_open) : ?><span><?php esc_html_e('没有账号?', 'aksrt'); ?> <button type="button" data-auth-tab="signup"><?php esc_html_e('立即注册', 'aksrt'); ?></button></span><?php endif; ?></div>
|
||||
<div class="sign-header"><h2><?php esc_html_e('登录', 'jio'); ?></h2><?php if ($registration_open) : ?><span><?php esc_html_e('没有账号?', 'jio'); ?> <button type="button" data-auth-tab="signup"><?php esc_html_e('立即注册', 'jio'); ?></button></span><?php endif; ?></div>
|
||||
<?php if (!$close_signin) : ?>
|
||||
<form class="sign-form" data-auth-form="login">
|
||||
<div class="floating-input"><input name="target" id="<?php echo esc_attr($unique); ?>-login-target" autocomplete="username" required><label for="<?php echo esc_attr($unique); ?>-login-target"><?php echo ($passwordless || $signin_phone) ? esc_html__('邮箱 / 手机号 / 用户名', 'aksrt') : esc_html__('邮箱 / 用户名', 'aksrt'); ?></label></div>
|
||||
<div class="floating-input"><input name="target" id="<?php echo esc_attr($unique); ?>-login-target" autocomplete="username" required><label for="<?php echo esc_attr($unique); ?>-login-target"><?php echo ($passwordless || $signin_phone) ? esc_html__('邮箱 / 手机号 / 用户名', 'jio') : esc_html__('邮箱 / 用户名', 'jio'); ?></label></div>
|
||||
<div data-auth-password-fields <?php echo $passwordless && $passwordless_mode !== 'pas' ? 'hidden' : ''; ?>>
|
||||
<div class="floating-input has-action"><input type="password" name="password" id="<?php echo esc_attr($unique); ?>-login-password" autocomplete="current-password"><label for="<?php echo esc_attr($unique); ?>-login-password"><?php esc_html_e('密码', 'aksrt'); ?></label><button type="button" class="password-show" data-password-show aria-label="<?php esc_attr_e('显示密码', 'aksrt'); ?>" aria-pressed="false"><i class="fa fas fa-eye"></i></button></div>
|
||||
<div class="floating-input has-action"><input type="password" name="password" id="<?php echo esc_attr($unique); ?>-login-password" autocomplete="current-password"><label for="<?php echo esc_attr($unique); ?>-login-password"><?php esc_html_e('密码', 'jio'); ?></label><button type="button" class="password-show" data-password-show aria-label="<?php esc_attr_e('显示密码', 'jio'); ?>" aria-pressed="false"><i class="fa fas fa-eye"></i></button></div>
|
||||
</div>
|
||||
<?php if ($passwordless) : ?>
|
||||
<div data-auth-code-fields <?php echo $passwordless_mode === 'pas' ? 'hidden' : ''; ?>>
|
||||
<div class="floating-input has-action"><input name="code" inputmode="numeric" maxlength="6" id="<?php echo esc_attr($unique); ?>-login-code"><label for="<?php echo esc_attr($unique); ?>-login-code"><?php esc_html_e('验证码', 'aksrt'); ?></label><button type="button" class="send-code" data-send-code="login"><?php esc_html_e('发送验证码', 'aksrt'); ?></button></div>
|
||||
<div class="floating-input has-action"><input name="code" inputmode="numeric" maxlength="6" id="<?php echo esc_attr($unique); ?>-login-code"><label for="<?php echo esc_attr($unique); ?>-login-code"><?php esc_html_e('验证码', 'jio'); ?></label><button type="button" class="send-code" data-send-code="login"><?php esc_html_e('发送验证码', 'jio'); ?></button></div>
|
||||
<input type="hidden" name="channel" value="<?php echo esc_attr($passwordless_type === 'phone' ? 'phone' : ''); ?>">
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="sign-options"><label><input type="checkbox" name="rememberme" value="1"> <?php esc_html_e('记住登录', 'aksrt'); ?></label><button type="button" data-auth-tab="resetpassword"><?php esc_html_e('忘记密码?', 'aksrt'); ?></button></div>
|
||||
<?php if (function_exists('aksrt_render_captcha')) { aksrt_render_captcha('login'); } ?>
|
||||
<div class="sign-options"><label><input type="checkbox" name="rememberme" value="1"> <?php esc_html_e('记住登录', 'jio'); ?></label><button type="button" data-auth-tab="resetpassword"><?php esc_html_e('忘记密码?', 'jio'); ?></button></div>
|
||||
<?php if (function_exists('jio_render_captcha')) { jio_render_captcha('login'); } ?>
|
||||
<input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>">
|
||||
<button type="submit" class="sign-submit jb-blue"><span><?php esc_html_e('登录', 'aksrt'); ?></span><i class="fa fas fa-spinner fa-spin" hidden></i></button>
|
||||
<?php if ($passwordless && $passwordless_mode !== 'only_nopas') : ?><button type="button" class="sign-mode-switch" data-login-mode><?php echo $passwordless_mode === 'pas' ? esc_html__('使用验证码登录', 'aksrt') : esc_html__('使用账号密码登录', 'aksrt'); ?></button><?php endif; ?>
|
||||
<button type="submit" class="sign-submit jb-blue"><span><?php esc_html_e('登录', 'jio'); ?></span><i class="fa fas fa-spinner fa-spin" hidden></i></button>
|
||||
<?php if ($passwordless && $passwordless_mode !== 'only_nopas') : ?><button type="button" class="sign-mode-switch" data-login-mode><?php echo $passwordless_mode === 'pas' ? esc_html__('使用验证码登录', 'jio') : esc_html__('使用账号密码登录', 'jio'); ?></button><?php endif; ?>
|
||||
</form>
|
||||
<?php else : ?><div class="sign-notice"><?php esc_html_e('当前已关闭账号密码登录,请使用第三方登录。', 'aksrt'); ?></div><?php endif; ?>
|
||||
<?php else : ?><div class="sign-notice"><?php esc_html_e('当前已关闭账号密码登录,请使用第三方登录。', 'jio'); ?></div><?php endif; ?>
|
||||
</section>
|
||||
|
||||
<?php if ($registration_open) : ?>
|
||||
<section id="<?php echo esc_attr($unique); ?>-auth-panel-signup" class="sign-panel" role="tabpanel" data-auth-panel="signup" <?php echo $auth_tab !== 'signup' ? 'hidden' : ''; ?>>
|
||||
<div class="sign-header"><h2><?php echo $is_oauth_bind ? esc_html__('注册并绑定', 'aksrt') : esc_html__('注册', 'aksrt'); ?></h2><span><?php esc_html_e('已有账号?', 'aksrt'); ?> <button type="button" data-auth-tab="<?php echo $is_oauth_bind ? 'bind' : 'signin'; ?>"><?php esc_html_e('立即登录', 'aksrt'); ?></button></span></div>
|
||||
<div class="sign-header"><h2><?php echo $is_oauth_bind ? esc_html__('注册并绑定', 'jio') : esc_html__('注册', 'jio'); ?></h2><span><?php esc_html_e('已有账号?', 'jio'); ?> <button type="button" data-auth-tab="<?php echo $is_oauth_bind ? 'bind' : 'signin'; ?>"><?php esc_html_e('立即登录', 'jio'); ?></button></span></div>
|
||||
<form class="sign-form" data-auth-form="register">
|
||||
<div class="floating-input"><input name="user_login" value="<?php echo esc_attr($oauth_name); ?>" id="<?php echo esc_attr($unique); ?>-register-name" autocomplete="username" required><label for="<?php echo esc_attr($unique); ?>-register-name"><?php esc_html_e('用户名', 'aksrt'); ?></label></div>
|
||||
<div class="floating-input"><input name="target" value="<?php echo esc_attr($oauth_email); ?>" id="<?php echo esc_attr($unique); ?>-register-target" autocomplete="<?php echo $signup_type === 'phone' ? 'tel' : 'email'; ?>" required><label for="<?php echo esc_attr($unique); ?>-register-target"><?php echo $signup_type === 'phone' ? esc_html__('手机号', 'aksrt') : ($signup_type === 'email_phone' ? esc_html__('邮箱 / 手机号', 'aksrt') : esc_html__('邮箱', 'aksrt')); ?></label></div>
|
||||
<?php if ($signup_verify) : ?><div class="floating-input has-action"><input name="code" inputmode="numeric" maxlength="6" id="<?php echo esc_attr($unique); ?>-register-code" required><label for="<?php echo esc_attr($unique); ?>-register-code"><?php esc_html_e('验证码', 'aksrt'); ?></label><button type="button" class="send-code" data-send-code="register"><?php esc_html_e('发送验证码', 'aksrt'); ?></button></div><?php endif; ?>
|
||||
<div class="floating-input has-action"><input type="password" name="password" id="<?php echo esc_attr($unique); ?>-register-password" autocomplete="new-password" minlength="6" required><label for="<?php echo esc_attr($unique); ?>-register-password"><?php esc_html_e('密码', 'aksrt'); ?></label><button type="button" class="password-show" data-password-show aria-label="<?php esc_attr_e('显示密码', 'aksrt'); ?>" aria-pressed="false"><i class="fa fas fa-eye"></i></button></div>
|
||||
<?php if (!$omit_confirm) : ?><div class="floating-input has-action"><input type="password" name="password_confirm" id="<?php echo esc_attr($unique); ?>-register-confirm" autocomplete="new-password" minlength="6" required><label for="<?php echo esc_attr($unique); ?>-register-confirm"><?php esc_html_e('重复密码', 'aksrt'); ?></label><button type="button" class="password-show" data-password-show aria-label="<?php esc_attr_e('显示密码', 'aksrt'); ?>" aria-pressed="false"><i class="fa fas fa-eye"></i></button></div><?php endif; ?>
|
||||
<?php if ($ref_mode !== 'hidden') : ?><div class="floating-input"><input name="ref" value="<?php echo esc_attr($ref_value); ?>" id="<?php echo esc_attr($unique); ?>-register-ref" <?php echo $ref_mode === 'required' ? 'required' : ''; ?>><label for="<?php echo esc_attr($unique); ?>-register-ref"><?php echo $ref_mode === 'required' ? esc_html__('推广码', 'aksrt') : esc_html__('推广码(选填)', 'aksrt'); ?></label></div><?php if ($ref_hint !== '') : ?><div class="sign-hint"><?php echo wp_kses_post($ref_hint); ?></div><?php endif; ?><?php endif; ?>
|
||||
<?php if ($invite_mode !== 'hidden') : ?><div class="floating-input"><input name="invite_code" id="<?php echo esc_attr($unique); ?>-register-invite" data-invite-verify <?php echo $invite_mode === 'required' ? 'required' : ''; ?>><label for="<?php echo esc_attr($unique); ?>-register-invite"><?php echo $invite_mode === 'required' ? esc_html__('邀请码', 'aksrt') : esc_html__('邀请码(选填)', 'aksrt'); ?></label></div><small class="sign-hint" data-invite-feedback role="status" aria-live="polite" hidden></small><?php if ($invite_hint !== '') : ?><div class="sign-hint"><?php echo wp_kses_post($invite_hint); ?></div><?php endif; ?><?php endif; ?>
|
||||
<?php if (!empty($agreement['enabled']) && !empty($agreement['required'])) : ?><label class="sign-agreement"><input type="checkbox" name="agree_terms" value="1" required><span><?php echo $agreement['label_html']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span></label><?php elseif (!empty($agreement['enabled'])) : ?><div class="sign-agreement sign-agreement-implicit"><?php esc_html_e('注册即表示', 'aksrt'); ?><?php echo $agreement['label_html']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div><?php endif; ?>
|
||||
<?php if (function_exists('aksrt_render_captcha')) { aksrt_render_captcha('register'); } ?>
|
||||
<div class="floating-input"><input name="user_login" value="<?php echo esc_attr($oauth_name); ?>" id="<?php echo esc_attr($unique); ?>-register-name" autocomplete="username" required><label for="<?php echo esc_attr($unique); ?>-register-name"><?php esc_html_e('用户名', 'jio'); ?></label></div>
|
||||
<div class="floating-input"><input name="target" value="<?php echo esc_attr($oauth_email); ?>" id="<?php echo esc_attr($unique); ?>-register-target" autocomplete="<?php echo $signup_type === 'phone' ? 'tel' : 'email'; ?>" required><label for="<?php echo esc_attr($unique); ?>-register-target"><?php echo $signup_type === 'phone' ? esc_html__('手机号', 'jio') : ($signup_type === 'email_phone' ? esc_html__('邮箱 / 手机号', 'jio') : esc_html__('邮箱', 'jio')); ?></label></div>
|
||||
<?php if ($signup_verify) : ?><div class="floating-input has-action"><input name="code" inputmode="numeric" maxlength="6" id="<?php echo esc_attr($unique); ?>-register-code" required><label for="<?php echo esc_attr($unique); ?>-register-code"><?php esc_html_e('验证码', 'jio'); ?></label><button type="button" class="send-code" data-send-code="register"><?php esc_html_e('发送验证码', 'jio'); ?></button></div><?php endif; ?>
|
||||
<div class="floating-input has-action"><input type="password" name="password" id="<?php echo esc_attr($unique); ?>-register-password" autocomplete="new-password" minlength="6" required><label for="<?php echo esc_attr($unique); ?>-register-password"><?php esc_html_e('密码', 'jio'); ?></label><button type="button" class="password-show" data-password-show aria-label="<?php esc_attr_e('显示密码', 'jio'); ?>" aria-pressed="false"><i class="fa fas fa-eye"></i></button></div>
|
||||
<?php if (!$omit_confirm) : ?><div class="floating-input has-action"><input type="password" name="password_confirm" id="<?php echo esc_attr($unique); ?>-register-confirm" autocomplete="new-password" minlength="6" required><label for="<?php echo esc_attr($unique); ?>-register-confirm"><?php esc_html_e('重复密码', 'jio'); ?></label><button type="button" class="password-show" data-password-show aria-label="<?php esc_attr_e('显示密码', 'jio'); ?>" aria-pressed="false"><i class="fa fas fa-eye"></i></button></div><?php endif; ?>
|
||||
<?php if ($ref_mode !== 'hidden') : ?><div class="floating-input"><input name="ref" value="<?php echo esc_attr($ref_value); ?>" id="<?php echo esc_attr($unique); ?>-register-ref" <?php echo $ref_mode === 'required' ? 'required' : ''; ?>><label for="<?php echo esc_attr($unique); ?>-register-ref"><?php echo $ref_mode === 'required' ? esc_html__('推广码', 'jio') : esc_html__('推广码(选填)', 'jio'); ?></label></div><?php if ($ref_hint !== '') : ?><div class="sign-hint"><?php echo wp_kses_post($ref_hint); ?></div><?php endif; ?><?php endif; ?>
|
||||
<?php if ($invite_mode !== 'hidden') : ?><div class="floating-input"><input name="invite_code" id="<?php echo esc_attr($unique); ?>-register-invite" data-invite-verify <?php echo $invite_mode === 'required' ? 'required' : ''; ?>><label for="<?php echo esc_attr($unique); ?>-register-invite"><?php echo $invite_mode === 'required' ? esc_html__('邀请码', 'jio') : esc_html__('邀请码(选填)', 'jio'); ?></label></div><small class="sign-hint" data-invite-feedback role="status" aria-live="polite" hidden></small><?php if ($invite_hint !== '') : ?><div class="sign-hint"><?php echo wp_kses_post($invite_hint); ?></div><?php endif; ?><?php endif; ?>
|
||||
<?php if (!empty($agreement['enabled']) && !empty($agreement['required'])) : ?><label class="sign-agreement"><input type="checkbox" name="agree_terms" value="1" required><span><?php echo $agreement['label_html']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span></label><?php elseif (!empty($agreement['enabled'])) : ?><div class="sign-agreement sign-agreement-implicit"><?php esc_html_e('注册即表示', 'jio'); ?><?php echo $agreement['label_html']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div><?php endif; ?>
|
||||
<?php if (function_exists('jio_render_captcha')) { jio_render_captcha('register'); } ?>
|
||||
<input type="hidden" name="channel" value="<?php echo esc_attr($signup_type === 'phone' ? 'phone' : ''); ?>">
|
||||
<input type="hidden" name="user_email" value="">
|
||||
<?php if ($is_oauth_bind) : ?><input type="hidden" name="obk" value="<?php echo esc_attr($obk); ?>"><?php endif; ?>
|
||||
<button type="submit" class="sign-submit jb-green"><span><?php esc_html_e('注册', 'aksrt'); ?></span><i class="fa fas fa-spinner fa-spin" hidden></i></button>
|
||||
<button type="submit" class="sign-submit jb-green"><span><?php esc_html_e('注册', 'jio'); ?></span><i class="fa fas fa-spinner fa-spin" hidden></i></button>
|
||||
</form>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<section id="<?php echo esc_attr($unique); ?>-auth-panel-resetpassword" class="sign-panel" role="tabpanel" data-auth-panel="resetpassword" <?php echo $auth_tab !== 'resetpassword' ? 'hidden' : ''; ?>>
|
||||
<div class="sign-header"><h2><?php esc_html_e('找回密码', 'aksrt'); ?></h2><span><button type="button" data-auth-tab="signin"><?php esc_html_e('返回登录', 'aksrt'); ?></button></span></div>
|
||||
<div class="sign-header"><h2><?php esc_html_e('找回密码', 'jio'); ?></h2><span><button type="button" data-auth-tab="signin"><?php esc_html_e('返回登录', 'jio'); ?></button></span></div>
|
||||
<form class="sign-form" data-auth-form="reset-password">
|
||||
<div class="floating-input"><input name="target" id="<?php echo esc_attr($unique); ?>-reset-target" required><label for="<?php echo esc_attr($unique); ?>-reset-target"><?php echo $reset_type === 'phone' ? esc_html__('手机号', 'aksrt') : ($reset_type === 'email_phone' ? esc_html__('邮箱 / 手机号', 'aksrt') : esc_html__('邮箱', 'aksrt')); ?></label></div>
|
||||
<div class="floating-input has-action"><input name="code" inputmode="numeric" maxlength="6" id="<?php echo esc_attr($unique); ?>-reset-code" required><label for="<?php echo esc_attr($unique); ?>-reset-code"><?php esc_html_e('验证码', 'aksrt'); ?></label><button type="button" class="send-code" data-send-code="resetpassword"><?php esc_html_e('发送验证码', 'aksrt'); ?></button></div>
|
||||
<div class="floating-input has-action"><input type="password" name="password" id="<?php echo esc_attr($unique); ?>-reset-password" minlength="6" required><label for="<?php echo esc_attr($unique); ?>-reset-password"><?php esc_html_e('新密码', 'aksrt'); ?></label><button type="button" class="password-show" data-password-show aria-label="<?php esc_attr_e('显示密码', 'aksrt'); ?>" aria-pressed="false"><i class="fa fas fa-eye"></i></button></div>
|
||||
<div class="floating-input has-action"><input type="password" name="password_confirm" id="<?php echo esc_attr($unique); ?>-reset-confirm" minlength="6" required><label for="<?php echo esc_attr($unique); ?>-reset-confirm"><?php esc_html_e('重复新密码', 'aksrt'); ?></label><button type="button" class="password-show" data-password-show aria-label="<?php esc_attr_e('显示密码', 'aksrt'); ?>" aria-pressed="false"><i class="fa fas fa-eye"></i></button></div>
|
||||
<?php if (function_exists('aksrt_render_captcha')) { aksrt_render_captcha('lostpassword'); } ?>
|
||||
<div class="floating-input"><input name="target" id="<?php echo esc_attr($unique); ?>-reset-target" required><label for="<?php echo esc_attr($unique); ?>-reset-target"><?php echo $reset_type === 'phone' ? esc_html__('手机号', 'jio') : ($reset_type === 'email_phone' ? esc_html__('邮箱 / 手机号', 'jio') : esc_html__('邮箱', 'jio')); ?></label></div>
|
||||
<div class="floating-input has-action"><input name="code" inputmode="numeric" maxlength="6" id="<?php echo esc_attr($unique); ?>-reset-code" required><label for="<?php echo esc_attr($unique); ?>-reset-code"><?php esc_html_e('验证码', 'jio'); ?></label><button type="button" class="send-code" data-send-code="resetpassword"><?php esc_html_e('发送验证码', 'jio'); ?></button></div>
|
||||
<div class="floating-input has-action"><input type="password" name="password" id="<?php echo esc_attr($unique); ?>-reset-password" minlength="6" required><label for="<?php echo esc_attr($unique); ?>-reset-password"><?php esc_html_e('新密码', 'jio'); ?></label><button type="button" class="password-show" data-password-show aria-label="<?php esc_attr_e('显示密码', 'jio'); ?>" aria-pressed="false"><i class="fa fas fa-eye"></i></button></div>
|
||||
<div class="floating-input has-action"><input type="password" name="password_confirm" id="<?php echo esc_attr($unique); ?>-reset-confirm" minlength="6" required><label for="<?php echo esc_attr($unique); ?>-reset-confirm"><?php esc_html_e('重复新密码', 'jio'); ?></label><button type="button" class="password-show" data-password-show aria-label="<?php esc_attr_e('显示密码', 'jio'); ?>" aria-pressed="false"><i class="fa fas fa-eye"></i></button></div>
|
||||
<?php if (function_exists('jio_render_captcha')) { jio_render_captcha('lostpassword'); } ?>
|
||||
<input type="hidden" name="channel" value="<?php echo esc_attr($reset_type === 'phone' ? 'phone' : ''); ?>">
|
||||
<button type="submit" class="sign-submit jb-blue"><span><?php esc_html_e('重置密码', 'aksrt'); ?></span><i class="fa fas fa-spinner fa-spin" hidden></i></button>
|
||||
<button type="submit" class="sign-submit jb-blue"><span><?php esc_html_e('重置密码', 'jio'); ?></span><i class="fa fas fa-spinner fa-spin" hidden></i></button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section id="<?php echo esc_attr($unique); ?>-auth-panel-oauth" class="sign-panel" role="tabpanel" data-auth-panel="oauth" <?php echo $auth_tab !== 'oauth' ? 'hidden' : ''; ?>>
|
||||
<div class="sign-header"><h2><?php esc_html_e('社交登录', 'aksrt'); ?></h2><span><button type="button" data-auth-tab="signin"><?php esc_html_e('返回登录', 'aksrt'); ?></button></span></div>
|
||||
<?php if ($wechat_qr) : ?><div class="auth-qrcode" data-auth-qrcode><div data-auth-qr-content><i class="fa fab fa-weixin" aria-hidden="true"></i><span><?php esc_html_e('获取二维码中…', 'aksrt'); ?></span></div><p class="auth-qrcode-status screen-reader-text" data-auth-qr-status role="status" aria-live="polite" aria-atomic="true"><?php esc_html_e('正在获取二维码', 'aksrt'); ?></p></div><?php endif; ?>
|
||||
<div class="sign-header"><h2><?php esc_html_e('社交登录', 'jio'); ?></h2><span><button type="button" data-auth-tab="signin"><?php esc_html_e('返回登录', 'jio'); ?></button></span></div>
|
||||
<?php if ($wechat_qr) : ?><div class="auth-qrcode" data-auth-qrcode><div data-auth-qr-content><i class="fa fab fa-weixin" aria-hidden="true"></i><span><?php esc_html_e('获取二维码中…', 'jio'); ?></span></div><p class="auth-qrcode-status screen-reader-text" data-auth-qr-status role="status" aria-live="polite" aria-atomic="true"><?php esc_html_e('正在获取二维码', 'jio'); ?></p></div><?php endif; ?>
|
||||
</section>
|
||||
|
||||
<section id="<?php echo esc_attr($unique); ?>-auth-panel-bind" class="sign-panel" role="tabpanel" data-auth-panel="bind" <?php echo $auth_tab !== 'bind' ? 'hidden' : ''; ?>>
|
||||
<div class="sign-header"><h2><?php esc_html_e('绑定账号', 'aksrt'); ?></h2><?php if ($is_oauth_bind && $registration_open) : ?><span><?php esc_html_e('没有账号?', 'aksrt'); ?> <button type="button" data-auth-tab="signup"><?php esc_html_e('立即注册', 'aksrt'); ?></button></span><?php endif; ?></div>
|
||||
<div class="sign-header"><h2><?php esc_html_e('绑定账号', 'jio'); ?></h2><?php if ($is_oauth_bind && $registration_open) : ?><span><?php esc_html_e('没有账号?', 'jio'); ?> <button type="button" data-auth-tab="signup"><?php esc_html_e('立即注册', 'jio'); ?></button></span><?php endif; ?></div>
|
||||
<?php if ($is_oauth_bind) : ?>
|
||||
<div class="sign-notice"><?php printf(esc_html__('通过 %s 登录,请绑定已有账号。', 'aksrt'), esc_html($oauth_provider_name)); ?></div>
|
||||
<div class="sign-notice"><?php printf(esc_html__('通过 %s 登录,请绑定已有账号。', 'jio'), esc_html($oauth_provider_name)); ?></div>
|
||||
<form class="sign-form" data-auth-form="login">
|
||||
<div class="floating-input"><input name="target" id="<?php echo esc_attr($unique); ?>-bind-target" autocomplete="username" required><label for="<?php echo esc_attr($unique); ?>-bind-target"><?php echo $signin_phone ? esc_html__('邮箱 / 手机号 / 用户名', 'aksrt') : esc_html__('邮箱 / 用户名', 'aksrt'); ?></label></div>
|
||||
<div class="floating-input has-action"><input type="password" name="password" id="<?php echo esc_attr($unique); ?>-bind-password" autocomplete="current-password" required><label for="<?php echo esc_attr($unique); ?>-bind-password"><?php esc_html_e('密码', 'aksrt'); ?></label><button type="button" class="password-show" data-password-show aria-label="<?php esc_attr_e('显示密码', 'aksrt'); ?>" aria-pressed="false"><i class="fa fas fa-eye"></i></button></div>
|
||||
<?php if (function_exists('aksrt_render_captcha')) { aksrt_render_captcha('bind'); } ?>
|
||||
<div class="floating-input"><input name="target" id="<?php echo esc_attr($unique); ?>-bind-target" autocomplete="username" required><label for="<?php echo esc_attr($unique); ?>-bind-target"><?php echo $signin_phone ? esc_html__('邮箱 / 手机号 / 用户名', 'jio') : esc_html__('邮箱 / 用户名', 'jio'); ?></label></div>
|
||||
<div class="floating-input has-action"><input type="password" name="password" id="<?php echo esc_attr($unique); ?>-bind-password" autocomplete="current-password" required><label for="<?php echo esc_attr($unique); ?>-bind-password"><?php esc_html_e('密码', 'jio'); ?></label><button type="button" class="password-show" data-password-show aria-label="<?php esc_attr_e('显示密码', 'jio'); ?>" aria-pressed="false"><i class="fa fas fa-eye"></i></button></div>
|
||||
<?php if (function_exists('jio_render_captcha')) { jio_render_captcha('bind'); } ?>
|
||||
<input type="hidden" name="obk" value="<?php echo esc_attr($obk); ?>">
|
||||
<input type="hidden" name="rememberme" value="1">
|
||||
<input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>">
|
||||
<button type="submit" class="sign-submit jb-blue"><span><?php esc_html_e('登录并绑定', 'aksrt'); ?></span><i class="fa fas fa-spinner fa-spin" hidden></i></button>
|
||||
<button type="submit" class="sign-submit jb-blue"><span><?php esc_html_e('登录并绑定', 'jio'); ?></span><i class="fa fas fa-spinner fa-spin" hidden></i></button>
|
||||
</form>
|
||||
<?php else : ?><div class="sign-notice"><?php esc_html_e('绑定会话已过期,请重新使用第三方登录。', 'aksrt'); ?></div><?php endif; ?>
|
||||
<?php else : ?><div class="sign-notice"><?php esc_html_e('绑定会话已过期,请重新使用第三方登录。', 'jio'); ?></div><?php endif; ?>
|
||||
</section>
|
||||
|
||||
<?php if (!empty($oauth_providers) && !$is_oauth_bind) : ?>
|
||||
<div class="social-login"><span><?php esc_html_e('其他登录方式', 'aksrt'); ?></span><div class="social-login-buttons">
|
||||
<?php foreach ($oauth_providers as $provider) : ?><?php if (($provider['name'] ?? '') === 'weixingzh') continue; ?><?php $provider_label = (string) ($provider['label'] ?? $provider['name'] ?? ''); ?><a class="social-login-item <?php echo esc_attr((string) ($provider['name'] ?? '')); ?>" href="<?php echo esc_url((string) ($provider['url'] ?? '#')); ?>" data-provider="<?php echo esc_attr((string) ($provider['name'] ?? '')); ?>" aria-label="<?php echo esc_attr(sprintf(__('%s登录', 'aksrt'), $provider_label)); ?>" title="<?php echo esc_attr($provider_label); ?>"><?php echo $provider['icon'] ?? ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?><?php if ($oauth_large) : ?><span><?php printf(esc_html__('%s登录', 'aksrt'), esc_html($provider_label)); ?></span><?php endif; ?></a><?php endforeach; ?>
|
||||
<?php if ($wechat_qr) : ?><button type="button" class="social-login-item weixingzh" data-auth-tab="oauth" aria-label="<?php esc_attr_e('微信扫码登录', 'aksrt'); ?>" title="<?php esc_attr_e('微信扫码登录', 'aksrt'); ?>"><i class="fa fab fa-weixin" aria-hidden="true"></i><?php if ($oauth_large) : ?><span><?php esc_html_e('微信登录', 'aksrt'); ?></span><?php endif; ?></button><?php endif; ?>
|
||||
<div class="social-login"><span><?php esc_html_e('其他登录方式', 'jio'); ?></span><div class="social-login-buttons">
|
||||
<?php foreach ($oauth_providers as $provider) : ?><?php if (($provider['name'] ?? '') === 'weixingzh') continue; ?><?php $provider_label = (string) ($provider['label'] ?? $provider['name'] ?? ''); ?><a class="social-login-item <?php echo esc_attr((string) ($provider['name'] ?? '')); ?>" href="<?php echo esc_url((string) ($provider['url'] ?? '#')); ?>" data-provider="<?php echo esc_attr((string) ($provider['name'] ?? '')); ?>" aria-label="<?php echo esc_attr(sprintf(__('%s登录', 'jio'), $provider_label)); ?>" title="<?php echo esc_attr($provider_label); ?>"><?php echo $provider['icon'] ?? ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?><?php if ($oauth_large) : ?><span><?php printf(esc_html__('%s登录', 'jio'), esc_html($provider_label)); ?></span><?php endif; ?></a><?php endforeach; ?>
|
||||
<?php if ($wechat_qr) : ?><button type="button" class="social-login-item weixingzh" data-auth-tab="oauth" aria-label="<?php esc_attr_e('微信扫码登录', 'jio'); ?>" title="<?php esc_attr_e('微信扫码登录', 'jio'); ?>"><i class="fa fab fa-weixin" aria-hidden="true"></i><?php if ($oauth_large) : ?><span><?php esc_html_e('微信登录', 'jio'); ?></span><?php endif; ?></button><?php endif; ?>
|
||||
</div></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* 用于列表页无内容时的统一展示。
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @var string $icon FA icon class (default: fa fas fa-inbox)
|
||||
@@ -18,7 +18,7 @@
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
$icon = $args['icon'] ?? 'fa fas fa-inbox';
|
||||
$title = $args['title'] ?? __('暂无内容', 'aksrt');
|
||||
$title = $args['title'] ?? __('暂无内容', 'jio');
|
||||
$desc = $args['desc'] ?? '';
|
||||
$action_url = $args['action_url'] ?? '';
|
||||
$action_text = $args['action_text'] ?? '';
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* 用于文章内嵌画廊块或图片列表展示。
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @var array $images 图片数组 [{src, alt, caption, width, height}]
|
||||
@@ -35,7 +35,7 @@ if (empty($images)) return;
|
||||
class="content-gallery__link"
|
||||
<?php echo $lightbox ? 'data-imgbox="imgbox" box-img="' . esc_url($src) . '"' : ''; ?>
|
||||
data-caption="<?php echo esc_attr($caption); ?>">
|
||||
<img<?php echo aksrt_get_lazy_attr('lazy_posts_content', (string) $src, 'content-gallery__img', aksrt_get_lazy_thumb('lg')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<img<?php echo jio_get_lazy_attr('lazy_posts_content', (string) $src, 'content-gallery__img', jio_get_lazy_thumb('lg')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
alt="<?php echo esc_attr($alt); ?>"
|
||||
width="<?php echo esc_attr($img['width'] ?? 800); ?>"
|
||||
height="<?php echo esc_attr($img['height'] ?? 600); ?>">
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* Post card wrapper for the unified renderer.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
$args = isset($args) && is_array($args) ? $args : [];
|
||||
echo aksrt_render_post($args); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo jio_render_post($args); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
@@ -3,14 +3,14 @@
|
||||
* Shared public profile / user center comment row.
|
||||
*
|
||||
* 通过 get_template_part() 的 $args 接收(保留 query var 兼容):
|
||||
* - aksrt_profile_comment: WP_Comment 对象
|
||||
* - jio_profile_comment: WP_Comment 对象
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
$comment = $args['comment'] ?? get_query_var('aksrt_profile_comment');
|
||||
$comment = $args['comment'] ?? get_query_var('jio_profile_comment');
|
||||
if (!$comment instanceof WP_Comment) {
|
||||
return;
|
||||
}
|
||||
@@ -52,14 +52,14 @@ $parent = $comment->comment_parent ? get_comment((int) $comment->comment_p
|
||||
<time class="profile-comment-item__time" datetime="<?php echo esc_attr($date_iso); ?>" title="<?php echo esc_attr($date_label); ?>">
|
||||
<?php
|
||||
/* translators: %s: human time diff */
|
||||
printf(esc_html__('%s前', 'aksrt'), esc_html($time_diff));
|
||||
printf(esc_html__('%s前', 'jio'), esc_html($time_diff));
|
||||
?>
|
||||
</time>
|
||||
<div class="profile-comment-item__body">
|
||||
<div class="profile-comment-item__content-wrap">
|
||||
<a class="profile-comment-item__content text-ellipsis-5" href="<?php echo esc_url($comment_link); ?>">
|
||||
<?php if ($comment->comment_approved === '0') : ?>
|
||||
<span class="profile-comment-item__pending badg c-red badg-sm"><?php esc_html_e('待审核', 'aksrt'); ?></span>
|
||||
<span class="profile-comment-item__pending badg c-red badg-sm"><?php esc_html_e('待审核', 'jio'); ?></span>
|
||||
<?php endif; ?>
|
||||
<?php echo $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- filtered and restricted with wp_kses_post(). ?>
|
||||
</a>
|
||||
@@ -68,7 +68,7 @@ $parent = $comment->comment_parent ? get_comment((int) $comment->comment_p
|
||||
<?php if ($parent instanceof WP_Comment) : ?>
|
||||
<span class="profile-comment-item__parent">@<?php echo esc_html(get_comment_author($parent)); ?></span>
|
||||
<?php endif; ?>
|
||||
<span class="muted-3-color"><?php esc_html_e('评论于:', 'aksrt'); ?></span>
|
||||
<span class="muted-3-color"><?php esc_html_e('评论于:', 'jio'); ?></span>
|
||||
<a class="profile-comment-item__post-link muted-color" href="<?php echo esc_url($post_link); ?>"><?php echo esc_html($post_title); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
* - 我的文章 / 我的收藏 / 公开主页文章列表
|
||||
*
|
||||
* 通过 get_template_part() 的 $args 接收以下参数(保留 query var 兼容):
|
||||
* - aksrt_profile_item_action: ['type'=>'edit'|'view'|'unfavorite', 'url'=>'...', 'label'=>'...']
|
||||
* - aksrt_profile_item_status: 文章状态徽章文本(如 "草稿" / "私密")
|
||||
* - jio_profile_item_action: ['type'=>'edit'|'view'|'unfavorite', 'url'=>'...', 'label'=>'...']
|
||||
* - jio_profile_item_status: 文章状态徽章文本(如 "草稿" / "私密")
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
$action = isset($args['action']) ? $args['action'] : get_query_var('aksrt_profile_item_action', []);
|
||||
$action = isset($args['action']) ? $args['action'] : get_query_var('jio_profile_item_action', []);
|
||||
if (!is_array($action)) {
|
||||
$action = [];
|
||||
}
|
||||
@@ -23,7 +23,7 @@ $action_url = isset($action['url']) ? (string) $action['url'] : '';
|
||||
$action_label = isset($action['label']) ? (string) $action['label'] : '';
|
||||
$delete_action = isset($args['delete_action']) && is_array($args['delete_action']) ? $args['delete_action'] : [];
|
||||
|
||||
$status_label = isset($args['status']) ? (string) $args['status'] : (string) get_query_var('aksrt_profile_item_status', '');
|
||||
$status_label = isset($args['status']) ? (string) $args['status'] : (string) get_query_var('jio_profile_item_status', '');
|
||||
|
||||
$post_id = get_the_ID();
|
||||
$permalink = get_permalink();
|
||||
@@ -69,7 +69,7 @@ $tags = get_the_tags() ?: [];
|
||||
|
||||
<span class="profile-list-item__meta-spacer"></span>
|
||||
|
||||
<span class="profile-list-item__meta-item profile-list-item__meta-item--comments" title="<?php esc_attr_e('评论数', 'aksrt'); ?>">
|
||||
<span class="profile-list-item__meta-item profile-list-item__meta-item--comments" title="<?php esc_attr_e('评论数', 'jio'); ?>">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/></svg>
|
||||
<span><?php echo esc_html((string) $comment_count); ?></span>
|
||||
</span>
|
||||
@@ -105,7 +105,7 @@ $tags = get_the_tags() ?: [];
|
||||
|
||||
<?php if (!empty($delete_action['enabled'])) : ?>
|
||||
<button type="button" class="profile-list-item__action profile-list-item__action--delete" data-action="delete-post" data-post-id="<?php echo esc_attr((string) $post_id); ?>" data-nonce="<?php echo esc_attr((string) ($delete_action['nonce'] ?? '')); ?>">
|
||||
<span class="profile-list-item__action-label"><?php esc_html_e('删除', 'aksrt'); ?></span>
|
||||
<span class="profile-list-item__action-label"><?php esc_html_e('删除', 'jio'); ?></span>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
* Document Chapter Navigation
|
||||
*
|
||||
* Shows previous/next chapter navigation at the bottom of a document page.
|
||||
* Uses \AKSRT\Core\DocsPresenter for chapter resolution.
|
||||
* Uses \Jio\Core\DocsPresenter for chapter resolution.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
$current_id = get_the_ID();
|
||||
|
||||
$presenter = class_exists('\AKSRT\Core\DocsPresenter') ? \AKSRT\Core\DocsPresenter::get_instance() : null;
|
||||
$presenter = class_exists('\Jio\Core\DocsPresenter') ? \Jio\Core\DocsPresenter::get_instance() : null;
|
||||
|
||||
if ($presenter) {
|
||||
$nav = $presenter->get_chapter_nav($current_id);
|
||||
@@ -43,28 +43,28 @@ if ($presenter) {
|
||||
|
||||
if (!$prev_page && !$next_page) return;
|
||||
?>
|
||||
<nav class="aksrt-doc-chapter-nav" aria-label="<?php esc_attr_e('章节导航', 'aksrt'); ?>">
|
||||
<nav class="jio-doc-chapter-nav" aria-label="<?php esc_attr_e('章节导航', 'jio'); ?>">
|
||||
<?php if ($prev_page) : ?>
|
||||
<a href="<?php echo esc_url(get_permalink($prev_page->ID)); ?>" class="aksrt-doc-chapter-nav__prev">
|
||||
<span class="aksrt-doc-chapter-nav__label">
|
||||
<a href="<?php echo esc_url(get_permalink($prev_page->ID)); ?>" class="jio-doc-chapter-nav__prev">
|
||||
<span class="jio-doc-chapter-nav__label">
|
||||
<i class="fa fas fa-arrow-left"></i>
|
||||
<?php esc_html_e('上一篇', 'aksrt'); ?>
|
||||
<?php esc_html_e('上一篇', 'jio'); ?>
|
||||
</span>
|
||||
<span class="aksrt-doc-chapter-nav__title"><?php echo esc_html($prev_page->post_title); ?></span>
|
||||
<span class="jio-doc-chapter-nav__title"><?php echo esc_html($prev_page->post_title); ?></span>
|
||||
</a>
|
||||
<?php else : ?>
|
||||
<div class="aksrt-doc-chapter-nav__prev aksrt-doc-chapter-nav__prev--disabled"></div>
|
||||
<div class="jio-doc-chapter-nav__prev jio-doc-chapter-nav__prev--disabled"></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($next_page) : ?>
|
||||
<a href="<?php echo esc_url(get_permalink($next_page->ID)); ?>" class="aksrt-doc-chapter-nav__next">
|
||||
<span class="aksrt-doc-chapter-nav__label">
|
||||
<?php esc_html_e('下一篇', 'aksrt'); ?>
|
||||
<a href="<?php echo esc_url(get_permalink($next_page->ID)); ?>" class="jio-doc-chapter-nav__next">
|
||||
<span class="jio-doc-chapter-nav__label">
|
||||
<?php esc_html_e('下一篇', 'jio'); ?>
|
||||
<i class="fa fas fa-arrow-right"></i>
|
||||
</span>
|
||||
<span class="aksrt-doc-chapter-nav__title"><?php echo esc_html($next_page->post_title); ?></span>
|
||||
<span class="jio-doc-chapter-nav__title"><?php echo esc_html($next_page->post_title); ?></span>
|
||||
</a>
|
||||
<?php else : ?>
|
||||
<div class="aksrt-doc-chapter-nav__next aksrt-doc-chapter-nav__next--disabled"></div>
|
||||
<div class="jio-doc-chapter-nav__next jio-doc-chapter-nav__next--disabled"></div>
|
||||
<?php endif; ?>
|
||||
</nav>
|
||||
@@ -5,7 +5,7 @@
|
||||
* Shows a card for a document page on the document navigation index.
|
||||
* Used in the document navigation page to list available documents.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
@@ -21,35 +21,35 @@ $child_count = count($children);
|
||||
$thumb = get_the_post_thumbnail_url($page_id, 'medium');
|
||||
$excerpt = wp_trim_words(get_the_excerpt(), 30, '...');
|
||||
?>
|
||||
<a href="<?php the_permalink(); ?>" class="aksrt-doc-index-card">
|
||||
<a href="<?php the_permalink(); ?>" class="jio-doc-index-card">
|
||||
<?php if ($thumb) : ?>
|
||||
<div class="aksrt-doc-index-card__thumb">
|
||||
<img<?php echo aksrt_get_lazy_attr('lazy_other', (string) $thumb); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="">
|
||||
<div class="jio-doc-index-card__thumb">
|
||||
<img<?php echo jio_get_lazy_attr('lazy_other', (string) $thumb); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="">
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="aksrt-doc-index-card__icon">
|
||||
<div class="jio-doc-index-card__icon">
|
||||
<i class="fa fas fa-book"></i>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="aksrt-doc-index-card__body">
|
||||
<h3 class="aksrt-doc-index-card__title"><?php the_title(); ?></h3>
|
||||
<div class="jio-doc-index-card__body">
|
||||
<h3 class="jio-doc-index-card__title"><?php the_title(); ?></h3>
|
||||
<?php if ($excerpt) : ?>
|
||||
<p class="aksrt-doc-index-card__desc"><?php echo esc_html($excerpt); ?></p>
|
||||
<p class="jio-doc-index-card__desc"><?php echo esc_html($excerpt); ?></p>
|
||||
<?php endif; ?>
|
||||
<div class="aksrt-doc-index-card__meta">
|
||||
<div class="jio-doc-index-card__meta">
|
||||
<?php if ($child_count > 0) : ?>
|
||||
<span class="aksrt-doc-index-card__count">
|
||||
<span class="jio-doc-index-card__count">
|
||||
<i class="fa fas fa-file-alt"></i>
|
||||
<?php printf(esc_html__('%d 篇文章', 'aksrt'), $child_count); ?>
|
||||
<?php printf(esc_html__('%d 篇文章', 'jio'), $child_count); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<span class="aksrt-doc-index-card__date">
|
||||
<span class="jio-doc-index-card__date">
|
||||
<i class="fa far fa-clock" aria-hidden="true"></i>
|
||||
<?php echo esc_html(get_the_date('', $page_id)); ?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<i class="fa fas fa-chevron-right aksrt-doc-index-card__arrow"></i>
|
||||
<i class="fa fas fa-chevron-right jio-doc-index-card__arrow"></i>
|
||||
</a>
|
||||
@@ -3,9 +3,9 @@
|
||||
* Docs Mode: Sidebar Navigation
|
||||
*
|
||||
* 文档模式侧边栏:显示文档目录树,当前章节高亮。
|
||||
* Uses \AKSRT\Core\DocsPresenter for tree construction.
|
||||
* Uses \Jio\Core\DocsPresenter for tree construction.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
@@ -14,7 +14,7 @@ $current_id = get_the_ID();
|
||||
$parent_id = wp_get_post_parent_id($current_id);
|
||||
$root_id = $parent_id ?: $current_id;
|
||||
|
||||
$presenter = class_exists('\AKSRT\Core\DocsPresenter') ? \AKSRT\Core\DocsPresenter::get_instance() : null;
|
||||
$presenter = class_exists('\Jio\Core\DocsPresenter') ? \Jio\Core\DocsPresenter::get_instance() : null;
|
||||
|
||||
if ($presenter) {
|
||||
$doc_pages = $presenter->get_flat_tree($root_id, 3);
|
||||
@@ -30,29 +30,29 @@ if ($presenter) {
|
||||
$root_page = get_post($root_id);
|
||||
|
||||
?>
|
||||
<aside class="aksrt-doc-sidebar" role="navigation" aria-label="<?php esc_attr_e('文档导航', 'aksrt'); ?>">
|
||||
<div class="aksrt-doc-sidebar__header">
|
||||
<a href="<?php echo esc_url(get_permalink($root_id)); ?>" class="aksrt-doc-sidebar__root">
|
||||
<i class="fa fas fa-book aksrt-doc-sidebar__root-icon"></i>
|
||||
<span><?php echo esc_html($root_page->post_title ?? __('文档', 'aksrt')); ?></span>
|
||||
<aside class="jio-doc-sidebar" role="navigation" aria-label="<?php esc_attr_e('文档导航', 'jio'); ?>">
|
||||
<div class="jio-doc-sidebar__header">
|
||||
<a href="<?php echo esc_url(get_permalink($root_id)); ?>" class="jio-doc-sidebar__root">
|
||||
<i class="fa fas fa-book jio-doc-sidebar__root-icon"></i>
|
||||
<span><?php echo esc_html($root_page->post_title ?? __('文档', 'jio')); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="aksrt-doc-sidebar__search">
|
||||
<input type="text" class="aksrt-doc-sidebar__search-input" placeholder="<?php esc_attr_e('搜索文档...', 'aksrt'); ?>" aria-label="<?php esc_attr_e('搜索文档', 'aksrt'); ?>">
|
||||
<i class="fa fas fa-search aksrt-doc-sidebar__search-icon"></i>
|
||||
<div class="jio-doc-sidebar__search">
|
||||
<input type="text" class="jio-doc-sidebar__search-input" placeholder="<?php esc_attr_e('搜索文档...', 'jio'); ?>" aria-label="<?php esc_attr_e('搜索文档', 'jio'); ?>">
|
||||
<i class="fa fas fa-search jio-doc-sidebar__search-icon"></i>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($doc_pages)) : ?>
|
||||
<ul class="aksrt-doc-sidebar__nav">
|
||||
<ul class="jio-doc-sidebar__nav">
|
||||
<?php foreach ($doc_pages as $dp) :
|
||||
$depth = isset($dp->_depth) ? (int) $dp->_depth : 0;
|
||||
$is_current = ((int) $dp->ID === $current_id);
|
||||
$is_ancestor = ((int) $dp->ID === $parent_id);
|
||||
$li_class = 'aksrt-doc-sidebar__item';
|
||||
$li_class = 'jio-doc-sidebar__item';
|
||||
if ($is_current) $li_class .= ' is-current';
|
||||
if ($is_ancestor) $li_class .= ' is-ancestor';
|
||||
if ($depth > 0) $li_class .= ' aksrt-doc-sidebar__item--depth-' . $depth;
|
||||
if ($depth > 0) $li_class .= ' jio-doc-sidebar__item--depth-' . $depth;
|
||||
|
||||
$has_children = false;
|
||||
if ($presenter) {
|
||||
@@ -65,9 +65,9 @@ $root_page = get_post($root_id);
|
||||
$is_open = $is_current || $is_ancestor;
|
||||
?>
|
||||
<li class="<?php echo esc_attr($li_class); ?>" style="<?php echo $depth > 0 ? 'padding-left:' . ($depth * 16) . 'px;' : ''; ?>">
|
||||
<a href="<?php echo esc_url(get_permalink($dp->ID)); ?>" class="aksrt-doc-sidebar__link<?php echo $is_current ? ' is-active' : ''; ?>">
|
||||
<a href="<?php echo esc_url(get_permalink($dp->ID)); ?>" class="jio-doc-sidebar__link<?php echo $is_current ? ' is-active' : ''; ?>">
|
||||
<?php if ($has_children) : ?>
|
||||
<i class="fa fas fa-chevron-<?php echo $is_open ? 'down' : 'right'; ?> aksrt-doc-sidebar__toggle" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-chevron-<?php echo $is_open ? 'down' : 'right'; ?> jio-doc-sidebar__toggle" aria-hidden="true"></i>
|
||||
<?php endif; ?>
|
||||
<span><?php echo esc_html($dp->post_title); ?></span>
|
||||
</a>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* 文档模式目录:从文章内容中提取 h2/h3 生成右侧目录。
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
@@ -29,11 +29,11 @@ if (preg_match_all('/<h([2-3])[^>]*(?:id="([^"]*)")?[^>]*>(.*?)<\/h\1>/is', $con
|
||||
|
||||
if (empty($headings)) return;
|
||||
?>
|
||||
<nav class="aksrt-doc-toc" aria-label="<?php esc_attr_e('文章目录', 'aksrt'); ?>">
|
||||
<div class="aksrt-doc-toc__title"><?php esc_html_e('目录', 'aksrt'); ?></div>
|
||||
<ul class="aksrt-doc-toc__list">
|
||||
<nav class="jio-doc-toc" aria-label="<?php esc_attr_e('文章目录', 'jio'); ?>">
|
||||
<div class="jio-doc-toc__title"><?php esc_html_e('目录', 'jio'); ?></div>
|
||||
<ul class="jio-doc-toc__list">
|
||||
<?php foreach ($headings as $h) : ?>
|
||||
<li class="aksrt-doc-toc__item aksrt-doc-toc__item--h<?php echo esc_attr((string) $h['level']); ?>">
|
||||
<li class="jio-doc-toc__item jio-doc-toc__item--h<?php echo esc_attr((string) $h['level']); ?>">
|
||||
<a href="#<?php echo esc_attr($h['id']); ?>"><?php echo esc_html($h['text']); ?></a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
*
|
||||
* 文档模式树形导航:递归展示文档层级结构。
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if (!function_exists('aksrt_render_doc_tree')) {
|
||||
function aksrt_render_doc_tree($parent_id, $current_id, $depth = 0) {
|
||||
if (!function_exists('jio_render_doc_tree')) {
|
||||
function jio_render_doc_tree($parent_id, $current_id, $depth = 0) {
|
||||
$children = get_pages([
|
||||
'parent' => $parent_id,
|
||||
'sort_column' => 'menu_order, post_title',
|
||||
@@ -19,14 +19,14 @@ if (!function_exists('aksrt_render_doc_tree')) {
|
||||
if (empty($children)) return;
|
||||
|
||||
$indent = str_repeat(' ', $depth);
|
||||
echo $indent . '<ul class="aksrt-doc-tree__level aksrt-doc-tree__level--' . esc_attr((string) ($depth + 1)) . '">';
|
||||
echo $indent . '<ul class="jio-doc-tree__level jio-doc-tree__level--' . esc_attr((string) ($depth + 1)) . '">';
|
||||
foreach ($children as $child) {
|
||||
$is_current = ($child->ID === $current_id);
|
||||
$has_children = (int) get_pages(['child_of' => $child->ID, 'parent' => $child->ID, 'hide_empty' => true, 'fields' => 'ids']) > 0;
|
||||
echo $indent . ' <li class="aksrt-doc-tree__item' . ($is_current ? ' is-current' : '') . '">';
|
||||
echo $indent . ' <li class="jio-doc-tree__item' . ($is_current ? ' is-current' : '') . '">';
|
||||
echo '<a href="' . esc_url(get_permalink($child->ID)) . '">' . esc_html($child->post_title) . '</a>';
|
||||
if ($has_children && $depth < 3) {
|
||||
aksrt_render_doc_tree($child->ID, $current_id, $depth + 1);
|
||||
jio_render_doc_tree($child->ID, $current_id, $depth + 1);
|
||||
}
|
||||
echo '</li>';
|
||||
}
|
||||
@@ -38,9 +38,9 @@ $current_id = get_the_ID();
|
||||
$root_id = wp_get_post_parent_id($current_id) ?: $current_id;
|
||||
?>
|
||||
|
||||
<nav class="aksrt-doc-tree" aria-label="<?php esc_attr_e('文档树', 'aksrt'); ?>">
|
||||
<div class="aksrt-doc-tree__root">
|
||||
<nav class="jio-doc-tree" aria-label="<?php esc_attr_e('文档树', 'jio'); ?>">
|
||||
<div class="jio-doc-tree__root">
|
||||
<a href="<?php echo esc_url(get_permalink($root_id)); ?>"><?php echo esc_html(get_the_title($root_id)); ?></a>
|
||||
</div>
|
||||
<?php aksrt_render_doc_tree($root_id, $current_id); ?>
|
||||
<?php jio_render_doc_tree($root_id, $current_id); ?>
|
||||
</nav>
|
||||
@@ -2,16 +2,16 @@
|
||||
/**
|
||||
* Download Center Hero Section
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
$page_title = get_the_title() ?: __('下载中心', 'aksrt');
|
||||
$page_desc = get_the_excerpt() ?: __('浏览和下载本站提供的各类资源。', 'aksrt');
|
||||
$page_title = get_the_title() ?: __('下载中心', 'jio');
|
||||
$page_desc = get_the_excerpt() ?: __('浏览和下载本站提供的各类资源。', 'jio');
|
||||
$current_filter = isset($_GET['resource_type']) ? sanitize_key((string) $_GET['resource_type']) : '';
|
||||
$resource_type_labels = function_exists('aksrt_get_pay_types') ? aksrt_get_pay_types() : [];
|
||||
unset($resource_type_labels[\AKSRT\Core\DomainModel::PAY_TYPE_READING]);
|
||||
$resource_type_labels = function_exists('jio_get_pay_types') ? jio_get_pay_types() : [];
|
||||
unset($resource_type_labels[\Jio\Core\DomainModel::PAY_TYPE_READING]);
|
||||
|
||||
$resource_count_query = new WP_Query([
|
||||
'post_type' => 'post',
|
||||
@@ -20,7 +20,7 @@ $resource_count_query = new WP_Query([
|
||||
'fields' => 'ids',
|
||||
'meta_query' => [
|
||||
[
|
||||
'key' => \AKSRT\Core\DomainModel::RESOURCE_MARKER_KEY,
|
||||
'key' => \Jio\Core\DomainModel::RESOURCE_MARKER_KEY,
|
||||
'value' => '1',
|
||||
],
|
||||
],
|
||||
@@ -28,36 +28,36 @@ $resource_count_query = new WP_Query([
|
||||
$total_published = (int) $resource_count_query->found_posts;
|
||||
wp_reset_postdata();
|
||||
?>
|
||||
<div class="aksrt-download-hero">
|
||||
<div class="aksrt-download-hero__bg"></div>
|
||||
<div class="aksrt-download-hero__content">
|
||||
<h1 class="aksrt-download-hero__title"><?php echo esc_html($page_title); ?></h1>
|
||||
<div class="jio-download-hero">
|
||||
<div class="jio-download-hero__bg"></div>
|
||||
<div class="jio-download-hero__content">
|
||||
<h1 class="jio-download-hero__title"><?php echo esc_html($page_title); ?></h1>
|
||||
<?php if ($page_desc) : ?>
|
||||
<p class="aksrt-download-hero__desc"><?php echo esc_html($page_desc); ?></p>
|
||||
<p class="jio-download-hero__desc"><?php echo esc_html($page_desc); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="aksrt-download-hero__stats">
|
||||
<div class="aksrt-download-hero__stat">
|
||||
<span class="aksrt-download-hero__stat-num"><?php echo esc_html(number_format_i18n($total_published)); ?></span>
|
||||
<span class="aksrt-download-hero__stat-label"><?php esc_html_e('资源总数', 'aksrt'); ?></span>
|
||||
<div class="jio-download-hero__stats">
|
||||
<div class="jio-download-hero__stat">
|
||||
<span class="jio-download-hero__stat-num"><?php echo esc_html(number_format_i18n($total_published)); ?></span>
|
||||
<span class="jio-download-hero__stat-label"><?php esc_html_e('资源总数', 'jio'); ?></span>
|
||||
</div>
|
||||
<?php if (!empty($resource_type_labels)) : ?>
|
||||
<div class="aksrt-download-hero__stat">
|
||||
<span class="aksrt-download-hero__stat-num"><?php echo esc_html(count($resource_type_labels)); ?></span>
|
||||
<span class="aksrt-download-hero__stat-label"><?php esc_html_e('资源类型', 'aksrt'); ?></span>
|
||||
<div class="jio-download-hero__stat">
|
||||
<span class="jio-download-hero__stat-num"><?php echo esc_html(count($resource_type_labels)); ?></span>
|
||||
<span class="jio-download-hero__stat-label"><?php esc_html_e('资源类型', 'jio'); ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($resource_type_labels)) : ?>
|
||||
<div class="aksrt-download-hero__filters">
|
||||
<a href="<?php echo esc_url(get_permalink()); ?>" class="aksrt-download-hero__filter<?php echo $current_filter === '' ? ' aksrt-download-hero__filter--active' : ''; ?>">
|
||||
<?php esc_html_e('全部', 'aksrt'); ?>
|
||||
<div class="jio-download-hero__filters">
|
||||
<a href="<?php echo esc_url(get_permalink()); ?>" class="jio-download-hero__filter<?php echo $current_filter === '' ? ' jio-download-hero__filter--active' : ''; ?>">
|
||||
<?php esc_html_e('全部', 'jio'); ?>
|
||||
</a>
|
||||
<?php foreach ($resource_type_labels as $type_key => $type_label) : ?>
|
||||
<a
|
||||
href="<?php echo esc_url(add_query_arg('resource_type', $type_key, get_permalink())); ?>"
|
||||
class="aksrt-download-hero__filter<?php echo $current_filter === $type_key ? ' aksrt-download-hero__filter--active' : ''; ?>"
|
||||
class="jio-download-hero__filter<?php echo $current_filter === $type_key ? ' jio-download-hero__filter--active' : ''; ?>"
|
||||
>
|
||||
<?php echo esc_html($type_label); ?>
|
||||
</a>
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* Download Permission Card
|
||||
*
|
||||
* Shows download status and actions from \AKSRT\Content\DownloadState
|
||||
* Shows download status and actions from \Jio\Content\DownloadState
|
||||
* (Content_Visibility + cashier unlock — not per-download credits).
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
@@ -16,7 +16,7 @@ $state = [
|
||||
'state' => 'available',
|
||||
'can_download' => true,
|
||||
'message' => '',
|
||||
'action_label' => __('立即下载', 'aksrt'),
|
||||
'action_label' => __('立即下载', 'jio'),
|
||||
'action_url' => '',
|
||||
'cost' => 0,
|
||||
'balance' => 0,
|
||||
@@ -27,26 +27,26 @@ $state = [
|
||||
'need_vip' => false,
|
||||
];
|
||||
|
||||
if (class_exists('\AKSRT\Content\DownloadState')) {
|
||||
$state = array_merge($state, \AKSRT\Content\DownloadState::get_instance()->resolve($post_id));
|
||||
} elseif (function_exists('aksrt_can_download')) {
|
||||
$gate = aksrt_can_download($post_id);
|
||||
if (class_exists('\Jio\Content\DownloadState')) {
|
||||
$state = array_merge($state, \Jio\Content\DownloadState::get_instance()->resolve($post_id));
|
||||
} elseif (function_exists('jio_can_download')) {
|
||||
$gate = jio_can_download($post_id);
|
||||
if (is_wp_error($gate)) {
|
||||
$code = $gate->get_error_code();
|
||||
$data = (array) $gate->get_error_data();
|
||||
$state['can_download'] = false;
|
||||
$state['message'] = $gate->get_error_message();
|
||||
if ($code === 'aksrt_need_login') {
|
||||
if ($code === 'jio_need_login') {
|
||||
$state['state'] = 'not_logged_in';
|
||||
$state['action_label'] = __('登录下载', 'aksrt');
|
||||
$state['action_label'] = __('登录下载', 'jio');
|
||||
$state['action_url'] = (string) ($data['login_url'] ?? $state['login_url']);
|
||||
} elseif ($code === 'aksrt_need_vip') {
|
||||
} elseif ($code === 'jio_need_vip') {
|
||||
$state['state'] = 'need_vip';
|
||||
$state['action_label'] = __('开通会员', 'aksrt');
|
||||
$state['action_label'] = __('开通会员', 'jio');
|
||||
$state['need_vip'] = true;
|
||||
} else {
|
||||
$state['state'] = 'need_purchase';
|
||||
$state['action_label'] = __('去购买', 'aksrt');
|
||||
$state['action_label'] = __('去购买', 'jio');
|
||||
$state['need_purchase'] = true;
|
||||
}
|
||||
}
|
||||
@@ -58,7 +58,7 @@ if ($status === 'insufficient_credits') {
|
||||
}
|
||||
$can_download = !empty($state['can_download']);
|
||||
$status_text = (string) ($state['message'] ?? '');
|
||||
$action_label = (string) ($state['action_label'] ?? __('立即下载', 'aksrt'));
|
||||
$action_label = (string) ($state['action_label'] ?? __('立即下载', 'jio'));
|
||||
$action_url = (string) ($state['action_url'] ?? '');
|
||||
$login_url = (string) ($state['login_url'] ?? wp_login_url(get_permalink($post_id)));
|
||||
$pay_modo = (string) ($state['pay_modo'] ?? '0');
|
||||
@@ -80,7 +80,7 @@ $state_info = $state_icons[$status] ?? $state_icons['available'];
|
||||
<div class="download-permission-card download-permission-card--<?php echo esc_attr($status); ?>">
|
||||
<div class="download-permission-card__status download-permission-card__status--<?php echo esc_attr($state_info['color']); ?>">
|
||||
<i class="fa <?php echo esc_attr($state_info['icon']); ?>" aria-hidden="true"></i>
|
||||
<span><?php echo esc_html($status_text !== '' ? $status_text : __('可下载', 'aksrt')); ?></span>
|
||||
<span><?php echo esc_html($status_text !== '' ? $status_text : __('可下载', 'jio')); ?></span>
|
||||
</div>
|
||||
|
||||
<?php if ($need_purchase && $amount > 0) : ?>
|
||||
@@ -91,15 +91,15 @@ $state_info = $state_icons[$status] ?? $state_icons['available'];
|
||||
if ($pay_modo === 'points') {
|
||||
printf(
|
||||
/* translators: 1: points, 2: currency name */
|
||||
esc_html__('购买价格:%1$d %2$s', 'aksrt'),
|
||||
esc_html__('购买价格:%1$d %2$s', 'jio'),
|
||||
(int) ceil($amount),
|
||||
esc_html((string) ($currency_name ?? __('积分', 'aksrt')))
|
||||
esc_html((string) ($currency_name ?? __('积分', 'jio')))
|
||||
);
|
||||
} else {
|
||||
printf(
|
||||
/* translators: %s: price */
|
||||
esc_html__('购买价格:¥%s', 'aksrt'),
|
||||
esc_html(function_exists('aksrt_format_price') ? aksrt_format_price($amount) : (string) $amount)
|
||||
esc_html__('购买价格:¥%s', 'jio'),
|
||||
esc_html(function_exists('jio_format_price') ? jio_format_price($amount) : (string) $amount)
|
||||
);
|
||||
}
|
||||
?>
|
||||
@@ -109,21 +109,21 @@ $state_info = $state_icons[$status] ?? $state_icons['available'];
|
||||
|
||||
<div class="download-permission-card__actions">
|
||||
<?php if ($can_download) : ?>
|
||||
<span class="download-permission-card__hint"><?php esc_html_e('请在下方选择下载源', 'aksrt'); ?></span>
|
||||
<span class="download-permission-card__hint"><?php esc_html_e('请在下方选择下载源', 'jio'); ?></span>
|
||||
<?php elseif ($status === 'not_logged_in' && ($action_url !== '' || $login_url !== '')) : ?>
|
||||
<a class="btn-primary btn-sm" href="<?php echo esc_url($action_url !== '' ? $action_url : $login_url); ?>">
|
||||
<?php echo esc_html($action_label); ?>
|
||||
</a>
|
||||
<?php elseif ($need_vip) : ?>
|
||||
<a class="btn-primary btn-sm" href="<?php echo esc_url($action_url !== '' ? $action_url : (function_exists('aksrt_get_user_center_tab_url') ? aksrt_get_user_center_tab_url('credits') : home_url('/'))); ?>">
|
||||
<a class="btn-primary btn-sm" href="<?php echo esc_url($action_url !== '' ? $action_url : (function_exists('jio_get_user_center_tab_url') ? jio_get_user_center_tab_url('credits') : home_url('/'))); ?>">
|
||||
<?php echo esc_html($action_label); ?>
|
||||
</a>
|
||||
<?php elseif ($need_purchase) : ?>
|
||||
<button type="button" class="btn-primary btn-sm" data-aksrt-pay-content="<?php echo esc_attr((string) $post_id); ?>">
|
||||
<button type="button" class="btn-primary btn-sm" data-jio-pay-content="<?php echo esc_attr((string) $post_id); ?>">
|
||||
<?php echo esc_html($action_label); ?>
|
||||
</button>
|
||||
<?php else : ?>
|
||||
<span class="download-permission-card__hint"><?php echo esc_html($status_text !== '' ? $status_text : __('暂无权限', 'aksrt')); ?></span>
|
||||
<span class="download-permission-card__hint"><?php echo esc_html($status_text !== '' ? $status_text : __('暂无权限', 'jio')); ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* Fixed homepage layout inspired by legacy.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
aksrt_homepage_render_layout();
|
||||
jio_homepage_render_layout();
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* 在需要登录才能访问的内容区域展示。
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @var string $message 提示文字
|
||||
@@ -13,10 +13,10 @@
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
$message = $args['message'] ?? __('登录后查看完整内容', 'aksrt');
|
||||
$message = $args['message'] ?? __('登录后查看完整内容', 'jio');
|
||||
$redirect = $args['redirect'] ?? get_permalink();
|
||||
$login_url = function_exists('aksrt_get_login_url') ? aksrt_get_login_url($redirect) : wp_login_url($redirect);
|
||||
$register_url = function_exists('aksrt_get_register_url') ? aksrt_get_register_url() : wp_registration_url();
|
||||
$login_url = function_exists('jio_get_login_url') ? jio_get_login_url($redirect) : wp_login_url($redirect);
|
||||
$register_url = function_exists('jio_get_register_url') ? jio_get_register_url() : wp_registration_url();
|
||||
$can_register = get_option('users_can_register');
|
||||
?>
|
||||
|
||||
@@ -28,11 +28,11 @@ $can_register = get_option('users_can_register');
|
||||
<p class="login-prompt__text"><?php echo esc_html($message); ?></p>
|
||||
<div class="login-prompt__btns">
|
||||
<a href="<?php echo esc_url($login_url); ?>" class="btn btn-primary btn-sm">
|
||||
<i class="fa fas fa-sign-in-alt"></i> <?php esc_html_e('登录', 'aksrt'); ?>
|
||||
<i class="fa fas fa-sign-in-alt"></i> <?php esc_html_e('登录', 'jio'); ?>
|
||||
</a>
|
||||
<?php if ($can_register) : ?>
|
||||
<a href="<?php echo esc_url($register_url); ?>" class="btn btn-outline-primary btn-sm">
|
||||
<i class="fa fas fa-user-plus"></i> <?php esc_html_e('注册', 'aksrt'); ?>
|
||||
<i class="fa fas fa-user-plus"></i> <?php esc_html_e('注册', 'jio'); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
/**
|
||||
* Shared authentication modal shell.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if (is_user_logged_in() || (class_exists('\AKSRT\Settings\Settings') && \AKSRT\Settings\Settings::close_sign())) {
|
||||
if (is_user_logged_in() || (class_exists('\Jio\Settings\Settings') && \Jio\Settings\Settings::close_sign())) {
|
||||
return;
|
||||
}
|
||||
|
||||
$modal_ui = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::modal_ui() : [];
|
||||
$modal_ui = class_exists('\Jio\Settings\Settings') ? \Jio\Settings\Settings::modal_ui() : [];
|
||||
$images = $modal_ui['background'] ?? [];
|
||||
$image_id = $images ? (int) $images[array_rand($images)] : 0;
|
||||
$image_html = $image_id > 0 ? wp_get_attachment_image($image_id, 'full', false, [
|
||||
@@ -20,22 +20,22 @@ $image_html = $image_id > 0 ? wp_get_attachment_image($image_id, 'full', false,
|
||||
'loading' => 'lazy',
|
||||
'decoding' => 'async',
|
||||
]) : '';
|
||||
$auto = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::sign_modal_auto() : ['enabled' => false, 'waiting' => 5, 'expires' => 1];
|
||||
$wechat = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_weixingzh_settings() : [];
|
||||
$initial_tab = !empty($wechat['priority']) && class_exists('\AKSRT\Auth\WeixinGzh') && \AKSRT\Auth\WeixinGzh::is_enabled() ? 'oauth' : 'signin';
|
||||
$aksrt_auth_context = [
|
||||
$auto = class_exists('\Jio\Settings\Settings') ? \Jio\Settings\Settings::sign_modal_auto() : ['enabled' => false, 'waiting' => 5, 'expires' => 1];
|
||||
$wechat = class_exists('\Jio\Settings\Settings') ? \Jio\Settings\Settings::get_weixingzh_settings() : [];
|
||||
$initial_tab = !empty($wechat['priority']) && class_exists('\Jio\Auth\WeixinGzh') && \Jio\Auth\WeixinGzh::is_enabled() ? 'oauth' : 'signin';
|
||||
$jio_auth_context = [
|
||||
'surface' => 'modal',
|
||||
'tab' => $initial_tab,
|
||||
'show_logo' => !empty($modal_ui['show_logo']),
|
||||
'redirect_to' => home_url('/'),
|
||||
];
|
||||
?>
|
||||
<div id="u_sign" class="aksrt-auth-modal<?php echo $image_html !== '' ? ' has-sign-img' : ''; ?>" aria-hidden="true" role="dialog" aria-modal="true" aria-labelledby="aksrt-auth-modal-title" tabindex="-1" data-auth-modal data-auto="<?php echo !empty($auto['enabled']) ? '1' : '0'; ?>" data-auto-wait="<?php echo esc_attr((string) $auto['waiting']); ?>" data-auto-expires="<?php echo esc_attr((string) $auto['expires']); ?>">
|
||||
<h2 id="aksrt-auth-modal-title" class="screen-reader-text"><?php esc_html_e('账户登录与注册', 'aksrt'); ?></h2>
|
||||
<div id="u_sign" class="jio-auth-modal<?php echo $image_html !== '' ? ' has-sign-img' : ''; ?>" aria-hidden="true" role="dialog" aria-modal="true" aria-labelledby="jio-auth-modal-title" tabindex="-1" data-auth-modal data-auto="<?php echo !empty($auto['enabled']) ? '1' : '0'; ?>" data-auto-wait="<?php echo esc_attr((string) $auto['waiting']); ?>" data-auto-expires="<?php echo esc_attr((string) $auto['expires']); ?>">
|
||||
<h2 id="jio-auth-modal-title" class="screen-reader-text"><?php esc_html_e('账户登录与注册', 'jio'); ?></h2>
|
||||
<div class="auth-modal-backdrop" data-auth-close></div>
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<button type="button" class="auth-modal-close" data-auth-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><i class="fa fas fa-times"></i></button>
|
||||
<button type="button" class="auth-modal-close" data-auth-close aria-label="<?php esc_attr_e('关闭', 'jio'); ?>"><i class="fa fas fa-times"></i></button>
|
||||
<?php if ($image_html !== '') : ?><div class="sign-img"><?php echo $image_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div><?php endif; ?>
|
||||
<?php require get_template_directory() . '/templates/parts/auth-content.php'; ?>
|
||||
</div>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* cover – cover image URL override
|
||||
* extra – extra HTML (caller escapes)
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
@@ -22,8 +22,8 @@ $args = is_array($args ?? null) ? $args : [];
|
||||
// Resolve style: explicit args > global setting.
|
||||
$ph_style = array_key_exists('style', $args) ? $args['style'] : null;
|
||||
if ($ph_style === null) {
|
||||
$ph_style = class_exists('\AKSRT\Settings\Settings')
|
||||
? (\AKSRT\Settings\Settings::get_other_page_settings()['header_style'] ?? '1')
|
||||
$ph_style = class_exists('\Jio\Settings\Settings')
|
||||
? (\Jio\Settings\Settings::get_other_page_settings()['header_style'] ?? '1')
|
||||
: '1';
|
||||
}
|
||||
if ($ph_style === 'not') {
|
||||
@@ -42,8 +42,8 @@ $ph_extra = (string) ($args['extra'] ?? '');
|
||||
|
||||
// Cover image: explicit args > global setting > post thumbnail.
|
||||
$ph_cover = (string) ($args['cover'] ?? '');
|
||||
if ($ph_cover === '' && class_exists('\AKSRT\Settings\Settings')) {
|
||||
$other = \AKSRT\Settings\Settings::get_other_page_settings();
|
||||
if ($ph_cover === '' && class_exists('\Jio\Settings\Settings')) {
|
||||
$other = \Jio\Settings\Settings::get_other_page_settings();
|
||||
$ph_cover = (string) ($other['header_cover_img'] ?? '');
|
||||
}
|
||||
if ($ph_cover === '' && has_post_thumbnail()) {
|
||||
|
||||
@@ -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>
|
||||
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* Resource Related
|
||||
*
|
||||
* 单篇资源页底部「相关资源」:同分类其它资源帖(post + _aksrt_is_resource)。
|
||||
* 单篇资源页底部「相关资源」:同分类其它资源帖(post + _jio_is_resource)。
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
@@ -20,14 +20,14 @@ $args = [
|
||||
'posts_per_page' => 6,
|
||||
'post__not_in' => [$current_id],
|
||||
'category__in' => array_map('intval', $cat_ids),
|
||||
'meta_key' => '_aksrt_res_download_count',
|
||||
'meta_key' => '_jio_res_download_count',
|
||||
'orderby' => 'meta_value_num',
|
||||
'order' => 'DESC',
|
||||
'no_found_rows' => true,
|
||||
'meta_query' => [
|
||||
function_exists('aksrt_resource_meta_query')
|
||||
? aksrt_resource_meta_query()
|
||||
: ['key' => '_aksrt_is_resource', 'value' => '1', 'compare' => '='],
|
||||
function_exists('jio_resource_meta_query')
|
||||
? jio_resource_meta_query()
|
||||
: ['key' => '_jio_is_resource', 'value' => '1', 'compare' => '='],
|
||||
],
|
||||
];
|
||||
|
||||
@@ -39,11 +39,11 @@ if (!$query->have_posts()) {
|
||||
}
|
||||
?>
|
||||
|
||||
<section class="resource-related" aria-label="<?php esc_attr_e('相关资源', 'aksrt'); ?>">
|
||||
<section class="resource-related" aria-label="<?php esc_attr_e('相关资源', 'jio'); ?>">
|
||||
<header class="resource-related__header">
|
||||
<h2 class="resource-related__title"><?php esc_html_e('相关资源', 'aksrt'); ?></h2>
|
||||
<h2 class="resource-related__title"><?php esc_html_e('相关资源', 'jio'); ?></h2>
|
||||
</header>
|
||||
<div class="resource-related__grid aksrt-panel">
|
||||
<div class="resource-related__grid jio-panel">
|
||||
<div class="swiper-container swiper-scroll">
|
||||
<div class="swiper-wrapper">
|
||||
<?php
|
||||
@@ -52,7 +52,7 @@ if (!$query->have_posts()) {
|
||||
$post = get_post();
|
||||
if ($post instanceof WP_Post) {
|
||||
echo '<div class="swiper-slide mr10">' .
|
||||
aksrt_render_graphic_card_post($post) . // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
jio_render_graphic_card_post($post) . // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* show_time bool Relative publish/update time (default true)
|
||||
* meta_html string Prebuilt single-metabox HTML
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
@@ -17,20 +17,20 @@ $meta_html = (string) ($args['meta_html'] ?? '');
|
||||
|
||||
$author_id = (int) get_the_author_meta('ID');
|
||||
$author_name = get_the_author();
|
||||
$author_url = function_exists('aksrt_get_user_home_url') ? aksrt_get_user_home_url($author_id) : get_author_posts_url($author_id);
|
||||
$author_url = function_exists('jio_get_user_home_url') ? jio_get_user_home_url($author_id) : get_author_posts_url($author_id);
|
||||
$modified_ts = (int) get_the_modified_time('U');
|
||||
$published_ts = (int) get_the_time('U');
|
||||
$use_modified = $modified_ts > $published_ts;
|
||||
$rel_base = $use_modified ? $modified_ts : $published_ts;
|
||||
$rel_label = $use_modified ? __('更新', 'aksrt') : __('发布', 'aksrt');
|
||||
$rel_label = $use_modified ? __('更新', 'jio') : __('发布', 'jio');
|
||||
$abs_fmt = $use_modified
|
||||
? sprintf(__('%s更新', 'aksrt'), get_the_modified_time('Y年m月d日 H:i'))
|
||||
: sprintf(__('%s发布', 'aksrt'), get_the_time('Y年m月d日 H:i'));
|
||||
? sprintf(__('%s更新', 'jio'), get_the_modified_time('Y年m月d日 H:i'))
|
||||
: sprintf(__('%s发布', 'jio'), get_the_time('Y年m月d日 H:i'));
|
||||
$time_text = human_time_diff($rel_base, (int) current_time('timestamp')) . $rel_label;
|
||||
$description = function_exists('aksrt_get_user_description')
|
||||
? aksrt_get_user_description($author_id)
|
||||
$description = function_exists('jio_get_user_description')
|
||||
? jio_get_user_description($author_id)
|
||||
: trim((string) get_the_author_meta('description'));
|
||||
$name_html = aksrt_get_user_name([
|
||||
$name_html = jio_get_user_name([
|
||||
'id' => $author_id,
|
||||
'class' => 'name flex ac flex1',
|
||||
'name_class' => '',
|
||||
@@ -40,9 +40,9 @@ $name_html = aksrt_get_user_name([
|
||||
'level' => true,
|
||||
'follow' => false,
|
||||
]);
|
||||
$follow_html = aksrt_get_user_follow('px12-sm ml10 follow but c-red', $author_id);
|
||||
$reward_button = get_current_user_id() !== $author_id && function_exists('aksrt_get_rewards_button')
|
||||
? aksrt_get_rewards_button($author_id, 'ml6 but c-yellow px12-sm', get_the_ID())
|
||||
$follow_html = jio_get_user_follow('px12-sm ml10 follow but c-red', $author_id);
|
||||
$reward_button = get_current_user_id() !== $author_id && function_exists('jio_get_rewards_button')
|
||||
? jio_get_rewards_button($author_id, 'ml6 but c-yellow px12-sm', get_the_ID())
|
||||
: '';
|
||||
?>
|
||||
|
||||
@@ -50,8 +50,8 @@ $reward_button = get_current_user_id() !== $author_id && function_exists('aksrt_
|
||||
<div class="user-info flex ac article-avatar">
|
||||
<a href="<?php echo esc_url($author_url); ?>">
|
||||
<span class="avatar-img">
|
||||
<?php if (function_exists('aksrt_get_avatar_html')) : ?>
|
||||
<?php echo aksrt_get_avatar_html($author_id, 42, ['class' => 'avatar avatar-id-' . $author_id]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php if (function_exists('jio_get_avatar_html')) : ?>
|
||||
<?php echo jio_get_avatar_html($author_id, 42, ['class' => 'avatar avatar-id-' . $author_id]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php else : ?>
|
||||
<?php echo get_avatar($author_id, 42, '', esc_attr($author_name), ['class' => 'avatar avatar-id-' . $author_id]); ?>
|
||||
<?php endif; ?>
|
||||
@@ -67,8 +67,8 @@ $reward_button = get_current_user_id() !== $author_id && function_exists('aksrt_
|
||||
<span class="icon-circle"><?php echo esc_html($description); ?></span>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
$post_city = function_exists('aksrt_get_post_author_city_badge_html')
|
||||
? aksrt_get_post_author_city_badge_html($author_id, 'badg badg-sm')
|
||||
$post_city = function_exists('jio_get_post_author_city_badge_html')
|
||||
? jio_get_post_author_city_badge_html($author_id, 'badg badg-sm')
|
||||
: '';
|
||||
if ($post_city !== '') {
|
||||
echo $post_city; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
@@ -80,7 +80,7 @@ $reward_button = get_current_user_id() !== $author_id && function_exists('aksrt_
|
||||
<?php echo $follow_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php if ($reward_button !== '') : ?>
|
||||
<?php echo $reward_button; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php aksrt_render_rewards_template_for_user($author_id, get_the_ID()); ?>
|
||||
<?php jio_render_rewards_template_for_user($author_id, get_the_ID()); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
*
|
||||
* Expects no output. Returns $ctx array.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
$front = class_exists('\AKSRT\Core\FrontSubmit') ? \AKSRT\Core\FrontSubmit::get_instance() : null;
|
||||
$front = class_exists('\Jio\Core\FrontSubmit') ? \Jio\Core\FrontSubmit::get_instance() : null;
|
||||
$user_id = get_current_user_id();
|
||||
$settings = $front ? $front->settings() : (class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_submit_settings() : []);
|
||||
$settings = $front ? $front->settings() : (class_exists('\Jio\Settings\Settings') ? \Jio\Settings\Settings::get_submit_settings() : []);
|
||||
$enabled = !isset($settings['enabled']) || !empty($settings['enabled']);
|
||||
|
||||
$edit_id = isset($_GET['edit']) ? absint($_GET['edit']) : 0;
|
||||
@@ -38,17 +38,17 @@ $cap = static function (string $c) use ($front, $user_id, $edit_id): bool {
|
||||
if ($front) {
|
||||
return $front->user_can_cap($c, $user_id, $edit_id ?: null);
|
||||
}
|
||||
return function_exists('aksrt_user_can') ? aksrt_user_can($c, $user_id, $edit_id ?: null) : ($user_id > 0);
|
||||
return function_exists('jio_user_can') ? jio_user_can($c, $user_id, $edit_id ?: null) : ($user_id > 0);
|
||||
};
|
||||
|
||||
$post_meta = [];
|
||||
if ($edit_post) {
|
||||
$raw_meta = get_post_meta($edit_post->ID, \AKSRT\Core\DomainModel::POST_META_KEY, true);
|
||||
$raw_meta = get_post_meta($edit_post->ID, \Jio\Core\DomainModel::POST_META_KEY, true);
|
||||
$post_meta = is_array($raw_meta) ? $raw_meta : [];
|
||||
}
|
||||
$pay_meta = ($edit_post && function_exists('aksrt_get_pay_meta'))
|
||||
? aksrt_get_pay_meta($edit_post->ID)
|
||||
: (class_exists('\AKSRT\Core\DomainModel') ? \AKSRT\Core\DomainModel::default_pay_meta() : []);
|
||||
$pay_meta = ($edit_post && function_exists('jio_get_pay_meta'))
|
||||
? jio_get_pay_meta($edit_post->ID)
|
||||
: (class_exists('\Jio\Core\DomainModel') ? \Jio\Core\DomainModel::default_pay_meta() : []);
|
||||
|
||||
// Featured initial args for JS.
|
||||
$featured_args = ['type' => '', 'data' => new stdClass(), 'options' => [
|
||||
@@ -110,8 +110,8 @@ $current_cats = $edit_post ? wp_get_post_categories($edit_post->ID) : [];
|
||||
|
||||
$custom_dimensions = [];
|
||||
$current_cf = [];
|
||||
if (!empty($settings['custom_filter_s']) && class_exists('\AKSRT\Settings\Settings')) {
|
||||
$filter_all = \AKSRT\Settings\Settings::get_post_filter_settings();
|
||||
if (!empty($settings['custom_filter_s']) && class_exists('\Jio\Settings\Settings')) {
|
||||
$filter_all = \Jio\Settings\Settings::get_post_filter_settings();
|
||||
$custom_dimensions = $filter_all['custom_filter'] ?? [];
|
||||
if ($edit_post && !empty($custom_dimensions)) {
|
||||
foreach ($custom_dimensions as $dim) {
|
||||
@@ -119,7 +119,7 @@ if (!empty($settings['custom_filter_s']) && class_exists('\AKSRT\Settings\Settin
|
||||
if ($key === '') {
|
||||
continue;
|
||||
}
|
||||
$current_cf[$key] = get_post_meta($edit_post->ID, '_aksrt_cf_' . $key, true);
|
||||
$current_cf[$key] = get_post_meta($edit_post->ID, '_jio_cf_' . $key, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -146,12 +146,12 @@ if ($user_id > 0) {
|
||||
}
|
||||
|
||||
// VIP labels / points.
|
||||
$vip = class_exists('\AKSRT\Settings\Settings') && method_exists('\AKSRT\Settings\Settings', 'get_vip_settings')
|
||||
? \AKSRT\Settings\Settings::get_vip_settings()
|
||||
$vip = class_exists('\Jio\Settings\Settings') && method_exists('\Jio\Settings\Settings', 'get_vip_settings')
|
||||
? \Jio\Settings\Settings::get_vip_settings()
|
||||
: [];
|
||||
if (empty($vip) && class_exists('\AKSRT\Settings\PaymentRuntime')) {
|
||||
if (empty($vip) && class_exists('\Jio\Settings\PaymentRuntime')) {
|
||||
// Fallback: read common keys.
|
||||
$all = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_all() : [];
|
||||
$all = class_exists('\Jio\Settings\Settings') ? \Jio\Settings\Settings::get_all() : [];
|
||||
$vip = [
|
||||
'vip1_enabled' => !empty($all['pay_user_vip_1_s']),
|
||||
'vip2_enabled' => !empty($all['pay_user_vip_2_s']),
|
||||
@@ -166,15 +166,15 @@ $vip = [
|
||||
'vip1_name' => (string) ($vip['vip1_name'] ?? $vip_levels[1]['name'] ?? 'VIP1'),
|
||||
'vip2_name' => (string) ($vip['vip2_name'] ?? $vip_levels[2]['name'] ?? 'VIP2'),
|
||||
];
|
||||
$points_enabled = class_exists('\AKSRT\Settings\Settings') && method_exists('\AKSRT\Settings\Settings', 'credits_enabled')
|
||||
? \AKSRT\Settings\Settings::credits_enabled()
|
||||
$points_enabled = class_exists('\Jio\Settings\Settings') && method_exists('\Jio\Settings\Settings', 'credits_enabled')
|
||||
? \Jio\Settings\Settings::credits_enabled()
|
||||
: false;
|
||||
|
||||
$submit_label = __('发布', 'aksrt');
|
||||
$submit_label = __('发布', 'jio');
|
||||
if ($is_guest) {
|
||||
$submit_label = __('审核', 'aksrt');
|
||||
$submit_label = __('审核', 'jio');
|
||||
} elseif ($edit_post && in_array($post_status, ['publish', 'pending'], true)) {
|
||||
$submit_label = __('保存', 'aksrt');
|
||||
$submit_label = __('保存', 'jio');
|
||||
}
|
||||
|
||||
return [
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Main column: cover + title + editor + status.
|
||||
*
|
||||
* @var array $ctx
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -27,7 +27,7 @@ $is_can_new = !empty($ctx['is_can_new']);
|
||||
tabindex="1"
|
||||
rows="1"
|
||||
maxlength="<?php echo esc_attr((string) ((int) ($settings['title_max'] ?? 30) * 4)); ?>"
|
||||
placeholder="<?php echo esc_attr((string) ($settings['title_placeholder'] ?? __('请输入标题', 'aksrt'))); ?>"
|
||||
placeholder="<?php echo esc_attr((string) ($settings['title_placeholder'] ?? __('请输入标题', 'jio'))); ?>"
|
||||
data-auto-height
|
||||
data-max-height="<?php echo wp_is_mobile() ? '110' : '78'; ?>"
|
||||
><?php echo esc_textarea((string) $ctx['current_title']); ?></textarea>
|
||||
@@ -37,24 +37,24 @@ $is_can_new = !empty($ctx['is_can_new']);
|
||||
<?php if (!$is_can_new) : ?>
|
||||
<div class="flex jc newposts-nocan" style="min-height:50vh;">
|
||||
<div class="text-center"><div><i class="fa fas fa-lock"></i></div>
|
||||
<p><?php esc_html_e('无法发布', 'aksrt'); ?></p>
|
||||
<p class="muted-color"><?php esc_html_e('你当前没有前台投稿权限,请联系管理员开通。', 'aksrt'); ?></p></div>
|
||||
<p><?php esc_html_e('无法发布', 'jio'); ?></p>
|
||||
<p class="muted-color"><?php esc_html_e('你当前没有前台投稿权限,请联系管理员开通。', 'jio'); ?></p></div>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="newposts-editor">
|
||||
<?php
|
||||
$toolbar1 = ['formatselect', 'bold', 'italic', 'bullist', 'numlist', 'alignleft', 'aligncenter', 'alignright', 'link'];
|
||||
if (!empty($ctx['can_upload_img'])) {
|
||||
$toolbar1[] = 'aksrt_image';
|
||||
$toolbar1[] = 'jio_image';
|
||||
}
|
||||
$toolbar1[] = 'aksrt_video';
|
||||
$toolbar1[] = 'jio_video';
|
||||
if (!empty($ctx['can_upload_file'])) {
|
||||
$toolbar1[] = 'aksrt_file';
|
||||
$toolbar1[] = 'jio_file';
|
||||
}
|
||||
if (!empty($ctx['can_hide'])) {
|
||||
$toolbar1[] = 'aksrt_hide';
|
||||
$toolbar1[] = 'jio_hide';
|
||||
}
|
||||
$toolbar1 = implode(',', array_merge($toolbar1, ['aksrt_quote', 'aksrt_precode', 'fullscreen', 'wp_adv']));
|
||||
$toolbar1 = implode(',', array_merge($toolbar1, ['jio_quote', 'jio_precode', 'fullscreen', 'wp_adv']));
|
||||
$plugins = 'paste,link,lists,fullscreen,wordpress,wplink,charmap,colorpicker,textcolor';
|
||||
$editor_plugin_path = get_template_directory() . '/assets/js/front-submit-editor.js';
|
||||
$editor_plugin_url = get_template_directory_uri() . '/assets/js/front-submit-editor.js';
|
||||
@@ -68,7 +68,7 @@ $is_can_new = !empty($ctx['is_can_new']);
|
||||
}
|
||||
$external_plugins = static function (array $external, string $editor_id) use ($editor_plugin_url): array {
|
||||
if ($editor_id === 'post_content') {
|
||||
$external['aksrt_editor_tools'] = $editor_plugin_url;
|
||||
$external['jio_editor_tools'] = $editor_plugin_url;
|
||||
}
|
||||
return $external;
|
||||
};
|
||||
@@ -100,20 +100,20 @@ $is_can_new = !empty($ctx['is_can_new']);
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="flex ac jsb mt10">
|
||||
<span class="view-btn aksrt-submit-view-btn">
|
||||
<span class="view-btn jio-submit-view-btn">
|
||||
<?php if ($edit_post) : ?>
|
||||
<a class="but c-blue" target="_blank" href="<?php echo esc_url(get_permalink($edit_post)); ?>">
|
||||
<i class="fa fas fa-file-alt"></i> <?php esc_html_e('预览文章', 'aksrt'); ?>
|
||||
<i class="fa fas fa-file-alt"></i> <?php esc_html_e('预览文章', 'jio'); ?>
|
||||
</a>
|
||||
<?php if (current_user_can('manage_options')) : ?>
|
||||
<a class="but c-yellow" href="<?php echo esc_url(get_edit_post_link($edit_post)); ?>">
|
||||
<?php esc_html_e('后台编辑', 'aksrt'); ?>
|
||||
<?php esc_html_e('后台编辑', 'jio'); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php elseif (!empty($ctx['draft_count']) && $ctx['user_id'] > 0) : ?>
|
||||
<?php
|
||||
$draft_url = function_exists('aksrt_get_user_center_url')
|
||||
? add_query_arg('post_status', 'draft', aksrt_get_user_center_url('posts'))
|
||||
$draft_url = function_exists('jio_get_user_center_url')
|
||||
? add_query_arg('post_status', 'draft', jio_get_user_center_url('posts'))
|
||||
: '';
|
||||
?>
|
||||
<?php if ($draft_url !== '') : ?>
|
||||
@@ -121,7 +121,7 @@ $is_can_new = !empty($ctx['is_can_new']);
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %d: draft count */
|
||||
esc_html__('您已有 %d 篇草稿 点击查看', 'aksrt'),
|
||||
esc_html__('您已有 %d 篇草稿 点击查看', 'jio'),
|
||||
(int) $ctx['draft_count']
|
||||
);
|
||||
?>
|
||||
@@ -130,9 +130,9 @@ $is_can_new = !empty($ctx['is_can_new']);
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
<span class="modified-time aksrt-submit-modified-time">
|
||||
<span class="modified-time jio-submit-modified-time">
|
||||
<?php if (!empty($ctx['post_modified'])) : ?>
|
||||
<span class="badg"><?php echo esc_html(sprintf(__('最后保存:%s', 'aksrt'), $ctx['post_modified'])); ?></span>
|
||||
<span class="badg"><?php echo esc_html(sprintf(__('最后保存:%s', 'jio'), $ctx['post_modified'])); ?></span>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Cover featured editor box.
|
||||
*
|
||||
* @var array $ctx
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -49,28 +49,28 @@ $can_video = !empty($ctx['can_cover_video']);
|
||||
<div class="btns-full flex ac jc">
|
||||
<?php if ($can_image || $can_slide) : ?>
|
||||
<button type="button" class="but btn-image" data-featured-action="image"
|
||||
title="<?php esc_attr_e('图片', 'aksrt'); ?>"
|
||||
aria-label="<?php esc_attr_e('图片', 'aksrt'); ?>">
|
||||
title="<?php esc_attr_e('图片', 'jio'); ?>"
|
||||
aria-label="<?php esc_attr_e('图片', 'jio'); ?>">
|
||||
<i class="fa fas fa-image"></i>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<?php if ($can_video) : ?>
|
||||
<button type="button" class="but btn-video-pic" data-featured-action="video_pic"
|
||||
title="<?php esc_attr_e('设置视频封面', 'aksrt'); ?>"
|
||||
aria-label="<?php esc_attr_e('设置视频封面', 'aksrt'); ?>">
|
||||
title="<?php esc_attr_e('设置视频封面', 'jio'); ?>"
|
||||
aria-label="<?php esc_attr_e('设置视频封面', 'jio'); ?>">
|
||||
<i class="fa fas fa-image"></i>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<?php if ($can_video) : ?>
|
||||
<button type="button" class="but btn-video" data-featured-action="video"
|
||||
title="<?php esc_attr_e('视频', 'aksrt'); ?>"
|
||||
aria-label="<?php esc_attr_e('视频', 'aksrt'); ?>">
|
||||
title="<?php esc_attr_e('视频', 'jio'); ?>"
|
||||
aria-label="<?php esc_attr_e('视频', 'jio'); ?>">
|
||||
<i class="fa fas fa-video"></i>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<button type="button" class="but c-red btn-delete" data-featured-action="close" <?php echo $type === '' ? 'hidden' : ''; ?>
|
||||
title="<?php esc_attr_e('清除', 'aksrt'); ?>"
|
||||
aria-label="<?php esc_attr_e('清除', 'aksrt'); ?>">
|
||||
title="<?php esc_attr_e('清除', 'jio'); ?>"
|
||||
aria-label="<?php esc_attr_e('清除', 'jio'); ?>">
|
||||
<i class="fa fas fa-trash-alt"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -16,8 +16,8 @@ $vip1_name = (string) ($ctx['vip']['vip1_name'] ?? 'VIP1');
|
||||
$vip2_name = (string) ($ctx['vip']['vip2_name'] ?? 'VIP2');
|
||||
$downloads = is_array($pay['downloads'] ?? null) ? $pay['downloads'] : [];
|
||||
|
||||
if (!function_exists('aksrt_submit_pay_line')) {
|
||||
function aksrt_submit_pay_line(string $label, string $name, string $value, string $step): void {
|
||||
if (!function_exists('jio_submit_pay_line')) {
|
||||
function jio_submit_pay_line(string $label, string $name, string $value, string $step): void {
|
||||
?>
|
||||
<div class="relative mt6"><div class="flex ab"><div class="muted-color mb6 flex0"><?php echo esc_html($label); ?></div><input type="number" min="0" step="<?php echo esc_attr($step); ?>" name="<?php echo esc_attr($name); ?>" value="<?php echo esc_attr($value); ?>" class="line-form-input em2x key-color text-right"><i class="line-form-line"></i></div></div>
|
||||
<?php
|
||||
@@ -25,54 +25,54 @@ if (!function_exists('aksrt_submit_pay_line')) {
|
||||
}
|
||||
?>
|
||||
<div class="zib-widget dependency-box mb10-sm newpost-pay-box" data-pay-box>
|
||||
<div class="title-theme mb10"><?php esc_html_e('付费内容', 'aksrt'); ?></div>
|
||||
<div class="title-theme mb10"><?php esc_html_e('付费内容', 'jio'); ?></div>
|
||||
<div class="flex ac jsb padding-h10 border-bottom">
|
||||
<div class="flex ac"><?php esc_html_e('内容付费', 'aksrt'); ?></div>
|
||||
<div class="flex ac"><?php esc_html_e('内容付费', 'jio'); ?></div>
|
||||
<label class="form-switch-label"><input class="hide" type="checkbox" name="pay_enabled" value="1" <?php checked($enabled); ?> data-pay-toggle><div class="form-switch flex0"></div></label>
|
||||
</div>
|
||||
|
||||
<div data-pay-fields <?php echo $enabled ? '' : 'hidden'; ?>>
|
||||
<?php if ($points_on) : ?>
|
||||
<div class="flex ac jsb padding-h10">
|
||||
<div class="flex ac"><?php esc_html_e('支付类型', 'aksrt'); ?></div>
|
||||
<div class="flex ac"><?php esc_html_e('支付类型', 'jio'); ?></div>
|
||||
<div class="but-average radius em09">
|
||||
<button type="button" class="but p2-10 pointer<?php echo $modo !== 'points' ? ' active' : ''; ?>" data-pay-modo="0"><?php esc_html_e('现金支付', 'aksrt'); ?></button>
|
||||
<button type="button" class="but p2-10 pointer<?php echo $modo === 'points' ? ' active' : ''; ?>" data-pay-modo="points"><?php esc_html_e('积分支付', 'aksrt'); ?></button>
|
||||
<button type="button" class="but p2-10 pointer<?php echo $modo !== 'points' ? ' active' : ''; ?>" data-pay-modo="0"><?php esc_html_e('现金支付', 'jio'); ?></button>
|
||||
<button type="button" class="but p2-10 pointer<?php echo $modo === 'points' ? ' active' : ''; ?>" data-pay-modo="points"><?php esc_html_e('积分支付', 'jio'); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="aksrt_pay[pay_modo]" value="<?php echo esc_attr($modo); ?>" data-pay-modo-input>
|
||||
<input type="hidden" name="aksrt_pay[pay_type]" value="<?php echo esc_attr((string) ($pay['pay_type'] ?? 'reading')); ?>" data-pay-type-input>
|
||||
<input type="hidden" name="jio_pay[pay_modo]" value="<?php echo esc_attr($modo); ?>" data-pay-modo-input>
|
||||
<input type="hidden" name="jio_pay[pay_type]" value="<?php echo esc_attr((string) ($pay['pay_type'] ?? 'reading')); ?>" data-pay-type-input>
|
||||
|
||||
<div class="mt10 newpost-pay-price" data-pay-cash <?php echo $modo === 'points' ? 'hidden' : ''; ?>>
|
||||
<?php aksrt_submit_pay_line(__('设置价格', 'aksrt'), 'aksrt_pay[price]', (string) ($pay['price'] ?? ''), '0.01'); ?>
|
||||
<?php if ($manual && $vip1_on) aksrt_submit_pay_line(sprintf(__('%s价格', 'aksrt'), $vip1_name), 'aksrt_pay[vip1_price]', (string) ($pay['vip1_price'] ?? ''), '0.01'); ?>
|
||||
<?php if ($manual && $vip2_on) aksrt_submit_pay_line(sprintf(__('%s价格', 'aksrt'), $vip2_name), 'aksrt_pay[vip2_price]', (string) ($pay['vip2_price'] ?? ''), '0.01'); ?>
|
||||
<?php if ($manual && ($vip1_on || $vip2_on)) : ?><div class="px12 mt6 muted-color"><?php esc_html_e('会员价不能高于普通价,为0则为会员免费', 'aksrt'); ?></div><?php endif; ?>
|
||||
<?php jio_submit_pay_line(__('设置价格', 'jio'), 'jio_pay[price]', (string) ($pay['price'] ?? ''), '0.01'); ?>
|
||||
<?php if ($manual && $vip1_on) jio_submit_pay_line(sprintf(__('%s价格', 'jio'), $vip1_name), 'jio_pay[vip1_price]', (string) ($pay['vip1_price'] ?? ''), '0.01'); ?>
|
||||
<?php if ($manual && $vip2_on) jio_submit_pay_line(sprintf(__('%s价格', 'jio'), $vip2_name), 'jio_pay[vip2_price]', (string) ($pay['vip2_price'] ?? ''), '0.01'); ?>
|
||||
<?php if ($manual && ($vip1_on || $vip2_on)) : ?><div class="px12 mt6 muted-color"><?php esc_html_e('会员价不能高于普通价,为0则为会员免费', 'jio'); ?></div><?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="mt10 newpost-pay-price" data-pay-points <?php echo $modo !== 'points' ? 'hidden' : ''; ?>>
|
||||
<?php aksrt_submit_pay_line(__('设置积分', 'aksrt'), 'aksrt_pay[points_price]', (string) ($pay['points_price'] ?? ''), '1'); ?>
|
||||
<?php if ($manual && $vip1_on) aksrt_submit_pay_line(sprintf(__('%s积分', 'aksrt'), $vip1_name), 'aksrt_pay[vip1_points]', (string) ($pay['vip1_points'] ?? ''), '1'); ?>
|
||||
<?php if ($manual && $vip2_on) aksrt_submit_pay_line(sprintf(__('%s积分', 'aksrt'), $vip2_name), 'aksrt_pay[vip2_points]', (string) ($pay['vip2_points'] ?? ''), '1'); ?>
|
||||
<?php if ($manual && ($vip1_on || $vip2_on)) : ?><div class="px12 mt6 muted-color"><?php esc_html_e('会员价不能高于普通价,为0则为会员免费', 'aksrt'); ?></div><?php endif; ?>
|
||||
<?php jio_submit_pay_line(__('设置积分', 'jio'), 'jio_pay[points_price]', (string) ($pay['points_price'] ?? ''), '1'); ?>
|
||||
<?php if ($manual && $vip1_on) jio_submit_pay_line(sprintf(__('%s积分', 'jio'), $vip1_name), 'jio_pay[vip1_points]', (string) ($pay['vip1_points'] ?? ''), '1'); ?>
|
||||
<?php if ($manual && $vip2_on) jio_submit_pay_line(sprintf(__('%s积分', 'jio'), $vip2_name), 'jio_pay[vip2_points]', (string) ($pay['vip2_points'] ?? ''), '1'); ?>
|
||||
<?php if ($manual && ($vip1_on || $vip2_on)) : ?><div class="px12 mt6 muted-color"><?php esc_html_e('会员价不能高于普通价,为0则为会员免费', 'jio'); ?></div><?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($ctx['can_pay_download'])) : ?>
|
||||
<div class="mt10 pay-dawnload-edit" data-pay-downloads>
|
||||
<div class="flex ac jsb padding-h10">
|
||||
<b><?php esc_html_e('付费下载', 'aksrt'); ?></b>
|
||||
<button type="button" class="pay-dawnload-add but hollow p2-10 px12 c-blue" data-pay-download-add><i class="fa fas fa-plus mr3"></i><?php esc_html_e('添加资源', 'aksrt'); ?></button>
|
||||
<b><?php esc_html_e('付费下载', 'jio'); ?></b>
|
||||
<button type="button" class="pay-dawnload-add but hollow p2-10 px12 c-blue" data-pay-download-add><i class="fa fas fa-plus mr3"></i><?php esc_html_e('添加资源', 'jio'); ?></button>
|
||||
</div>
|
||||
<div class="mt10 px12 lists-box" data-pay-download-list>
|
||||
<?php foreach ($downloads as $index => $row) : ?>
|
||||
<div class="flex ac jsb lists-item" data-pay-download-item>
|
||||
<button type="button" class="flex1 name-link pay-dawnload-add-edit" data-pay-download-edit><?php echo esc_html((string) ($row['url'] ?? '')); ?></button>
|
||||
<button type="button" class="pay-dawnload-add-delete em12 ml10 hollow but cir c-red" data-pay-download-remove aria-label="<?php esc_attr_e('删除资源', 'aksrt'); ?>"><i class="fa far fa-trash-alt" aria-hidden="true"></i></button>
|
||||
<button type="button" class="pay-dawnload-add-delete em12 ml10 hollow but cir c-red" data-pay-download-remove aria-label="<?php esc_attr_e('删除资源', 'jio'); ?>"><i class="fa far fa-trash-alt" aria-hidden="true"></i></button>
|
||||
<div class="hidden-input">
|
||||
<?php foreach (['url', 'attachment_id', 'extract_code', 'copy_key', 'copy_val', 'label', 'class'] as $field) : ?>
|
||||
|
||||
<input type="hidden" name="aksrt_pay[downloads][<?php echo (int) $index; ?>][<?php echo esc_attr($field); ?>]" data-pay-download-field="<?php echo esc_attr($field); ?>" value="<?php echo esc_attr((string) ($row[$field] ?? '')); ?>">
|
||||
<input type="hidden" name="jio_pay[downloads][<?php echo (int) $index; ?>][<?php echo esc_attr($field); ?>]" data-pay-download-field="<?php echo esc_attr($field); ?>" value="<?php echo esc_attr((string) ($row[$field] ?? '')); ?>">
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -81,7 +81,7 @@ if (!function_exists('aksrt_submit_pay_line')) {
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="em09 mt10 muted-2-color"><?php esc_html_e('请确保已经在文中添加了付费可见的隐藏内容或已添加付费下载内容', 'aksrt'); ?></div>
|
||||
<div class="em09 mt10 muted-2-color"><?php esc_html_e('请确保已经在文中添加了付费可见的隐藏内容或已添加付费下载内容', 'jio'); ?></div>
|
||||
</div>
|
||||
<div class="em09 mt10 muted-2-color" data-pay-off-hint <?php echo $enabled ? 'hidden' : ''; ?>><?php esc_html_e('如果您在文章中添加了付费可见的隐藏内容或需要设置付费下载资源,请在此设置付费功能', 'aksrt'); ?></div>
|
||||
<div class="em09 mt10 muted-2-color" data-pay-off-hint <?php echo $enabled ? 'hidden' : ''; ?>><?php esc_html_e('如果您在文章中添加了付费可见的隐藏内容或需要设置付费下载资源,请在此设置付费功能', 'jio'); ?></div>
|
||||
</div>
|
||||
@@ -10,27 +10,27 @@ $can_draft = !empty($ctx['user_id'])
|
||||
?>
|
||||
<div class="zib-widget">
|
||||
<div class="text-center">
|
||||
<p class="separator muted-3-color theme-box"><?php esc_html_e('Are you ready', 'aksrt'); ?></p>
|
||||
<p class="separator muted-3-color theme-box"><?php esc_html_e('Are you ready', 'jio'); ?></p>
|
||||
<input type="hidden" name="posts_id" value="<?php echo esc_attr((string) (int) $ctx['edit_id']); ?>">
|
||||
<input type="hidden" name="status" id="submit-status" value="pending">
|
||||
<input type="hidden" name="_nonce" value="<?php echo esc_attr(wp_create_nonce('aksrt_submit')); ?>">
|
||||
<input type="hidden" name="_nonce" value="<?php echo esc_attr(wp_create_nonce('jio_submit')); ?>">
|
||||
|
||||
<?php if (!$is_can_new) : ?>
|
||||
<p class="em09 muted-3-color theme-box"><?php esc_html_e('暂无发布权限', 'aksrt'); ?></p>
|
||||
<p class="em09 muted-3-color theme-box"><?php esc_html_e('暂无发布权限', 'jio'); ?></p>
|
||||
<?php else : ?>
|
||||
<?php if (!empty($ctx['is_guest'])) : ?>
|
||||
<p class="em09 muted-3-color theme-box"><?php esc_html_e('您当前未登录,不能保存草稿,文章提交后不可再修改!', 'aksrt'); ?></p>
|
||||
<p class="em09 muted-3-color theme-box"><?php esc_html_e('您当前未登录,不能保存草稿,文章提交后不可再修改!', 'jio'); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (function_exists('aksrt_is_captcha_enabled_for') && function_exists('aksrt_render_captcha') && aksrt_is_captcha_enabled_for('front_submit')) : ?>
|
||||
<div class="mb10"><?php aksrt_render_captcha('front_submit'); ?></div>
|
||||
<?php if (function_exists('jio_is_captcha_enabled_for') && function_exists('jio_render_captcha') && jio_is_captcha_enabled_for('front_submit')) : ?>
|
||||
<div class="mb10"><?php jio_render_captcha('front_submit'); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="but-average">
|
||||
<?php if ($can_draft) : ?>
|
||||
<button type="button" class="but jb-green new-posts-submit aksrt-submit-btn padding-lg" data-action="posts_draft"><i class="fa fas fa-fw fa-dot-circle"></i><?php esc_html_e('保存草稿', 'aksrt'); ?></button>
|
||||
<button type="button" class="but jb-green new-posts-submit jio-submit-btn padding-lg" data-action="posts_draft"><i class="fa fas fa-fw fa-dot-circle"></i><?php esc_html_e('保存草稿', 'jio'); ?></button>
|
||||
<?php endif; ?>
|
||||
<button type="button" class="but jb-blue new-posts-submit aksrt-submit-btn padding-lg" data-action="posts_save" id="aksrt-submit-btn"><i class="fa fas fa-fw fa-check-square"></i><?php printf(esc_html__('提交%s', 'aksrt'), esc_html((string) $ctx['submit_label'])); ?></button>
|
||||
<button type="button" class="but jb-blue new-posts-submit jio-submit-btn padding-lg" data-action="posts_save" id="jio-submit-btn"><i class="fa fas fa-fw fa-check-square"></i><?php printf(esc_html__('提交%s', 'jio'), esc_html((string) $ctx['submit_label'])); ?></button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Reference-theme article parameters sidebar.
|
||||
*
|
||||
* @var array $ctx
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
@@ -14,28 +14,28 @@ require_once get_template_directory() . '/templates/parts/submit/term-checks.php
|
||||
|
||||
<?php if (!empty($ctx['is_guest'])) : ?>
|
||||
<div class="zib-widget mb10-sm newpost-user-inputs">
|
||||
<div class="title-theme mb10"><?php esc_html_e('用户信息', 'aksrt'); ?></div>
|
||||
<p class="muted-3-color em09"><?php esc_html_e('请输入昵称', 'aksrt'); ?></p>
|
||||
<div class="mb20"><input class="form-control" type="text" name="user_name" placeholder="<?php esc_attr_e('请输入昵称', 'aksrt'); ?>" required></div>
|
||||
<p class="muted-3-color em09"><?php esc_html_e('请输入您的联系方式', 'aksrt'); ?></p>
|
||||
<input class="form-control" type="text" name="contact_details" placeholder="<?php esc_attr_e('输入联系方式', 'aksrt'); ?>">
|
||||
<div class="title-theme mb10"><?php esc_html_e('用户信息', 'jio'); ?></div>
|
||||
<p class="muted-3-color em09"><?php esc_html_e('请输入昵称', 'jio'); ?></p>
|
||||
<div class="mb20"><input class="form-control" type="text" name="user_name" placeholder="<?php esc_attr_e('请输入昵称', 'jio'); ?>" required></div>
|
||||
<p class="muted-3-color em09"><?php esc_html_e('请输入您的联系方式', 'jio'); ?></p>
|
||||
<input class="form-control" type="text" name="contact_details" placeholder="<?php esc_attr_e('输入联系方式', 'jio'); ?>">
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="zib-widget mb10-sm">
|
||||
<div class="title-theme mb10"><?php esc_html_e('文章参数', 'aksrt'); ?></div>
|
||||
<div class="title-theme mb10"><?php esc_html_e('文章参数', 'jio'); ?></div>
|
||||
<div class="term-select-box">
|
||||
<div class="newpost-cat-drop drop-select dropdown dependency-box">
|
||||
<button type="button" data-toggle-class="open" data-target=".newpost-cat-drop" class="flex ac jsb drop-btn form-control mb6">
|
||||
<span class="title-theme222"><i class="fa fas fa-folder-open mr6" aria-hidden="true"></i><?php esc_html_e('分类', 'aksrt'); ?></span><i class="ml6 fa fas fa-angle-right em12"></i>
|
||||
<span class="title-theme222"><i class="fa fas fa-folder-open mr6" aria-hidden="true"></i><?php esc_html_e('分类', 'jio'); ?></span><i class="ml6 fa fas fa-angle-right em12"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu fluid">
|
||||
<div class="mini-scrollbar padding-w10 select-drop-box">
|
||||
<?php
|
||||
if (!empty($ctx['categories'])) {
|
||||
aksrt_submit_render_term_checks($ctx['categories'], array_map('intval', $ctx['current_cats']), 'category');
|
||||
jio_submit_render_term_checks($ctx['categories'], array_map('intval', $ctx['current_cats']), 'category');
|
||||
} else {
|
||||
echo esc_html__('暂无可选择的分类', 'aksrt');
|
||||
echo esc_html__('暂无可选择的分类', 'jio');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@@ -70,8 +70,8 @@ require_once get_template_directory() . '/templates/parts/submit/term-checks.php
|
||||
</div>
|
||||
|
||||
<?php if (!empty($settings['allow_tags'])) : ?>
|
||||
<div class="title-theme mb10 mt20"><?php esc_html_e('标签', 'aksrt'); ?></div>
|
||||
<p class="muted-3-color em09"><?php esc_html_e('填写文章的标签,每个标签用逗号隔开', 'aksrt'); ?></p>
|
||||
<textarea class="form-control" rows="3" name="tags" placeholder="<?php esc_attr_e('输入文章标签', 'aksrt'); ?>" tabindex="6"><?php echo esc_textarea((string) $ctx['current_tags']); ?></textarea>
|
||||
<div class="title-theme mb10 mt20"><?php esc_html_e('标签', 'jio'); ?></div>
|
||||
<p class="muted-3-color em09"><?php esc_html_e('填写文章的标签,每个标签用逗号隔开', 'jio'); ?></p>
|
||||
<textarea class="form-control" rows="3" name="tags" placeholder="<?php esc_attr_e('输入文章标签', 'jio'); ?>" tabindex="6"><?php echo esc_textarea((string) $ctx['current_tags']); ?></textarea>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -10,8 +10,8 @@
|
||||
*/
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if (!function_exists('aksrt_submit_render_term_checks')) :
|
||||
function aksrt_submit_render_term_checks(array $terms, array $checked, string $name, int $parent = 0, int $depth = 0): void {
|
||||
if (!function_exists('jio_submit_render_term_checks')) :
|
||||
function jio_submit_render_term_checks(array $terms, array $checked, string $name, int $parent = 0, int $depth = 0): void {
|
||||
$children_map = [];
|
||||
foreach ($terms as $term) {
|
||||
if (!$term instanceof WP_Term) {
|
||||
@@ -31,7 +31,7 @@ if (!function_exists('aksrt_submit_render_term_checks')) :
|
||||
foreach ($children_map[$pid] as $term) {
|
||||
$tid = (int) $term->term_id;
|
||||
$pad = $d > 0 ? ' style="margin-left:' . (int) ($d * 16) . 'px"' : '';
|
||||
echo '<div' . $pad . '><label class="aksrt-submit-check">';
|
||||
echo '<div' . $pad . '><label class="jio-submit-check">';
|
||||
echo '<input type="checkbox" name="' . esc_attr($name) . '[]" value="' . esc_attr((string) $tid) . '"' . (in_array($tid, $checked, true) ? ' checked' : '') . '>';
|
||||
echo '<span>' . esc_html($term->name) . '</span></label></div>';
|
||||
$render($tid, $d + 1);
|
||||
@@ -45,7 +45,7 @@ if (!function_exists('aksrt_submit_render_term_checks')) :
|
||||
continue;
|
||||
}
|
||||
$tid = (int) $term->term_id;
|
||||
echo '<div><label class="aksrt-submit-check">';
|
||||
echo '<div><label class="jio-submit-check">';
|
||||
echo '<input type="checkbox" name="' . esc_attr($name) . '[]" value="' . esc_attr((string) $tid) . '"' . (in_array($tid, $checked, true) ? ' checked' : '') . '>';
|
||||
echo '<span>' . esc_html($term->name) . '</span></label></div>';
|
||||
}
|
||||
|
||||
@@ -7,28 +7,28 @@ $status = (string) ($creator_args['status'] ?? 'all');
|
||||
$statuses = $status === 'all' ? ['publish', 'draft', 'pending', 'private'] : [$status];
|
||||
$page = max(1, (int) ($_GET['creator_page'] ?? 1));
|
||||
$q = new WP_Query(['author' => (int) $user_id, 'post_type' => 'post', 'post_status' => $statuses, 'posts_per_page' => 10, 'paged' => $page, 'no_found_rows' => false]);
|
||||
$front_submit = class_exists('\\AKSRT\\Core\\FrontSubmit') ? \AKSRT\Core\FrontSubmit::get_instance() : null;
|
||||
$status_labels = ['publish' => __('已发布', 'aksrt'), 'draft' => __('草稿', 'aksrt'), 'pending' => __('待审核', 'aksrt'), 'private' => __('私密', 'aksrt')];
|
||||
$front_submit = class_exists('\\Jio\\Core\\FrontSubmit') ? \Jio\Core\FrontSubmit::get_instance() : null;
|
||||
$status_labels = ['publish' => __('已发布', 'jio'), 'draft' => __('草稿', 'jio'), 'pending' => __('待审核', 'jio'), 'private' => __('私密', 'jio')];
|
||||
?>
|
||||
<?php if ($q->have_posts()) : ?>
|
||||
<div class="creator-post-list">
|
||||
<?php while ($q->have_posts()) : $q->the_post();
|
||||
$post_id = get_the_ID();
|
||||
$post_status = get_post_status();
|
||||
$edit_url = $front_submit && $front_submit->can_edit_post($post_id, (int) $user_id) ? aksrt_get_new_post_url($post_id) : '';
|
||||
$edit_url = $front_submit && $front_submit->can_edit_post($post_id, (int) $user_id) ? jio_get_new_post_url($post_id) : '';
|
||||
$can_delete = $front_submit && $front_submit->can_delete_post($post_id, (int) $user_id);
|
||||
$price = (float) get_post_meta($post_id, '_aksrt_pay_price', true);
|
||||
$price = (float) get_post_meta($post_id, '_jio_pay_price', true);
|
||||
?>
|
||||
<article class="creator-post-row" data-post-id="<?php echo esc_attr((string) $post_id); ?>">
|
||||
<a class="creator-post-row__thumb" href="<?php echo esc_url(get_permalink($post_id)); ?>" aria-label="<?php echo esc_attr(get_the_title()); ?>">
|
||||
<?php if (has_post_thumbnail($post_id)) : the_post_thumbnail('medium'); else : ?><span><i class="fa fas fa-pen" aria-hidden="true"></i></span><?php endif; ?>
|
||||
</a>
|
||||
<div class="creator-post-row__body"><div class="creator-post-row__heading"><h4><a href="<?php echo esc_url(get_permalink($post_id)); ?>"><?php echo esc_html(get_the_title()); ?></a></h4><span class="creator-post-row__status creator-post-row__status--<?php echo esc_attr($post_status); ?>"><?php echo esc_html($status_labels[$post_status] ?? $post_status); ?></span></div><p><?php echo esc_html(wp_trim_words(get_the_excerpt(), 20, '…')); ?></p><div class="creator-post-row__meta"><time datetime="<?php echo esc_attr(get_the_date('c')); ?>"><?php echo esc_html(get_the_date()); ?></time><span><?php echo $price > 0 ? esc_html__('付费内容', 'aksrt') : esc_html__('免费内容', 'aksrt'); ?></span></div></div>
|
||||
<div class="creator-post-row__actions"><?php if ($edit_url) : ?><a href="<?php echo esc_url($edit_url); ?>" class="creator-post-row__action"><?php esc_html_e('编辑', 'aksrt'); ?></a><?php endif; ?><a href="<?php echo esc_url(get_permalink($post_id)); ?>" class="creator-post-row__action"><?php esc_html_e('查看', 'aksrt'); ?></a><?php if ($can_delete) : ?><button type="button" class="creator-post-row__action creator-post-row__action--danger" data-action="delete-post" data-post-id="<?php echo esc_attr((string) $post_id); ?>" data-nonce="<?php echo esc_attr(wp_create_nonce('aksrt_submit')); ?>"><?php esc_html_e('删除', 'aksrt'); ?></button><?php endif; ?></div>
|
||||
<div class="creator-post-row__body"><div class="creator-post-row__heading"><h4><a href="<?php echo esc_url(get_permalink($post_id)); ?>"><?php echo esc_html(get_the_title()); ?></a></h4><span class="creator-post-row__status creator-post-row__status--<?php echo esc_attr($post_status); ?>"><?php echo esc_html($status_labels[$post_status] ?? $post_status); ?></span></div><p><?php echo esc_html(wp_trim_words(get_the_excerpt(), 20, '…')); ?></p><div class="creator-post-row__meta"><time datetime="<?php echo esc_attr(get_the_date('c')); ?>"><?php echo esc_html(get_the_date()); ?></time><span><?php echo $price > 0 ? esc_html__('付费内容', 'jio') : esc_html__('免费内容', 'jio'); ?></span></div></div>
|
||||
<div class="creator-post-row__actions"><?php if ($edit_url) : ?><a href="<?php echo esc_url($edit_url); ?>" class="creator-post-row__action"><?php esc_html_e('编辑', 'jio'); ?></a><?php endif; ?><a href="<?php echo esc_url(get_permalink($post_id)); ?>" class="creator-post-row__action"><?php esc_html_e('查看', 'jio'); ?></a><?php if ($can_delete) : ?><button type="button" class="creator-post-row__action creator-post-row__action--danger" data-action="delete-post" data-post-id="<?php echo esc_attr((string) $post_id); ?>" data-nonce="<?php echo esc_attr(wp_create_nonce('jio_submit')); ?>"><?php esc_html_e('删除', 'jio'); ?></button><?php endif; ?></div>
|
||||
</article>
|
||||
<?php endwhile; ?>
|
||||
</div>
|
||||
<?php aksrt_render_profile_pagination((int) $q->max_num_pages, $page, 'creator_page'); wp_reset_postdata(); ?>
|
||||
<?php jio_render_profile_pagination((int) $q->max_num_pages, $page, 'creator_page'); wp_reset_postdata(); ?>
|
||||
<?php else : ?>
|
||||
<div class="creator-workspace__empty"><i class="fa fas fa-pen" aria-hidden="true"></i><h4><?php esc_html_e('还没有文章', 'aksrt'); ?></h4><p><?php esc_html_e('开始创作你的第一篇文章吧。', 'aksrt'); ?></p><?php if (!empty($new_post_url)) : ?><a class="btn-primary btn-sm" href="<?php echo esc_url($new_post_url); ?>"><?php esc_html_e('写新文章', 'aksrt'); ?></a><?php endif; ?></div>
|
||||
<div class="creator-workspace__empty"><i class="fa fas fa-pen" aria-hidden="true"></i><h4><?php esc_html_e('还没有文章', 'jio'); ?></h4><p><?php esc_html_e('开始创作你的第一篇文章吧。', 'jio'); ?></p><?php if (!empty($new_post_url)) : ?><a class="btn-primary btn-sm" href="<?php echo esc_url($new_post_url); ?>"><?php esc_html_e('写新文章', 'jio'); ?></a><?php endif; ?></div>
|
||||
<?php endif; ?>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/** User center header. @package AKSRT */
|
||||
/** User center header. @package Jio */
|
||||
defined('ABSPATH') || exit;
|
||||
$context = is_array($args['context'] ?? null) ? $args['context'] : [];
|
||||
echo $context['header_html'] ?? ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/** User center mobile tabs. @package AKSRT */
|
||||
/** User center mobile tabs. @package Jio */
|
||||
defined('ABSPATH') || exit;
|
||||
$context = is_array($args['context'] ?? null) ? $args['context'] : [];
|
||||
?>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* Generic user-center panel wrapper for registered extensions.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/** User center runtime configuration. @package AKSRT */
|
||||
/** User center runtime configuration. @package Jio */
|
||||
defined('ABSPATH') || exit;
|
||||
$context = is_array($args['context'] ?? null) ? $args['context'] : [];
|
||||
?>
|
||||
<script>window.aksrtUserCenter=<?php echo wp_json_encode($context['runtime_config'] ?? []); ?>;</script>
|
||||
<script>window.jioUserCenter=<?php echo wp_json_encode($context['runtime_config'] ?? []); ?>;</script>
|
||||
<?php if (!empty($context['cover_upload_config'])) : ?>
|
||||
<script>window.aksrtAuthorPage=Object.assign({},window.aksrtAuthorPage||{},{coverUpload:<?php echo wp_json_encode($context['cover_upload_config']); ?>});</script>
|
||||
<script>window.jioAuthorPage=Object.assign({},window.jioAuthorPage||{},{coverUpload:<?php echo wp_json_encode($context['cover_upload_config']); ?>});</script>
|
||||
<?php endif; ?>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/** User center sidebar. @package AKSRT */
|
||||
/** User center sidebar. @package Jio */
|
||||
defined('ABSPATH') || exit;
|
||||
$context = is_array($args['context'] ?? null) ? $args['context'] : [];
|
||||
echo $context['sidebar_html'] ?? ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
@@ -3,10 +3,10 @@
|
||||
* Public user home — comments tab panel body.
|
||||
*
|
||||
* Rendered inside the #panel-comments wrapper on the public user home and via
|
||||
* the aksrt/v1 user-home panel REST fragment. Later pages append through the
|
||||
* the jio/v1 user-home panel REST fragment. Later pages append through the
|
||||
* existing REST route and never touch the URL.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
@@ -50,11 +50,11 @@ if ($user_comments) :
|
||||
<div class="profile-comment-more text-center theme-pagination ajax-pag">
|
||||
<div class="next-page ajax-next">
|
||||
<button type="button" data-uh-comments-next="<?php echo esc_attr((string) ($comments_page + 1)); ?>">
|
||||
<?php esc_html_e('加载更多', 'aksrt'); ?>
|
||||
<?php esc_html_e('加载更多', 'jio'); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php else : ?>
|
||||
<?php aksrt_render_profile_empty($svg_empty_comment, __('TA 还没有发表评论', 'aksrt')); ?>
|
||||
<?php jio_render_profile_empty($svg_empty_comment, __('TA 还没有发表评论', 'jio')); ?>
|
||||
<?php endif; ?>
|
||||
@@ -5,7 +5,7 @@
|
||||
* Rendered inside the #panel-credits wrapper on the public user home. Static
|
||||
* balance card; no pagination, no REST swapping needed.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
@@ -18,8 +18,8 @@ if (empty($credits_enabled) || empty($is_own_profile)) {
|
||||
}
|
||||
?>
|
||||
<div class="user-home-balance-card">
|
||||
<p class="user-home-balance-card__label"><?php echo esc_html(sprintf(__('当前%s余额', 'aksrt'), $currency_name)); ?></p>
|
||||
<div class="user-home-balance-card__value"><?php echo esc_html(aksrt_format_points($credit_balance)); ?></div>
|
||||
<p class="user-home-balance-card__hint"><?php esc_html_e('完整账单和赚取/消费记录请在用户中心查看。', 'aksrt'); ?></p>
|
||||
<a href="<?php echo esc_url(aksrt_get_user_center_url('credits')); ?>" class="btn-outline btn-sm"><?php esc_html_e('进入用户中心', 'aksrt'); ?></a>
|
||||
<p class="user-home-balance-card__label"><?php echo esc_html(sprintf(__('当前%s余额', 'jio'), $currency_name)); ?></p>
|
||||
<div class="user-home-balance-card__value"><?php echo esc_html(jio_format_points($credit_balance)); ?></div>
|
||||
<p class="user-home-balance-card__hint"><?php esc_html_e('完整账单和赚取/消费记录请在用户中心查看。', 'jio'); ?></p>
|
||||
<a href="<?php echo esc_url(jio_get_user_center_url('credits')); ?>" class="btn-outline btn-sm"><?php esc_html_e('进入用户中心', 'jio'); ?></a>
|
||||
</div>
|
||||
@@ -3,10 +3,10 @@
|
||||
* Public user home — favorites tab panel body.
|
||||
*
|
||||
* Rendered inside the #panel-favorites wrapper on the public user home and via
|
||||
* the aksrt/v1 user-home panel REST fragment. Pagination is button-driven
|
||||
* (aksrt_render_user_home_pagination) and never touches the URL.
|
||||
* the jio/v1 user-home panel REST fragment. Pagination is button-driven
|
||||
* (jio_render_user_home_pagination) and never touches the URL.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
@@ -14,7 +14,7 @@ defined('ABSPATH') || exit;
|
||||
$args = is_array($args ?? null) ? $args : [];
|
||||
extract($args, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_extract
|
||||
|
||||
$user_home_render_config = aksrt_resolve_post_list_render_config([
|
||||
$user_home_render_config = jio_resolve_post_list_render_config([
|
||||
'context' => 'author',
|
||||
'overrides' => [
|
||||
'no_author' => true,
|
||||
@@ -24,17 +24,17 @@ $user_home_render_config = aksrt_resolve_post_list_render_config([
|
||||
|
||||
if (!empty($placeholder_only)) {
|
||||
$placeholder_mode = (string) ($user_home_render_config['mode'] ?? 'list');
|
||||
$placeholder_html = function_exists('aksrt_render_placeholder')
|
||||
? aksrt_render_placeholder($placeholder_mode, 4)
|
||||
$placeholder_html = function_exists('jio_render_placeholder')
|
||||
? jio_render_placeholder($placeholder_mode, 4)
|
||||
: '';
|
||||
?>
|
||||
<div class="posts-row ajaxpager aksrt-user-home__post-list" data-view="<?php echo esc_attr($placeholder_mode); ?>">
|
||||
<div class="post_ajax_loader" role="status" aria-label="<?php esc_attr_e('正在加载', 'aksrt'); ?>">
|
||||
<?php echo $placeholder_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- 固定文章骨架由 aksrt_render_placeholder() 输出。 ?>
|
||||
<div class="posts-row ajaxpager jio-user-home__post-list" data-view="<?php echo esc_attr($placeholder_mode); ?>">
|
||||
<div class="post_ajax_loader" role="status" aria-label="<?php esc_attr_e('正在加载', 'jio'); ?>">
|
||||
<?php echo $placeholder_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- 固定文章骨架由 jio_render_placeholder() 输出。 ?>
|
||||
</div>
|
||||
<div class="uh-panel-load-error" role="alert">
|
||||
<span><?php esc_html_e('加载失败,请重试', 'aksrt'); ?></span>
|
||||
<button type="button" data-uh-retry><?php esc_html_e('重试', 'aksrt'); ?></button>
|
||||
<span><?php esc_html_e('加载失败,请重试', 'jio'); ?></span>
|
||||
<button type="button" data-uh-retry><?php esc_html_e('重试', 'jio'); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
@@ -56,12 +56,12 @@ if (!empty($favorite_post_ids)) :
|
||||
// 面板 AJAX 翻页期间由 author.js 切 .is-loading,骨架沿用文章列表的
|
||||
// .post_ajax_loader 契约。形状跟随同一份渲染配置(list / card):
|
||||
// 卡片模式下若仍渲染列表块,骨架就与真实卡片不同轴。
|
||||
$user_home_panel_loader = function_exists('aksrt_render_placeholder')
|
||||
? '<div class="post_ajax_loader" role="status" aria-label="' . esc_attr__('正在加载', 'aksrt') . '">' . aksrt_render_placeholder((string) ($user_home_render_config['mode'] ?? 'list'), max(4, (int) $per_page)) . '</div>'
|
||||
$user_home_panel_loader = function_exists('jio_render_placeholder')
|
||||
? '<div class="post_ajax_loader" role="status" aria-label="' . esc_attr__('正在加载', 'jio') . '">' . jio_render_placeholder((string) ($user_home_render_config['mode'] ?? 'list'), max(4, (int) $per_page)) . '</div>'
|
||||
: '';
|
||||
aksrt_render_post_list(array_merge($user_home_render_config, ['wrapper_class' => 'aksrt-user-home__post-list', 'append_inner_html' => $user_home_panel_loader]), $favorites_query);
|
||||
aksrt_render_user_home_pagination((int) $favorites_query->max_num_pages, (int) $favorites_page);
|
||||
jio_render_post_list(array_merge($user_home_render_config, ['wrapper_class' => 'jio-user-home__post-list', 'append_inner_html' => $user_home_panel_loader]), $favorites_query);
|
||||
jio_render_user_home_pagination((int) $favorites_query->max_num_pages, (int) $favorites_page);
|
||||
wp_reset_postdata();
|
||||
else :
|
||||
aksrt_render_profile_empty($svg_empty_favorite, __('TA 还没有收藏文章', 'aksrt'));
|
||||
jio_render_profile_empty($svg_empty_favorite, __('TA 还没有收藏文章', 'jio'));
|
||||
endif;
|
||||
@@ -4,13 +4,13 @@
|
||||
*
|
||||
* Legacy parity: 粉丝/关注用户列表复刻 zib_get_follow_user_list + zib_author_card
|
||||
* (inc/functions/zib-author.php:395-454, 685-716):子切换「粉丝 | 关注」居中文字链接,
|
||||
* 列表项走 aksrt_author_minicard(.author-minicard 三列 inline-block 卡片流)。
|
||||
* 列表项走 jio_author_minicard(.author-minicard 三列 inline-block 卡片流)。
|
||||
*
|
||||
* Rendered inside the #panel-follow wrapper on the public user home and via
|
||||
* the aksrt/v1 user-home panel REST fragment. Sub-tabs and pagination are
|
||||
* the jio/v1 user-home panel REST fragment. Sub-tabs and pagination are
|
||||
* button-driven ([data-uh-sub] / [data-uh-page]) and never touch the URL.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
@@ -23,16 +23,16 @@ $follow_sub = in_array($follow_sub ?? 'followers', ['following', 'followers'],
|
||||
|
||||
if (!empty($placeholder_only)) :
|
||||
?>
|
||||
<?php echo aksrt_get_user_home_follow_placeholder(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- 固定骨架由本主题 helper 输出。 ?>
|
||||
<?php echo jio_get_user_home_follow_placeholder(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- 固定骨架由本主题 helper 输出。 ?>
|
||||
<div class="uh-panel-load-error" role="alert">
|
||||
<span><?php esc_html_e('加载失败,请重试', 'aksrt'); ?></span>
|
||||
<button type="button" data-uh-retry><?php esc_html_e('重试', 'aksrt'); ?></button>
|
||||
<span><?php esc_html_e('加载失败,请重试', 'jio'); ?></span>
|
||||
<button type="button" data-uh-retry><?php esc_html_e('重试', 'jio'); ?></button>
|
||||
</div>
|
||||
<?php
|
||||
return;
|
||||
endif;
|
||||
|
||||
$follow_instance = class_exists('\AKSRT\User\Follow') ? \AKSRT\User\Follow::get_instance() : null;
|
||||
$follow_instance = class_exists('\Jio\User\Follow') ? \Jio\User\Follow::get_instance() : null;
|
||||
$following_count = $follow_instance ? (int) $follow_instance->get_following_count((int) $user_id) : 0;
|
||||
$follower_count = $follow_instance ? (int) $follow_instance->get_follower_count((int) $user_id) : 0;
|
||||
$list = ['items' => [], 'total' => 0, 'total_pages' => 1];
|
||||
@@ -47,13 +47,13 @@ $total_pages = max(1, (int) ($list['total_pages'] ?? 1));
|
||||
<ul class="uh-follow__subtabs list-inline splitters">
|
||||
<li>
|
||||
<button type="button" class="uh-follow__subtab<?php echo $follow_sub === 'followers' ? ' is-active focus-color' : ' muted-color'; ?>" data-uh-sub="followers">
|
||||
<?php esc_html_e('粉丝', 'aksrt'); ?>
|
||||
<?php esc_html_e('粉丝', 'jio'); ?>
|
||||
<span class="uh-follow__subtab-count"><?php echo esc_html((string) $follower_count); ?></span>
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" class="uh-follow__subtab<?php echo $follow_sub === 'following' ? ' is-active focus-color' : ' muted-color'; ?>" data-uh-sub="following">
|
||||
<?php esc_html_e('关注', 'aksrt'); ?>
|
||||
<?php esc_html_e('关注', 'jio'); ?>
|
||||
<span class="uh-follow__subtab-count"><?php echo esc_html((string) $following_count); ?></span>
|
||||
</button>
|
||||
</li>
|
||||
@@ -62,16 +62,16 @@ $total_pages = max(1, (int) ($list['total_pages'] ?? 1));
|
||||
<?php if (!empty($items)) : ?>
|
||||
<div class="uh-follow__list">
|
||||
<?php foreach ($items as $row) :
|
||||
echo aksrt_author_minicard((int) ($row['user_id'] ?? 0)); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo jio_author_minicard((int) ($row['user_id'] ?? 0)); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
endforeach; ?>
|
||||
</div>
|
||||
<?php aksrt_render_user_home_pagination($total_pages, $follow_page); ?>
|
||||
<?php jio_render_user_home_pagination($total_pages, $follow_page); ?>
|
||||
<?php else : ?>
|
||||
<?php
|
||||
$empty_msg = $follow_sub === 'followers'
|
||||
? __('暂无粉丝', 'aksrt')
|
||||
: __('暂未关注任何人', 'aksrt');
|
||||
aksrt_render_profile_empty($svg_empty_follow ?? $svg_empty_post ?? '', $empty_msg);
|
||||
? __('暂无粉丝', 'jio')
|
||||
: __('暂未关注任何人', 'jio');
|
||||
jio_render_profile_empty($svg_empty_follow ?? $svg_empty_post ?? '', $empty_msg);
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<?php echo aksrt_get_user_home_follow_placeholder(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- 固定骨架由本主题 helper 输出。 ?>
|
||||
<?php echo jio_get_user_home_follow_placeholder(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- 固定骨架由本主题 helper 输出。 ?>
|
||||
@@ -3,10 +3,10 @@
|
||||
* Public user home — posts tab panel body.
|
||||
*
|
||||
* Rendered inside the #panel-posts wrapper on the public user home and via
|
||||
* the aksrt/v1 user-home panel REST fragment. Pagination is button-driven
|
||||
* (aksrt_render_user_home_pagination) and never touches the URL.
|
||||
* the jio/v1 user-home panel REST fragment. Pagination is button-driven
|
||||
* (jio_render_user_home_pagination) and never touches the URL.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
@@ -14,7 +14,7 @@ defined('ABSPATH') || exit;
|
||||
$args = is_array($args ?? null) ? $args : [];
|
||||
extract($args, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_extract
|
||||
|
||||
$user_home_render_config = aksrt_resolve_post_list_render_config([
|
||||
$user_home_render_config = jio_resolve_post_list_render_config([
|
||||
'context' => 'author',
|
||||
'overrides' => [
|
||||
'no_author' => true,
|
||||
@@ -32,9 +32,9 @@ $author_posts = new WP_Query([
|
||||
// 面板 AJAX 翻页期间由 author.js 切 .is-loading,骨架沿用文章列表的
|
||||
// .post_ajax_loader 契约。形状跟随同一份渲染配置(list / card):
|
||||
// 卡片模式下若仍渲染列表块,骨架就与真实卡片不同轴。
|
||||
$user_home_panel_loader = function_exists('aksrt_render_placeholder')
|
||||
? '<div class="post_ajax_loader" role="status" aria-label="' . esc_attr__('正在加载', 'aksrt') . '">' . aksrt_render_placeholder((string) ($user_home_render_config['mode'] ?? 'list'), max(4, (int) $per_page)) . '</div>'
|
||||
$user_home_panel_loader = function_exists('jio_render_placeholder')
|
||||
? '<div class="post_ajax_loader" role="status" aria-label="' . esc_attr__('正在加载', 'jio') . '">' . jio_render_placeholder((string) ($user_home_render_config['mode'] ?? 'list'), max(4, (int) $per_page)) . '</div>'
|
||||
: '';
|
||||
aksrt_render_post_list(array_merge($user_home_render_config, ['wrapper_class' => 'aksrt-user-home__post-list', 'append_inner_html' => $user_home_panel_loader]), $author_posts);
|
||||
aksrt_render_user_home_pagination((int) $author_posts->max_num_pages, (int) $posts_page);
|
||||
jio_render_post_list(array_merge($user_home_render_config, ['wrapper_class' => 'jio-user-home__post-list', 'append_inner_html' => $user_home_panel_loader]), $author_posts);
|
||||
jio_render_user_home_pagination((int) $author_posts->max_num_pages, (int) $posts_page);
|
||||
wp_reset_postdata();
|
||||
@@ -4,12 +4,12 @@
|
||||
*
|
||||
* 分页渲染和空状态卡片,供本人中心和公开主页共用。
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if (!function_exists('aksrt_render_profile_pagination')) {
|
||||
if (!function_exists('jio_render_profile_pagination')) {
|
||||
/**
|
||||
* 渲染分页
|
||||
*
|
||||
@@ -17,7 +17,7 @@ if (!function_exists('aksrt_render_profile_pagination')) {
|
||||
* @param int $current 当前页
|
||||
* @param string $param URL 参数名
|
||||
*/
|
||||
function aksrt_render_profile_pagination($total_pages, $current, $param, $base_url = '') {
|
||||
function jio_render_profile_pagination($total_pages, $current, $param, $base_url = '') {
|
||||
if ($total_pages <= 1) {
|
||||
return;
|
||||
}
|
||||
@@ -29,22 +29,22 @@ if (!function_exists('aksrt_render_profile_pagination')) {
|
||||
'format' => '',
|
||||
'current' => $current,
|
||||
'total' => $total_pages,
|
||||
'prev_text' => '<span aria-hidden="true">‹</span><span class="screen-reader-text">' . esc_html__('上一页', 'aksrt') . '</span>',
|
||||
'next_text' => '<span aria-hidden="true">›</span><span class="screen-reader-text">' . esc_html__('下一页', 'aksrt') . '</span>',
|
||||
'prev_text' => '<span aria-hidden="true">‹</span><span class="screen-reader-text">' . esc_html__('上一页', 'jio') . '</span>',
|
||||
'next_text' => '<span aria-hidden="true">›</span><span class="screen-reader-text">' . esc_html__('下一页', 'jio') . '</span>',
|
||||
'mid_size' => 1,
|
||||
'end_size' => 1,
|
||||
]);
|
||||
if ($links) {
|
||||
echo '<nav class="profile-pagination" aria-label="' . esc_attr__('分页', 'aksrt') . '">' . $links . '</nav>'; // phpcs:ignore
|
||||
echo '<nav class="profile-pagination" aria-label="' . esc_attr__('分页', 'jio') . '">' . $links . '</nav>'; // phpcs:ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_render_asset_pagination')) {
|
||||
if (!function_exists('jio_render_asset_pagination')) {
|
||||
/**
|
||||
* Render user asset pagination without URL state.
|
||||
*/
|
||||
function aksrt_render_asset_pagination(int $total_pages, int $current, string $asset): void {
|
||||
function jio_render_asset_pagination(int $total_pages, int $current, string $asset): void {
|
||||
if ($total_pages <= 1) {
|
||||
return;
|
||||
}
|
||||
@@ -59,9 +59,9 @@ if (!function_exists('aksrt_render_asset_pagination')) {
|
||||
], static fn(int $page): bool => $page >= 1 && $page <= $total_pages)));
|
||||
sort($pages);
|
||||
|
||||
echo '<nav class="profile-pagination" aria-label="' . esc_attr__('分页', 'aksrt') . '">';
|
||||
echo '<nav class="profile-pagination" aria-label="' . esc_attr__('分页', 'jio') . '">';
|
||||
if ($current > 1) {
|
||||
echo '<button type="button" class="page-numbers prev" data-aksrt-asset-page="' . (int) ($current - 1) . '" data-aksrt-asset-key="' . esc_attr($asset) . '"><span aria-hidden="true">‹</span><span class="screen-reader-text">' . esc_html__('上一页', 'aksrt') . '</span></button>';
|
||||
echo '<button type="button" class="page-numbers prev" data-jio-asset-page="' . (int) ($current - 1) . '" data-jio-asset-key="' . esc_attr($asset) . '"><span aria-hidden="true">‹</span><span class="screen-reader-text">' . esc_html__('上一页', 'jio') . '</span></button>';
|
||||
}
|
||||
$previous = 0;
|
||||
foreach ($pages as $page) {
|
||||
@@ -71,22 +71,22 @@ if (!function_exists('aksrt_render_asset_pagination')) {
|
||||
if ($page === $current) {
|
||||
echo '<span class="page-numbers current" aria-current="page">' . (int) $page . '</span>';
|
||||
} else {
|
||||
echo '<button type="button" class="page-numbers" data-aksrt-asset-page="' . (int) $page . '" data-aksrt-asset-key="' . esc_attr($asset) . '">' . (int) $page . '</button>';
|
||||
echo '<button type="button" class="page-numbers" data-jio-asset-page="' . (int) $page . '" data-jio-asset-key="' . esc_attr($asset) . '">' . (int) $page . '</button>';
|
||||
}
|
||||
$previous = $page;
|
||||
}
|
||||
if ($current < $total_pages) {
|
||||
echo '<button type="button" class="page-numbers next" data-aksrt-asset-page="' . (int) ($current + 1) . '" data-aksrt-asset-key="' . esc_attr($asset) . '"><span aria-hidden="true">›</span><span class="screen-reader-text">' . esc_html__('下一页', 'aksrt') . '</span></button>';
|
||||
echo '<button type="button" class="page-numbers next" data-jio-asset-page="' . (int) ($current + 1) . '" data-jio-asset-key="' . esc_attr($asset) . '"><span aria-hidden="true">›</span><span class="screen-reader-text">' . esc_html__('下一页', 'jio') . '</span></button>';
|
||||
}
|
||||
echo '</nav>';
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_render_profile_empty')) {
|
||||
if (!function_exists('jio_render_profile_empty')) {
|
||||
/**
|
||||
* 渲染空状态卡片
|
||||
*/
|
||||
function aksrt_render_profile_empty($icon_svg, $title, $desc = '', $cta_url = '', $cta_label = '') {
|
||||
function jio_render_profile_empty($icon_svg, $title, $desc = '', $cta_url = '', $cta_label = '') {
|
||||
echo '<div class="profile-empty">';
|
||||
echo '<div class="profile-empty__icon" aria-hidden="true">' . $icon_svg . '</div>'; // phpcs:ignore
|
||||
echo '<h4 class="profile-empty__title">' . esc_html($title) . '</h4>';
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
*
|
||||
* Contract: get_template_part(..., null, $args)
|
||||
* user WP_User
|
||||
* dashboard array from aksrt_get_user_dashboard_view()
|
||||
* dashboard array from jio_get_user_dashboard_view()
|
||||
* user_home_settings array
|
||||
* is_author_page bool
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
@@ -28,7 +28,7 @@ if (!($user instanceof WP_User)) {
|
||||
}
|
||||
|
||||
$user_id = (int) $user->ID;
|
||||
$home_url = function_exists('aksrt_get_user_home_url') ? aksrt_get_user_home_url($user) : home_url('/');
|
||||
$home_url = function_exists('jio_get_user_home_url') ? jio_get_user_home_url($user) : home_url('/');
|
||||
$show_cover = !array_key_exists('cover', $settings) || !empty($settings['cover']);
|
||||
$show_follow = !array_key_exists('follow', $settings) || !empty($settings['follow']);
|
||||
$show_avatar = !array_key_exists('avatar', $settings) || !empty($settings['avatar']);
|
||||
@@ -39,72 +39,72 @@ $profile_details = is_array($dashboard['profile_details'] ?? null) ? $dashboard[
|
||||
// Registration time is always present, so the details dialog always has
|
||||
// content and the "更多资料" menu action is always available.
|
||||
$registered_time = get_date_from_gmt((string) $user->user_registered, 'Y-m-d H:i:s');
|
||||
$last_login_ts = (int) get_user_meta($user_id, 'aksrt_last_login', true);
|
||||
$last_login_ts = (int) get_user_meta($user_id, 'jio_last_login', true);
|
||||
$last_login_time = $last_login_ts > 0 ? wp_date('Y-m-d H:i:s', $last_login_ts) : '';
|
||||
$has_more_details = $registered_time !== '' || $last_login_time !== '' || !empty($profile_details['website']) || !empty($profile_details['qq']) || !empty($profile_details['wechat']) || !empty($profile_details['weibo']) || !empty($profile_details['github']) || !empty($profile_details['address']);
|
||||
$signals = $dashboard['profile_signals'] ?? [];
|
||||
$show_report = !empty($dashboard['show_report']);
|
||||
$bg_url = function_exists('aksrt_get_user_cover_url') ? aksrt_get_user_cover_url($user_id) : '';
|
||||
$bg_url = function_exists('jio_get_user_cover_url') ? jio_get_user_cover_url($user_id) : '';
|
||||
$is_own = !empty($dashboard['is_own_profile']);
|
||||
|
||||
// 封面右上角数据条(参考主题 zib_get_author_header_metas):人气值 + 点赞,
|
||||
// 粉丝数只在内容 tab 上呈现,不进入封面。
|
||||
$cover_metas = [];
|
||||
if (function_exists('aksrt_get_user_posts_meta_sum') && function_exists('aksrt_cut_count')) {
|
||||
$view_n = aksrt_cut_count(aksrt_get_user_posts_meta_sum($user_id, 'aksrt_post_views'));
|
||||
$like_n = aksrt_cut_count(aksrt_get_user_posts_meta_sum($user_id, '_aksrt_like_count'));
|
||||
if (function_exists('jio_get_user_posts_meta_sum') && function_exists('jio_cut_count')) {
|
||||
$view_n = jio_cut_count(jio_get_user_posts_meta_sum($user_id, 'jio_post_views'));
|
||||
$like_n = jio_cut_count(jio_get_user_posts_meta_sum($user_id, '_jio_like_count'));
|
||||
if ($view_n !== '' && $view_n !== '0') {
|
||||
$cover_metas[] = [
|
||||
'count' => $view_n,
|
||||
'title' => sprintf(__('人气值 %s', 'aksrt'), $view_n),
|
||||
'title' => sprintf(__('人气值 %s', 'jio'), $view_n),
|
||||
'icon' => 'zibsvg-hot',
|
||||
];
|
||||
}
|
||||
if ($like_n !== '' && $like_n !== '0') {
|
||||
$cover_metas[] = [
|
||||
'count' => $like_n,
|
||||
'title' => sprintf(__('获得%s个点赞', 'aksrt'), $like_n),
|
||||
'title' => sprintf(__('获得%s个点赞', 'jio'), $like_n),
|
||||
'icon' => 'zibsvg-like',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$notification_settings = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::notification_settings()
|
||||
$notification_settings = class_exists('\Jio\Settings\Settings')
|
||||
? \Jio\Settings\Settings::notification_settings()
|
||||
: ['enabled' => false, 'icon_show' => []];
|
||||
$show_header_notification = !empty($notification_settings['enabled'])
|
||||
&& in_array('user_home_header', (array) ($notification_settings['icon_show'] ?? []), true);
|
||||
$messages_url = $show_header_notification && function_exists('aksrt_get_messages_page_url') ? aksrt_get_messages_page_url() : '';
|
||||
$unread_count = $is_own ? aksrt_get_user_unread_notification_count($user_id) : 0;
|
||||
$messages_url = $show_header_notification && function_exists('jio_get_messages_page_url') ? jio_get_messages_page_url() : '';
|
||||
$unread_count = $is_own ? jio_get_user_unread_notification_count($user_id) : 0;
|
||||
// 封面三点菜单末项:管理员 → 禁封/解封(参考主题 author_header_drop_lists 钩子语义,
|
||||
// 禁封权限优先于举报);否则 → 举报用户(保持既有契约)。
|
||||
$cover_ban_html = function_exists('aksrt_get_user_cover_menu_action_html')
|
||||
? aksrt_get_user_cover_menu_action_html($user_id)
|
||||
$cover_ban_html = function_exists('jio_get_user_cover_menu_action_html')
|
||||
? jio_get_user_cover_menu_action_html($user_id)
|
||||
: '';
|
||||
// 已封禁/小黑屋用户不展示举报入口(参考主题 zib_get_report_link 排除语义)。
|
||||
$target_ban_restricted = function_exists('aksrt_is_user_ban_restricted') && aksrt_is_user_ban_restricted($user_id);
|
||||
$target_ban_restricted = function_exists('jio_is_user_ban_restricted') && jio_is_user_ban_restricted($user_id);
|
||||
$show_cover_report = $cover_ban_html === '' && $show_report && !$is_own && !$target_ban_restricted;
|
||||
$show_cover_menu = $has_more_details || $show_cover_report || $cover_ban_html !== '';
|
||||
?><div class="aksrt-author-hero<?php echo $show_cover ? '' : ' aksrt-author-hero--no-cover'; ?>">
|
||||
?><div class="jio-author-hero<?php echo $show_cover ? '' : ' jio-author-hero--no-cover'; ?>">
|
||||
<?php if ($show_cover) : ?>
|
||||
<div class="aksrt-author-hero__cover">
|
||||
<img<?php echo aksrt_get_lazy_attr('lazy_cover', (string) $bg_url, 'aksrt-author-hero__cover-img', aksrt_get_lazy_thumb('lg')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="">
|
||||
<div class="aksrt-author-hero__cover-mask"></div>
|
||||
<div class="jio-author-hero__cover">
|
||||
<img<?php echo jio_get_lazy_attr('lazy_cover', (string) $bg_url, 'jio-author-hero__cover-img', jio_get_lazy_thumb('lg')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="">
|
||||
<div class="jio-author-hero__cover-mask"></div>
|
||||
<?php if ($cover_metas) : ?>
|
||||
<div class="aksrt-author-hero__cover-metas" aria-label="<?php esc_attr_e('主页数据', 'aksrt'); ?>">
|
||||
<div class="jio-author-hero__cover-metas" aria-label="<?php esc_attr_e('主页数据', 'jio'); ?>">
|
||||
<?php foreach ($cover_metas as $cover_meta) : ?>
|
||||
<span class="aksrt-author-hero__cover-meta" data-toggle="tooltip" title="<?php echo esc_attr((string) $cover_meta['title']); ?>">
|
||||
<?php echo aksrt_icon_markup((string) $cover_meta['icon']); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- fixed sprite markup. ?>
|
||||
<span class="jio-author-hero__cover-meta" data-toggle="tooltip" title="<?php echo esc_attr((string) $cover_meta['title']); ?>">
|
||||
<?php echo jio_icon_markup((string) $cover_meta['icon']); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- fixed sprite markup. ?>
|
||||
<?php echo esc_html((string) $cover_meta['count']); ?>
|
||||
</span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($show_cover_menu) : ?>
|
||||
<div class="aksrt-cover-menu aksrt-cover-menu--author" data-aksrt-menu>
|
||||
<button type="button" class="aksrt-cover-menu__trigger" aria-haspopup="true" aria-expanded="false" aria-label="<?php esc_attr_e('个人主页操作', 'aksrt'); ?>"><i class="fa fas fa-ellipsis-h" aria-hidden="true"></i></button>
|
||||
<div class="aksrt-cover-menu__panel" role="menu" hidden>
|
||||
<?php if ($has_more_details) : ?><button type="button" role="menuitem" data-aksrt-profile-details><i class="fa fas fa-address-card" aria-hidden="true"></i><?php esc_html_e('更多资料', 'aksrt'); ?></button><?php endif; ?>
|
||||
<div class="jio-cover-menu jio-cover-menu--author" data-jio-menu>
|
||||
<button type="button" class="jio-cover-menu__trigger" aria-haspopup="true" aria-expanded="false" aria-label="<?php esc_attr_e('个人主页操作', 'jio'); ?>"><i class="fa fas fa-ellipsis-h" aria-hidden="true"></i></button>
|
||||
<div class="jio-cover-menu__panel" role="menu" hidden>
|
||||
<?php if ($has_more_details) : ?><button type="button" role="menuitem" data-jio-profile-details><i class="fa fas fa-address-card" aria-hidden="true"></i><?php esc_html_e('更多资料', 'jio'); ?></button><?php endif; ?>
|
||||
<?php if ($show_cover_report) : ?>
|
||||
<?php
|
||||
$report_payload = [
|
||||
@@ -113,11 +113,11 @@ $show_cover_menu = $has_more_details || $show_cover_report || $cover_ban_html !=
|
||||
'target_name' => $user->display_name,
|
||||
];
|
||||
?>
|
||||
<?php if (is_user_logged_in()) : ?><button type="button" role="menuitem" data-aksrt-report="<?php echo esc_attr(wp_json_encode($report_payload)); ?>"><i class="fa fas fa-flag" aria-hidden="true"></i><?php esc_html_e('举报用户', 'aksrt'); ?></button>
|
||||
<?php else : ?><a role="menuitem" href="<?php echo esc_url(aksrt_get_login_url($home_url)); ?>"><i class="fa fas fa-flag" aria-hidden="true"></i><?php esc_html_e('举报用户', 'aksrt'); ?></a><?php endif; ?>
|
||||
<?php if (is_user_logged_in()) : ?><button type="button" role="menuitem" data-jio-report="<?php echo esc_attr(wp_json_encode($report_payload)); ?>"><i class="fa fas fa-flag" aria-hidden="true"></i><?php esc_html_e('举报用户', 'jio'); ?></button>
|
||||
<?php else : ?><a role="menuitem" href="<?php echo esc_url(jio_get_login_url($home_url)); ?>"><i class="fa fas fa-flag" aria-hidden="true"></i><?php esc_html_e('举报用户', 'jio'); ?></a><?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
// 禁封/解封入口(user-ban.js 的 [data-aksrt-ban] 委托)。
|
||||
// 禁封/解封入口(user-ban.js 的 [data-jio-ban] 委托)。
|
||||
echo $cover_ban_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- helper escapes internally.
|
||||
?>
|
||||
</div>
|
||||
@@ -126,12 +126,12 @@ $show_cover_menu = $has_more_details || $show_cover_report || $cover_ban_html !=
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="aksrt-author-hero__body">
|
||||
<div class="jio-author-hero__body">
|
||||
<?php if ($show_avatar) : ?>
|
||||
<div class="aksrt-author-hero__avatar">
|
||||
<div class="jio-author-hero__avatar">
|
||||
<?php
|
||||
if (function_exists('aksrt_get_avatar_html')) {
|
||||
echo aksrt_get_avatar_html($user_id, 120, ['loading' => 'lazy']); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
if (function_exists('jio_get_avatar_html')) {
|
||||
echo jio_get_avatar_html($user_id, 120, ['loading' => 'lazy']); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
} else {
|
||||
echo get_avatar($user_id, 120, '', $user->display_name); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
@@ -139,11 +139,11 @@ $show_cover_menu = $has_more_details || $show_cover_report || $cover_ban_html !=
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="aksrt-author-hero__info">
|
||||
<div class="jio-author-hero__info">
|
||||
<?php if ($show_name) : ?>
|
||||
<h1 class="aksrt-author-hero__name">
|
||||
<?php if (function_exists('aksrt_get_user_name')) : ?>
|
||||
<?php echo aksrt_get_user_name(['id' => $user_id, 'class' => 'aksrt-author-hero__name-inner', 'vip' => true, 'medal' => false, 'auth' => true, 'level' => true, 'follow' => false]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<h1 class="jio-author-hero__name">
|
||||
<?php if (function_exists('jio_get_user_name')) : ?>
|
||||
<?php echo jio_get_user_name(['id' => $user_id, 'class' => 'jio-author-hero__name-inner', 'vip' => true, 'medal' => false, 'auth' => true, 'level' => true, 'follow' => false]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php else : ?>
|
||||
<?php echo esc_html($user->display_name); ?>
|
||||
<?php endif; ?>
|
||||
@@ -153,74 +153,74 @@ $show_cover_menu = $has_more_details || $show_cover_report || $cover_ban_html !=
|
||||
<?php
|
||||
// 治理状态徽章占据身份行元信息位(参考主题 author_header_identity 钩子:
|
||||
// 红=违规已封号 / 黄=小黑屋禁封中 / 灰=禁言中,字段与颜色统一管理)。
|
||||
$ban_badge = function_exists('aksrt_get_user_ban_identity_badge')
|
||||
? aksrt_get_user_ban_identity_badge($user_id)
|
||||
$ban_badge = function_exists('jio_get_user_ban_identity_badge')
|
||||
? jio_get_user_ban_identity_badge($user_id)
|
||||
: '';
|
||||
// legacy parity: the badge overview leads the identity row.
|
||||
$city_badge = function_exists('aksrt_get_user_city_badge_html')
|
||||
? aksrt_get_user_city_badge_html($user_id, 'user_home', 'badg')
|
||||
$city_badge = function_exists('jio_get_user_city_badge_html')
|
||||
? jio_get_user_city_badge_html($user_id, 'user_home', 'badg')
|
||||
: '';
|
||||
$medal_entry = function_exists('aksrt_render_user_medal_entry')
|
||||
? aksrt_render_user_medal_entry($user_id, 'user-home', $is_own)
|
||||
$medal_entry = function_exists('jio_render_user_medal_entry')
|
||||
? jio_render_user_medal_entry($user_id, 'user-home', $is_own)
|
||||
: '';
|
||||
?>
|
||||
<?php if ($ban_badge !== '' || $medal_entry !== '' || $city_badge !== '') : ?>
|
||||
<div class="aksrt-author-hero__identity user-identity flex ac hh">
|
||||
<div class="jio-author-hero__identity user-identity flex ac hh">
|
||||
<?php echo $ban_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- helper escapes internally. ?>
|
||||
<?php echo $medal_entry; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php echo $city_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php $user_description = function_exists('aksrt_get_user_description') ? aksrt_get_user_description($user_id) : (string) $user->description; ?>
|
||||
<?php $user_description = function_exists('jio_get_user_description') ? jio_get_user_description($user_id) : (string) $user->description; ?>
|
||||
<?php if ($show_desc && $user_description !== '') : ?>
|
||||
<p class="aksrt-author-hero__desc"><?php echo esc_html($user_description); ?></p>
|
||||
<p class="jio-author-hero__desc"><?php echo esc_html($user_description); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="aksrt-author-hero__actions">
|
||||
<div class="jio-author-hero__actions">
|
||||
<?php if ($is_own) : ?>
|
||||
<a href="<?php echo esc_url(aksrt_get_user_center_url()); ?>" class="btn-primary btn-sm">
|
||||
<a href="<?php echo esc_url(jio_get_user_center_url()); ?>" class="btn-primary btn-sm">
|
||||
<i class="fa fas fa-user" aria-hidden="true"></i>
|
||||
<span><?php esc_html_e('用户中心', 'aksrt'); ?></span>
|
||||
<span><?php esc_html_e('用户中心', 'jio'); ?></span>
|
||||
</a>
|
||||
<?php if ($messages_url !== '') : ?>
|
||||
<a href="<?php echo esc_url($messages_url); ?>" class="btn-ghost btn-sm btn-icon aksrt-author-hero__message-btn" aria-label="<?php esc_attr_e('消息通知', 'aksrt'); ?>" title="<?php esc_attr_e('消息通知', 'aksrt'); ?>">
|
||||
<a href="<?php echo esc_url($messages_url); ?>" class="btn-ghost btn-sm btn-icon jio-author-hero__message-btn" aria-label="<?php esc_attr_e('消息通知', 'jio'); ?>" title="<?php esc_attr_e('消息通知', 'jio'); ?>">
|
||||
<i class="fa fas fa-bell" aria-hidden="true"></i>
|
||||
<?php if ($unread_count > 0) : ?>
|
||||
<span class="aksrt-author-hero__action-badge"><?php echo esc_html((string) $unread_count); ?></span>
|
||||
<span class="jio-author-hero__action-badge"><?php echo esc_html((string) $unread_count); ?></span>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php else : ?>
|
||||
<?php if ($show_follow) : ?>
|
||||
<?php echo aksrt_get_user_follow('btn-outline btn-sm aksrt-author-hero__follow-btn', (int) $user_id, null, null, __('登录后关注', 'aksrt')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php echo jio_get_user_follow('btn-outline btn-sm jio-author-hero__follow-btn', (int) $user_id, null, null, __('登录后关注', 'jio')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($is_author && function_exists('aksrt_render_admin_quick_link')) { aksrt_render_admin_quick_link('page-display/user-home', __('用户主页设置', 'aksrt')); } ?>
|
||||
<?php if ($is_author && function_exists('jio_render_admin_quick_link')) { jio_render_admin_quick_link('page-display/user-home', __('用户主页设置', 'jio')); } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($has_more_details) : ?>
|
||||
<div class="aksrt-profile-details-modal" id="aksrt-profile-details-modal" hidden role="dialog" aria-modal="true" aria-labelledby="aksrt-profile-details-title">
|
||||
<div class="aksrt-profile-details-modal__backdrop" data-aksrt-modal-close></div>
|
||||
<div class="aksrt-profile-details-modal__dialog" tabindex="-1">
|
||||
<button type="button" class="aksrt-profile-details-modal__close" data-aksrt-modal-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>">×</button>
|
||||
<h2 id="aksrt-profile-details-title"><?php esc_html_e('更多资料', 'aksrt'); ?></h2>
|
||||
<div class="jio-profile-details-modal" id="jio-profile-details-modal" hidden role="dialog" aria-modal="true" aria-labelledby="jio-profile-details-title">
|
||||
<div class="jio-profile-details-modal__backdrop" data-jio-modal-close></div>
|
||||
<div class="jio-profile-details-modal__dialog" tabindex="-1">
|
||||
<button type="button" class="jio-profile-details-modal__close" data-jio-modal-close aria-label="<?php esc_attr_e('关闭', 'jio'); ?>">×</button>
|
||||
<h2 id="jio-profile-details-title"><?php esc_html_e('更多资料', 'jio'); ?></h2>
|
||||
<dl>
|
||||
<?php $verify_state = is_array($dashboard['verify_state'] ?? null) ? $dashboard['verify_state'] : []; ?>
|
||||
<?php if (($verify_state['state'] ?? '') !== '' && ($verify_state['label'] ?? '') !== '') : ?><div><dt><?php esc_html_e('认证', 'aksrt'); ?></dt><dd><?php echo esc_html((string) $verify_state['label']); ?></dd></div><?php endif; ?>
|
||||
<?php if (!empty($profile_details['gender'])) : ?><div><dt><?php esc_html_e('性别', 'aksrt'); ?></dt><dd><?php echo esc_html(['male' => __('男', 'aksrt'), 'female' => __('女', 'aksrt'), 'secret' => __('保密', 'aksrt')][$profile_details['gender']] ?? __('保密', 'aksrt')); ?></dd></div><?php endif; ?>
|
||||
<?php if (!empty($profile_details['website'])) : ?><div><dt><?php esc_html_e('个人网站', 'aksrt'); ?></dt><dd><a href="<?php echo esc_url($profile_details['website']); ?>" target="_blank" rel="noopener noreferrer"><?php echo esc_html($profile_details['website']); ?></a></dd></div><?php endif; ?>
|
||||
<?php if (!empty($profile_details['weibo'])) : ?><div><dt><?php esc_html_e('微博', 'aksrt'); ?></dt><dd><a href="<?php echo esc_url($profile_details['weibo']); ?>" target="_blank" rel="noopener noreferrer"><?php echo esc_html($profile_details['weibo']); ?></a></dd></div><?php endif; ?>
|
||||
<?php if (($verify_state['state'] ?? '') !== '' && ($verify_state['label'] ?? '') !== '') : ?><div><dt><?php esc_html_e('认证', 'jio'); ?></dt><dd><?php echo esc_html((string) $verify_state['label']); ?></dd></div><?php endif; ?>
|
||||
<?php if (!empty($profile_details['gender'])) : ?><div><dt><?php esc_html_e('性别', 'jio'); ?></dt><dd><?php echo esc_html(['male' => __('男', 'jio'), 'female' => __('女', 'jio'), 'secret' => __('保密', 'jio')][$profile_details['gender']] ?? __('保密', 'jio')); ?></dd></div><?php endif; ?>
|
||||
<?php if (!empty($profile_details['website'])) : ?><div><dt><?php esc_html_e('个人网站', 'jio'); ?></dt><dd><a href="<?php echo esc_url($profile_details['website']); ?>" target="_blank" rel="noopener noreferrer"><?php echo esc_html($profile_details['website']); ?></a></dd></div><?php endif; ?>
|
||||
<?php if (!empty($profile_details['weibo'])) : ?><div><dt><?php esc_html_e('微博', 'jio'); ?></dt><dd><a href="<?php echo esc_url($profile_details['weibo']); ?>" target="_blank" rel="noopener noreferrer"><?php echo esc_html($profile_details['weibo']); ?></a></dd></div><?php endif; ?>
|
||||
<?php if (!empty($profile_details['github'])) : ?><div><dt>GitHub</dt><dd><a href="<?php echo esc_url($profile_details['github']); ?>" target="_blank" rel="noopener noreferrer"><?php echo esc_html($profile_details['github']); ?></a></dd></div><?php endif; ?>
|
||||
<?php if (!empty($profile_details['qq'])) : ?><div><dt>QQ</dt><dd><?php echo esc_html($profile_details['qq']); ?></dd></div><?php endif; ?>
|
||||
<?php if (!empty($profile_details['wechat'])) : ?><div><dt><?php esc_html_e('微信', 'aksrt'); ?></dt><dd><?php echo esc_html($profile_details['wechat']); ?></dd></div><?php endif; ?>
|
||||
<?php if (!empty($profile_details['address'])) : ?><div><dt><?php esc_html_e('住址', 'aksrt'); ?></dt><dd><?php echo esc_html($profile_details['address']); ?></dd></div><?php endif; ?>
|
||||
<?php if ($registered_time !== '') : ?><div><dt><?php esc_html_e('注册时间', 'aksrt'); ?></dt><dd><?php echo esc_html($registered_time); ?></dd></div><?php endif; ?>
|
||||
<?php if ($last_login_time !== '') : ?><div><dt><?php esc_html_e('最后登录', 'aksrt'); ?></dt><dd><?php echo esc_html($last_login_time); ?></dd></div><?php endif; ?>
|
||||
<?php if (!empty($profile_details['wechat'])) : ?><div><dt><?php esc_html_e('微信', 'jio'); ?></dt><dd><?php echo esc_html($profile_details['wechat']); ?></dd></div><?php endif; ?>
|
||||
<?php if (!empty($profile_details['address'])) : ?><div><dt><?php esc_html_e('住址', 'jio'); ?></dt><dd><?php echo esc_html($profile_details['address']); ?></dd></div><?php endif; ?>
|
||||
<?php if ($registered_time !== '') : ?><div><dt><?php esc_html_e('注册时间', 'jio'); ?></dt><dd><?php echo esc_html($registered_time); ?></dd></div><?php endif; ?>
|
||||
<?php if ($last_login_time !== '') : ?><div><dt><?php esc_html_e('最后登录', 'jio'); ?></dt><dd><?php echo esc_html($last_login_time); ?></dd></div><?php endif; ?>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* user WP_User 被封禁用户
|
||||
* info array Restriction::get_ban_info() 的禁封信息行
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
@@ -22,10 +22,10 @@ if (!($user instanceof WP_User)) {
|
||||
}
|
||||
|
||||
$user_id = (int) $user->ID;
|
||||
$null_img = function_exists('aksrt_null_image_url') ? aksrt_null_image_url('null.svg') : '';
|
||||
$null_img = function_exists('jio_null_image_url') ? jio_null_image_url('null.svg') : '';
|
||||
$logout_url = wp_logout_url(home_url());
|
||||
$appeal_link = function_exists('aksrt_get_user_ban_appeal_link')
|
||||
? aksrt_get_user_ban_appeal_link($user_id, 'but c-blue padding-lg hollow')
|
||||
$appeal_link = function_exists('jio_get_user_ban_appeal_link')
|
||||
? jio_get_user_ban_appeal_link($user_id, 'but c-blue padding-lg hollow')
|
||||
: '';
|
||||
|
||||
$ban_set_row = static function (string $label, string $value): string {
|
||||
@@ -41,23 +41,23 @@ $ban_set_row = static function (string $label, string $value): string {
|
||||
<img src="<?php echo esc_url($null_img); ?>" alt="">
|
||||
<?php endif; ?>
|
||||
<div class="f404-msg mt20">
|
||||
<div class="c-red box-body separator mb30"><?php esc_html_e('抱歉,您的账号当前处于禁封状态,暂时无法登录', 'aksrt'); ?></div>
|
||||
<div class="c-red box-body separator mb30"><?php esc_html_e('抱歉,您的账号当前处于禁封状态,暂时无法登录', 'jio'); ?></div>
|
||||
<div class="mb20 muted-box text-left" style="max-width: 600px; margin: auto;">
|
||||
<?php
|
||||
echo $ban_set_row(__('用户名', 'aksrt'), $user->display_name); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- row builder escapes.
|
||||
echo $ban_set_row(__('状态', 'aksrt'), (string) ($info['status'] ?? ''));
|
||||
echo $ban_set_row(__('开始时间', 'aksrt'), (string) ($info['start'] ?? ''));
|
||||
echo $ban_set_row(__('结束时间', 'aksrt'), (string) ($info['end'] ?? ''));
|
||||
echo $ban_set_row(__('原因', 'aksrt'), (string) ($info['reason'] ?? ''));
|
||||
echo $ban_set_row(__('说明', 'aksrt'), (string) ($info['desc'] ?? ''));
|
||||
echo $ban_set_row(__('用户名', 'jio'), $user->display_name); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- row builder escapes.
|
||||
echo $ban_set_row(__('状态', 'jio'), (string) ($info['status'] ?? ''));
|
||||
echo $ban_set_row(__('开始时间', 'jio'), (string) ($info['start'] ?? ''));
|
||||
echo $ban_set_row(__('结束时间', 'jio'), (string) ($info['end'] ?? ''));
|
||||
echo $ban_set_row(__('原因', 'jio'), (string) ($info['reason'] ?? ''));
|
||||
echo $ban_set_row(__('说明', 'jio'), (string) ($info['desc'] ?? ''));
|
||||
if (!empty($info['no_appeal'])) {
|
||||
echo $ban_set_row(__('申诉权限', 'aksrt'), __('本次禁封您将不能发起申诉', 'aksrt'));
|
||||
echo $ban_set_row(__('禁止申诉说明', 'aksrt'), (string) ($info['no_appeal_desc'] ?? ''));
|
||||
echo $ban_set_row(__('申诉权限', 'jio'), __('本次禁封您将不能发起申诉', 'jio'));
|
||||
echo $ban_set_row(__('禁止申诉说明', 'jio'), (string) ($info['no_appeal_desc'] ?? ''));
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="mt20 text-center">
|
||||
<a href="<?php echo esc_url($logout_url); ?>" class="but c-yellow padding-lg hollow mr20"><?php esc_html_e('退出登录', 'aksrt'); ?></a>
|
||||
<a href="<?php echo esc_url($logout_url); ?>" class="but c-yellow padding-lg hollow mr20"><?php esc_html_e('退出登录', 'jio'); ?></a>
|
||||
<?php echo $appeal_link; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- helper escapes internally. ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user