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
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -74,7 +74,7 @@ trait AuthReader {
|
||||
return $type;
|
||||
}
|
||||
|
||||
/** 应急登录 Key(空=禁用;管理员通过 ?aksrt_bypass=<key> 绕过 wp-login 替换) */
|
||||
/** 应急登录 Key(空=禁用;管理员通过 ?jio_bypass=<key> 绕过 wp-login 替换) */
|
||||
public static function admin_sign_key(): string {
|
||||
return trim((string) self::get_value('admin_sign_key', ''));
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -16,43 +16,43 @@ class Capabilities {
|
||||
*/
|
||||
public static function cap_definitions(): array {
|
||||
return [
|
||||
'user_report' => ['label' => __('举报其它用户', 'aksrt'), 'default' => ['logged' => true]],
|
||||
'balance_transfer' => ['label' => __('余额转账给其他用户', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'points_transfer' => ['label' => __('积分转账给其他用户', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'balance_withdraw' => ['label' => __('余额提现', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'new_post_add' => ['label' => __('发布新文章', 'aksrt'), 'default' => ['logged' => true]],
|
||||
'new_post_audit_no' => ['label' => __('投稿无需审核直接发布', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'new_post_audit_no_manual' => ['label' => __('无需人工审核直接发布', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'new_post_upload_video' => ['label' => __('投稿允许上传视频', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'new_post_iframe_video' => ['label' => __('投稿允许插入 iframe 视频', 'aksrt'), 'exclude_roles' => ['all'], 'default' => ['logged' => true]],
|
||||
'new_post_hide' => ['label' => __('投稿允许发布隐藏内容', 'aksrt'), 'default' => ['logged' => true]],
|
||||
'new_post_image_cover' => ['label' => __('发帖允许设置图片封面', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'new_post_slide_cover' => ['label' => __('允许设置幻灯片封面', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'new_post_video_cover' => ['label' => __('允许设置视频封面', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'new_post_pay' => ['label' => __('投稿允许设置付费内容', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'new_post_pay_download' => ['label' => __('投稿允许设置付费下载', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'new_post_edit' => ['label' => __('修改自己发布的投稿', 'aksrt'), 'exclude_roles' => ['all'], 'default' => ['logged' => true]],
|
||||
'new_post_delete' => ['label' => __('删除自己发布的投稿', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'user_report' => ['label' => __('举报其它用户', 'jio'), 'default' => ['logged' => true]],
|
||||
'balance_transfer' => ['label' => __('余额转账给其他用户', 'jio'), 'exclude_roles' => ['all']],
|
||||
'points_transfer' => ['label' => __('积分转账给其他用户', 'jio'), 'exclude_roles' => ['all']],
|
||||
'balance_withdraw' => ['label' => __('余额提现', 'jio'), 'exclude_roles' => ['all']],
|
||||
'new_post_add' => ['label' => __('发布新文章', 'jio'), 'default' => ['logged' => true]],
|
||||
'new_post_audit_no' => ['label' => __('投稿无需审核直接发布', 'jio'), 'exclude_roles' => ['all']],
|
||||
'new_post_audit_no_manual' => ['label' => __('无需人工审核直接发布', 'jio'), 'exclude_roles' => ['all']],
|
||||
'new_post_upload_video' => ['label' => __('投稿允许上传视频', 'jio'), 'exclude_roles' => ['all']],
|
||||
'new_post_iframe_video' => ['label' => __('投稿允许插入 iframe 视频', 'jio'), 'exclude_roles' => ['all'], 'default' => ['logged' => true]],
|
||||
'new_post_hide' => ['label' => __('投稿允许发布隐藏内容', 'jio'), 'default' => ['logged' => true]],
|
||||
'new_post_image_cover' => ['label' => __('发帖允许设置图片封面', 'jio'), 'exclude_roles' => ['all']],
|
||||
'new_post_slide_cover' => ['label' => __('允许设置幻灯片封面', 'jio'), 'exclude_roles' => ['all']],
|
||||
'new_post_video_cover' => ['label' => __('允许设置视频封面', 'jio'), 'exclude_roles' => ['all']],
|
||||
'new_post_pay' => ['label' => __('投稿允许设置付费内容', 'jio'), 'exclude_roles' => ['all']],
|
||||
'new_post_pay_download' => ['label' => __('投稿允许设置付费下载', 'jio'), 'exclude_roles' => ['all']],
|
||||
'new_post_edit' => ['label' => __('修改自己发布的投稿', 'jio'), 'exclude_roles' => ['all'], 'default' => ['logged' => true]],
|
||||
'new_post_delete' => ['label' => __('删除自己发布的投稿', 'jio'), 'exclude_roles' => ['all']],
|
||||
|
||||
'comment_view' => ['label' => __('查看评论', 'aksrt'), 'default' => ['all' => true]],
|
||||
'comment_add' => ['label' => __('发表评论', 'aksrt'), 'default' => ['logged' => true]],
|
||||
'comment_edit' => ['label' => __('修改自己发布的评论', 'aksrt'), 'exclude_roles' => ['all'], 'default' => ['logged' => true]],
|
||||
'comment_delete' => ['label' => __('删除自己发布的评论', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'comment_audit_no' => ['label' => __('评论无需审核直接发布', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'comment_audit_no_manual' => ['label' => __('评论无需人工审核', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'comment_set_topping_my_post' => ['label' => __('置顶自己文章下的评论', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'comment_set_topping_other' => ['label' => __('置顶其他文章下的评论', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'comment_edit_my_post' => ['label' => __('修改自己文章下的评论', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'comment_edit_other' => ['label' => __('修改其他文章下的评论', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'comment_audit_my_post' => ['label' => __('审核自己文章下的评论', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'comment_audit_other' => ['label' => __('审核其他文章下的评论', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'comment_delete_my_post' => ['label' => __('删除自己文章下的评论', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'comment_delete_other' => ['label' => __('删除其他文章下的评论', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'comment_view' => ['label' => __('查看评论', 'jio'), 'default' => ['all' => true]],
|
||||
'comment_add' => ['label' => __('发表评论', 'jio'), 'default' => ['logged' => true]],
|
||||
'comment_edit' => ['label' => __('修改自己发布的评论', 'jio'), 'exclude_roles' => ['all'], 'default' => ['logged' => true]],
|
||||
'comment_delete' => ['label' => __('删除自己发布的评论', 'jio'), 'exclude_roles' => ['all']],
|
||||
'comment_audit_no' => ['label' => __('评论无需审核直接发布', 'jio'), 'exclude_roles' => ['all']],
|
||||
'comment_audit_no_manual' => ['label' => __('评论无需人工审核', 'jio'), 'exclude_roles' => ['all']],
|
||||
'comment_set_topping_my_post' => ['label' => __('置顶自己文章下的评论', 'jio'), 'exclude_roles' => ['all']],
|
||||
'comment_set_topping_other' => ['label' => __('置顶其他文章下的评论', 'jio'), 'exclude_roles' => ['all']],
|
||||
'comment_edit_my_post' => ['label' => __('修改自己文章下的评论', 'jio'), 'exclude_roles' => ['all']],
|
||||
'comment_edit_other' => ['label' => __('修改其他文章下的评论', 'jio'), 'exclude_roles' => ['all']],
|
||||
'comment_audit_my_post' => ['label' => __('审核自己文章下的评论', 'jio'), 'exclude_roles' => ['all']],
|
||||
'comment_audit_other' => ['label' => __('审核其他文章下的评论', 'jio'), 'exclude_roles' => ['all']],
|
||||
'comment_delete_my_post' => ['label' => __('删除自己文章下的评论', 'jio'), 'exclude_roles' => ['all']],
|
||||
'comment_delete_other' => ['label' => __('删除其他文章下的评论', 'jio'), 'exclude_roles' => ['all']],
|
||||
|
||||
'upload_submit_image' => ['label' => __('投稿图片上传', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'upload_comment_image' => ['label' => __('评论图片上传', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'upload_resource_attachment'=> ['label' => __('资源附件上传', 'aksrt'), 'exclude_roles' => ['all']],
|
||||
'resource_download' => ['label' => __('资源下载', 'aksrt'), 'default' => ['logged' => true]],
|
||||
'upload_submit_image' => ['label' => __('投稿图片上传', 'jio'), 'exclude_roles' => ['all']],
|
||||
'upload_comment_image' => ['label' => __('评论图片上传', 'jio'), 'exclude_roles' => ['all']],
|
||||
'upload_resource_attachment'=> ['label' => __('资源附件上传', 'jio'), 'exclude_roles' => ['all']],
|
||||
'resource_download' => ['label' => __('资源下载', 'jio'), 'default' => ['logged' => true]],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ class Capabilities {
|
||||
|
||||
$level_threshold = (int) ($row['level'] ?? -1);
|
||||
if ($level_threshold >= 0) {
|
||||
$user_level = class_exists('\AKSRT\User\Level') ? \AKSRT\User\Level::get_level($user_id) : 0;
|
||||
$user_level = class_exists('\Jio\User\Level') ? \Jio\User\Level::get_level($user_id) : 0;
|
||||
if ($user_level >= $level_threshold) {
|
||||
return true;
|
||||
}
|
||||
@@ -136,14 +136,14 @@ class Capabilities {
|
||||
|
||||
$vip_threshold = (int) ($row['vip'] ?? -1);
|
||||
if ($vip_threshold >= 0) {
|
||||
$user_vip = function_exists('aksrt_get_user_vip_level') ? aksrt_get_user_vip_level($user_id) : 0;
|
||||
$user_vip = function_exists('jio_get_user_vip_level') ? jio_get_user_vip_level($user_id) : 0;
|
||||
if ($user_vip >= $vip_threshold) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($row['auth'])) {
|
||||
if (class_exists('\\AKSRT\\User\\AuthApply') && \AKSRT\User\AuthApply::is_verified($user_id)) {
|
||||
if (class_exists('\\Jio\\User\\AuthApply') && \Jio\User\AuthApply::is_verified($user_id)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -21,7 +21,7 @@ trait CategoryIntegrationGroups {
|
||||
* 获取分类封面图 URL(带优先级回退)
|
||||
*
|
||||
* 优先级:
|
||||
* 1. aksrt_category_cover_id term meta
|
||||
* 1. jio_category_cover_id term meta
|
||||
* 2. 该分类最新一篇有缩略图文章的缩略图
|
||||
* 3. 默认占位图
|
||||
*/
|
||||
@@ -33,7 +33,7 @@ trait CategoryIntegrationGroups {
|
||||
* 获取分类推荐描述(带优先级回退)
|
||||
*
|
||||
* 优先级:
|
||||
* 1. aksrt_category_recommend_desc term meta
|
||||
* 1. jio_category_recommend_desc term meta
|
||||
* 2. 原生 category description
|
||||
* 3. 空字符串
|
||||
*/
|
||||
@@ -118,26 +118,26 @@ trait CategoryIntegrationGroups {
|
||||
public function customizer(\WP_Customize_Manager $wp_customize): void {
|
||||
$wp_customize->add_setting('blogname', ['default' => get_bloginfo('name'), 'type' => 'option']);
|
||||
|
||||
$wp_customize->add_setting('aksrt_logo', [
|
||||
$wp_customize->add_setting('jio_logo', [
|
||||
'default' => '',
|
||||
'sanitize_callback' => 'esc_url_raw',
|
||||
'transport' => 'postMessage',
|
||||
]);
|
||||
$wp_customize->add_control(new \WP_Customize_Image_Control(
|
||||
$wp_customize,
|
||||
'aksrt_logo',
|
||||
['label' => __('Logo', 'aksrt'), 'section' => 'title_tagline']
|
||||
'jio_logo',
|
||||
['label' => __('Logo', 'jio'), 'section' => 'title_tagline']
|
||||
));
|
||||
|
||||
$wp_customize->add_setting('aksrt_favicon', [
|
||||
$wp_customize->add_setting('jio_favicon', [
|
||||
'default' => '',
|
||||
'sanitize_callback' => 'esc_url_raw',
|
||||
'transport' => 'postMessage',
|
||||
]);
|
||||
$wp_customize->add_control(new \WP_Customize_Upload_Control(
|
||||
$wp_customize,
|
||||
'aksrt_favicon',
|
||||
['label' => __('Favicon', 'aksrt'), 'section' => 'title_tagline']
|
||||
'jio_favicon',
|
||||
['label' => __('Favicon', 'jio'), 'section' => 'title_tagline']
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -16,7 +16,7 @@ class CategoryRuntime {
|
||||
public static function get_category_recommend_settings(): array {
|
||||
$defaults = [
|
||||
'enable_category_recommend' => false,
|
||||
'category_recommend_title' => __('分类推荐', 'aksrt'),
|
||||
'category_recommend_title' => __('分类推荐', 'jio'),
|
||||
'category_recommend_category_ids' => [],
|
||||
'category_recommend_posts_per_category' => 5,
|
||||
'category_recommend_columns' => 2,
|
||||
@@ -24,7 +24,7 @@ class CategoryRuntime {
|
||||
'category_recommend_show_dates' => true,
|
||||
'category_recommend_show_more_link' => true,
|
||||
];
|
||||
$saved = get_option('aksrt_category_recommend', []);
|
||||
$saved = get_option('jio_category_recommend', []);
|
||||
return array_merge($defaults, $saved);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class CategoryRuntime {
|
||||
* 获取分类封面图 URL(带优先级回退)
|
||||
*
|
||||
* 优先级:
|
||||
* 1. aksrt_category_cover_id term meta
|
||||
* 1. jio_category_cover_id term meta
|
||||
* 2. 该分类最新一篇有缩略图文章的缩略图
|
||||
* 3. 默认占位图
|
||||
*
|
||||
@@ -40,7 +40,7 @@ class CategoryRuntime {
|
||||
* @return string
|
||||
*/
|
||||
public static function get_category_cover_url(int $term_id): string {
|
||||
$cover_id = (int) get_term_meta($term_id, 'aksrt_category_cover_id', true);
|
||||
$cover_id = (int) get_term_meta($term_id, 'jio_category_cover_id', true);
|
||||
if ($cover_id > 0) {
|
||||
$url = wp_get_attachment_url($cover_id);
|
||||
if ($url) {
|
||||
@@ -77,7 +77,7 @@ class CategoryRuntime {
|
||||
* 获取分类推荐描述(带优先级回退)
|
||||
*
|
||||
* 优先级:
|
||||
* 1. aksrt_category_recommend_desc term meta
|
||||
* 1. jio_category_recommend_desc term meta
|
||||
* 2. 原生 category description
|
||||
* 3. 空字符串
|
||||
*
|
||||
@@ -85,7 +85,7 @@ class CategoryRuntime {
|
||||
* @return string
|
||||
*/
|
||||
public static function get_category_recommend_desc(int $term_id): string {
|
||||
$description = (string) get_term_meta($term_id, 'aksrt_category_recommend_desc', true);
|
||||
$description = (string) get_term_meta($term_id, 'jio_category_recommend_desc', true);
|
||||
if ($description !== '') {
|
||||
return $description;
|
||||
}
|
||||
@@ -102,13 +102,13 @@ class CategoryRuntime {
|
||||
* 清理分类推荐缓存
|
||||
*/
|
||||
public static function flush_category_recommend_cache(): void {
|
||||
$keys = get_option('aksrt_category_recommend_cache_keys', []);
|
||||
$keys = get_option('jio_category_recommend_cache_keys', []);
|
||||
if (is_array($keys)) {
|
||||
foreach ($keys as $key) {
|
||||
delete_transient($key);
|
||||
}
|
||||
}
|
||||
delete_option('aksrt_category_recommend_cache_keys');
|
||||
delete_option('jio_category_recommend_cache_keys');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -129,7 +129,7 @@ class CategoryRuntime {
|
||||
$show_dates = !empty($settings['category_recommend_show_dates']);
|
||||
$show_more = !empty($settings['category_recommend_show_more_link']);
|
||||
|
||||
$cache_key = 'aksrt_cr_' . md5(implode(',', $category_ids) . '|' . $per_page . '|' . (int) $show_desc . '|' . (int) $show_dates . '|' . (int) $show_more);
|
||||
$cache_key = 'jio_cr_' . md5(implode(',', $category_ids) . '|' . $per_page . '|' . (int) $show_desc . '|' . (int) $show_dates . '|' . (int) $show_more);
|
||||
$cached = get_transient($cache_key);
|
||||
if ($cached !== false) {
|
||||
return $cached;
|
||||
@@ -174,12 +174,12 @@ class CategoryRuntime {
|
||||
|
||||
set_transient($cache_key, $items, 12 * HOUR_IN_SECONDS);
|
||||
|
||||
$keys = get_option('aksrt_category_recommend_cache_keys', []);
|
||||
$keys = get_option('jio_category_recommend_cache_keys', []);
|
||||
if (!is_array($keys)) {
|
||||
$keys = [];
|
||||
}
|
||||
$keys[] = $cache_key;
|
||||
update_option('aksrt_category_recommend_cache_keys', array_unique($keys));
|
||||
update_option('jio_category_recommend_cache_keys', array_unique($keys));
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -49,7 +49,7 @@ class CreditsRuntime {
|
||||
|
||||
'download_default_cost' => 0,
|
||||
];
|
||||
$saved = get_option('aksrt_credit_settings', []);
|
||||
$saved = get_option('jio_credit_settings', []);
|
||||
if (!is_array($saved)) {
|
||||
$saved = [];
|
||||
}
|
||||
@@ -134,11 +134,11 @@ class CreditsRuntime {
|
||||
}
|
||||
$open_desc = trim((string) ($all['invit_code_open_desc'] ?? ''));
|
||||
if ($open_desc === '') {
|
||||
$open_desc = __('如您受到邀请,可填写推广码。部分推广码会有额外积分赠送', 'aksrt');
|
||||
$open_desc = __('如您受到邀请,可填写推广码。部分推广码会有额外积分赠送', 'jio');
|
||||
}
|
||||
$required_desc = trim((string) ($all['invit_code_must_desc'] ?? ''));
|
||||
if ($required_desc === '') {
|
||||
$required_desc = __('<div>本站需使用推广码注册</div><div>获取推广码请与客服联系</div>', 'aksrt');
|
||||
$required_desc = __('<div>本站需使用推广码注册</div><div>获取推广码请与客服联系</div>', 'jio');
|
||||
}
|
||||
|
||||
return [
|
||||
@@ -161,11 +161,11 @@ class CreditsRuntime {
|
||||
}
|
||||
$open_desc = trim((string) ($all['invite_code_open_desc'] ?? ''));
|
||||
if ($open_desc === '') {
|
||||
$open_desc = __('请输入邀请码,注册成功后奖励将自动发放', 'aksrt');
|
||||
$open_desc = __('请输入邀请码,注册成功后奖励将自动发放', 'jio');
|
||||
}
|
||||
$required_desc = trim((string) ($all['invite_code_must_desc'] ?? ''));
|
||||
if ($required_desc === '') {
|
||||
$required_desc = __('<div>本站需凭邀请码注册</div><div>获取邀请码请与客服联系</div>', 'aksrt');
|
||||
$required_desc = __('<div>本站需凭邀请码注册</div><div>获取邀请码请与客服联系</div>', 'jio');
|
||||
}
|
||||
|
||||
return [
|
||||
@@ -191,7 +191,7 @@ class CreditsRuntime {
|
||||
public static function get_currency_name(): string {
|
||||
$config = self::get_credit_settings();
|
||||
$name = trim((string) ($config['currency_name'] ?? ''));
|
||||
return $name !== '' ? $name : __('积分', 'aksrt');
|
||||
return $name !== '' ? $name : __('积分', 'jio');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
trait DisplayPageGroups {
|
||||
|
||||
/**
|
||||
* 获取 SEO 设置(从 aksrt_settings 读取)
|
||||
* 获取 SEO 设置(从 jio_settings 读取)
|
||||
*/
|
||||
public static function get_seo_settings(): array {
|
||||
$s = self::get_all();
|
||||
@@ -77,7 +77,7 @@ trait DisplayPageGroups {
|
||||
'slides' => is_array($s['header_slider'] ?? null) ? $s['header_slider'] : self::header_slider_default_slides(),
|
||||
'show_on_pages' => $show_on,
|
||||
'show_type' => $show_type,
|
||||
'nav_color' => \AKSRT\Core\Color::sanitize((string) ($s['header_slider_nav_color'] ?? '')) ?: '',
|
||||
'nav_color' => \Jio\Core\Color::sanitize((string) ($s['header_slider_nav_color'] ?? '')) ?: '',
|
||||
'slider_config' => $slider_option,
|
||||
'search_show' => self::sanitize_device_visibility($s['header_slider_search_s'] ?? ['pc_s', 'm_s']),
|
||||
'search_config' => $search_option,
|
||||
@@ -89,7 +89,7 @@ trait DisplayPageGroups {
|
||||
|
||||
/** @return list<array<string,mixed>> */
|
||||
private static function header_slider_default_slides(): array {
|
||||
$base = defined('AKSRT_URI') ? trailingslashit(AKSRT_URI) . 'assets/img/' : '';
|
||||
$base = defined('JIO_URI') ? trailingslashit(JIO_URI) . 'assets/img/' : '';
|
||||
$slides = [];
|
||||
foreach (['slider-bg.jpg', 'user_t.jpg'] as $image) {
|
||||
$slides[] = [
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -11,7 +11,7 @@ class DisplayRuntime {
|
||||
|
||||
/** 获取友链列表 */
|
||||
public static function get_friend_links(): array {
|
||||
$links = get_option('aksrt_friend_links', []) ?: [];
|
||||
$links = get_option('jio_friend_links', []) ?: [];
|
||||
|
||||
return array_values(array_filter($links, static function ($link) {
|
||||
return !empty($link['active']);
|
||||
@@ -20,7 +20,7 @@ class DisplayRuntime {
|
||||
|
||||
/** 保存友链 */
|
||||
public static function save_friend_links(array $links): void {
|
||||
update_option('aksrt_friend_links', $links);
|
||||
update_option('jio_friend_links', $links);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -11,7 +11,7 @@ class ExtensionRuntime {
|
||||
|
||||
/** 获取审核配置 */
|
||||
public static function get_moderation(): array {
|
||||
return get_option('aksrt_moderation_config', [
|
||||
return get_option('jio_moderation_config', [
|
||||
'enabled' => false,
|
||||
'akismet_enabled' => false,
|
||||
'akismet_site_url' => '',
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -18,9 +18,9 @@ trait FacadeBulk {
|
||||
|
||||
return [
|
||||
'custom' => !empty($s['header_theme_custom']),
|
||||
'bg_custom' => \AKSRT\Core\Color::sanitize((string) ($s['header_theme_bg_custom'] ?? '')) ?: '',
|
||||
'bg_custom' => \Jio\Core\Color::sanitize((string) ($s['header_theme_bg_custom'] ?? '')) ?: '',
|
||||
'bg' => self::normalize_palette_hex((string) ($s['header_theme_bg'] ?? '')),
|
||||
'color_custom' => \AKSRT\Core\Color::sanitize((string) ($s['header_theme_color_custom'] ?? '')) ?: '',
|
||||
'color_custom' => \Jio\Core\Color::sanitize((string) ($s['header_theme_color_custom'] ?? '')) ?: '',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ trait FacadeBulk {
|
||||
'compatible_s' => !empty($settings['share_img_compatible_s']),
|
||||
'poster_img' => esc_url_raw((string) ($settings['share_img_byimg'] ?? get_template_directory_uri() . '/assets/img/slider-bg.jpg')),
|
||||
'poster_logo' => esc_url_raw((string) ($settings['share_logo'] ?? get_template_directory_uri() . '/assets/img/logo.png')),
|
||||
'share_desc' => sanitize_text_field((string) ($settings['share_desc'] ?? '')) ?: __('扫一扫 立即查看', 'aksrt'),
|
||||
'share_desc' => sanitize_text_field((string) ($settings['share_desc'] ?? '')) ?: __('扫一扫 立即查看', 'jio'),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ trait FacadeBulk {
|
||||
*/
|
||||
public static function get_post_page_settings(): array {
|
||||
// Canonical assembly lives in the post-display helper (related style/source split, aliases).
|
||||
if (class_exists('AKSRT\\Settings\\PostDisplay')) {
|
||||
if (class_exists('Jio\\Settings\\PostDisplay')) {
|
||||
return PostDisplay::get_post_page_settings();
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ trait FacadeBulk {
|
||||
return [
|
||||
'reading_progress' => true,
|
||||
'breadcrumbs' => !isset($settings['breadcrumbs_single_s']) || !empty($settings['breadcrumbs_single_s']),
|
||||
'breadcrumbs_home' => $breadcrumbs_home_replace ? __('首页', 'aksrt') : (string) get_bloginfo('name'),
|
||||
'breadcrumbs_home' => $breadcrumbs_home_replace ? __('首页', 'jio') : (string) get_bloginfo('name'),
|
||||
'breadcrumbs_home_replace' => $breadcrumbs_home_replace,
|
||||
'p_indent' => !empty($settings['post_p_indent_s']),
|
||||
'article_image_cover' => !isset($settings['article_image_cover']) || !empty($settings['article_image_cover']),
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
*
|
||||
* 结构对齐参考主题 float_btn(sortable,固定类型,数组顺序即显示顺序)。
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
class FloatButtons {
|
||||
|
||||
public const OPTION = 'aksrt_floating_buttons';
|
||||
public const OPTION = 'jio_floating_buttons';
|
||||
|
||||
/** 固定按钮类型(默认显示顺序)。 */
|
||||
public const TYPES = ['more', 'pay_vip', 'add', 'service_qq', 'service_wechat', 'theme_mode', 'qrcode', 'back_top'];
|
||||
@@ -39,7 +39,7 @@ class FloatButtons {
|
||||
['type' => 'service_qq', 'pc_s' => false, 'm_s' => false, 'color' => $empty_color, 'qq' => ''],
|
||||
['type' => 'service_wechat', 'pc_s' => true, 'm_s' => true, 'color' => $empty_color, 'wechat_img' => ''],
|
||||
['type' => 'theme_mode', 'pc_s' => false, 'm_s' => false, 'color' => $empty_color],
|
||||
['type' => 'qrcode', 'pc_s' => true, 'm_s' => false, 'color' => $empty_color, 'desc' => __('在手机上浏览此页面', 'aksrt')],
|
||||
['type' => 'qrcode', 'pc_s' => true, 'm_s' => false, 'color' => $empty_color, 'desc' => __('在手机上浏览此页面', 'jio')],
|
||||
['type' => 'back_top', 'pc_s' => true, 'm_s' => true, 'color' => $empty_color],
|
||||
],
|
||||
];
|
||||
@@ -176,7 +176,7 @@ class FloatButtons {
|
||||
|
||||
switch ($type) {
|
||||
case 'add':
|
||||
$out['icon'] = aksrt_sanitize_icon_value((string) ($item['icon'] ?? ''));
|
||||
$out['icon'] = jio_sanitize_icon_value((string) ($item['icon'] ?? ''));
|
||||
break;
|
||||
case 'service_qq':
|
||||
$out['qq'] = (string) preg_replace('/\D+/', '', (string) ($item['qq'] ?? ''));
|
||||
@@ -198,7 +198,7 @@ class FloatButtons {
|
||||
|
||||
return [
|
||||
'desc' => sanitize_text_field((string) ($button['desc'] ?? '')),
|
||||
'icon' => aksrt_sanitize_icon_value((string) ($button['icon'] ?? '')),
|
||||
'icon' => jio_sanitize_icon_value((string) ($button['icon'] ?? '')),
|
||||
'link' => [
|
||||
'url' => esc_url_raw((string) ($link['url'] ?? '')),
|
||||
'target' => $target === '_blank' ? '_blank' : '',
|
||||
@@ -218,8 +218,8 @@ class FloatButtons {
|
||||
private static function sanitize_color_group($group): array {
|
||||
$group = is_array($group) ? $group : [];
|
||||
return [
|
||||
'color' => \AKSRT\Core\Color::sanitize($group['color'] ?? '', true),
|
||||
'bg' => \AKSRT\Core\Color::sanitize($group['bg'] ?? '', true),
|
||||
'color' => \Jio\Core\Color::sanitize($group['color'] ?? '', true),
|
||||
'bg' => \Jio\Core\Color::sanitize($group['bg'] ?? '', true),
|
||||
];
|
||||
}
|
||||
}
|
||||
+11
-11
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -61,9 +61,9 @@ class HomeCms {
|
||||
$s = self::get_footer_settings();
|
||||
return [
|
||||
'custom' => !empty($s['footer_theme_custom']),
|
||||
'bg_custom' => \AKSRT\Core\Color::sanitize((string) ($s['footer_theme_bg_custom'] ?? '')) ?: '',
|
||||
'bg_custom' => \Jio\Core\Color::sanitize((string) ($s['footer_theme_bg_custom'] ?? '')) ?: '',
|
||||
'bg' => self::normalize_palette_hex((string) ($s['footer_theme_bg'] ?? '')),
|
||||
'color_custom' => \AKSRT\Core\Color::sanitize((string) ($s['footer_theme_color_custom'] ?? '')) ?: '',
|
||||
'color_custom' => \Jio\Core\Color::sanitize((string) ($s['footer_theme_color_custom'] ?? '')) ?: '',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -92,13 +92,13 @@ class HomeCms {
|
||||
|
||||
public static function homepage_sort_labels(): array {
|
||||
return [
|
||||
'modified' => __('更新', 'aksrt'),
|
||||
'date' => __('发布', 'aksrt'),
|
||||
'views' => __('浏览', 'aksrt'),
|
||||
'like' => __('点赞', 'aksrt'),
|
||||
'comment_count' => __('评论', 'aksrt'),
|
||||
'favorite' => __('收藏', 'aksrt'),
|
||||
'rand' => __('随机', 'aksrt'),
|
||||
'modified' => __('更新', 'jio'),
|
||||
'date' => __('发布', 'jio'),
|
||||
'views' => __('浏览', 'jio'),
|
||||
'like' => __('点赞', 'jio'),
|
||||
'comment_count' => __('评论', 'jio'),
|
||||
'favorite' => __('收藏', 'jio'),
|
||||
'rand' => __('随机', 'jio'),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -58,7 +58,7 @@ class Integration {
|
||||
'id' => 'tab_home',
|
||||
'type' => 'home',
|
||||
'icon' => 'fa fas fa-home',
|
||||
'text' => __('首页', 'aksrt'),
|
||||
'text' => __('首页', 'jio'),
|
||||
'link' => '',
|
||||
'badge' => '',
|
||||
'badge_mode' => 'static',
|
||||
@@ -72,7 +72,7 @@ class Integration {
|
||||
'id' => 'tab_category',
|
||||
'type' => 'category',
|
||||
'icon' => 'fa fas fa-th-large',
|
||||
'text' => __('分类', 'aksrt'),
|
||||
'text' => __('分类', 'jio'),
|
||||
'link' => '',
|
||||
'badge' => '',
|
||||
'badge_mode' => 'static',
|
||||
@@ -85,7 +85,7 @@ class Integration {
|
||||
'id' => 'tab_search',
|
||||
'type' => 'search',
|
||||
'icon' => 'fa fas fa-search',
|
||||
'text' => __('搜索', 'aksrt'),
|
||||
'text' => __('搜索', 'jio'),
|
||||
'link' => '',
|
||||
'badge' => '',
|
||||
'badge_mode' => 'dynamic',
|
||||
@@ -99,7 +99,7 @@ class Integration {
|
||||
'id' => 'tab_auth',
|
||||
'type' => 'auth',
|
||||
'icon' => 'fa fas fa-user',
|
||||
'text' => __('我的', 'aksrt'),
|
||||
'text' => __('我的', 'jio'),
|
||||
'link' => '',
|
||||
'badge' => '',
|
||||
'badge_mode' => 'dynamic',
|
||||
@@ -111,7 +111,7 @@ class Integration {
|
||||
],
|
||||
],
|
||||
];
|
||||
$saved = get_option('aksrt_footer_tabbar', []);
|
||||
$saved = get_option('jio_footer_tabbar', []);
|
||||
if (!is_array($saved)) {
|
||||
$saved = [];
|
||||
}
|
||||
@@ -163,7 +163,7 @@ class Integration {
|
||||
'unread_retention_days' => 180,
|
||||
'max_per_user' => 200,
|
||||
];
|
||||
$saved = get_option('aksrt_notification_settings', []);
|
||||
$saved = get_option('jio_notification_settings', []);
|
||||
if (!is_array($saved)) {
|
||||
$saved = [];
|
||||
}
|
||||
@@ -272,7 +272,7 @@ class Integration {
|
||||
* @return array{enabled:bool,app_id:string,app_secret:string,template_id:string}
|
||||
*/
|
||||
public static function get_wechat_settings(): array {
|
||||
$stored = get_option('aksrt_wechat_settings', []);
|
||||
$stored = get_option('jio_wechat_settings', []);
|
||||
if (!is_array($stored)) {
|
||||
$stored = [];
|
||||
}
|
||||
@@ -298,7 +298,7 @@ class Integration {
|
||||
$clean[$key] = $settings[$key];
|
||||
}
|
||||
}
|
||||
update_option('aksrt_wechat_settings', $clean);
|
||||
update_option('jio_wechat_settings', $clean);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* Canonical email settings and delivery service.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -46,7 +46,7 @@ final class Mail {
|
||||
public static function send_test_email(string $to): bool|\WP_Error {
|
||||
$to = sanitize_email($to);
|
||||
if ($to === '' || !is_email($to)) {
|
||||
return new \WP_Error('aksrt_invalid_test_email', __('请输入有效的邮箱地址', 'aksrt'));
|
||||
return new \WP_Error('jio_invalid_test_email', __('请输入有效的邮箱地址', 'jio'));
|
||||
}
|
||||
|
||||
$failure = null;
|
||||
@@ -75,7 +75,7 @@ final class Mail {
|
||||
|
||||
$error = $failure instanceof \WP_Error
|
||||
? $failure
|
||||
: new \WP_Error('aksrt_mail_failed', __('wp_mail 返回失败,但未提供详细错误。', 'aksrt'));
|
||||
: new \WP_Error('jio_mail_failed', __('wp_mail 返回失败,但未提供详细错误。', 'jio'));
|
||||
self::log_test_failure($error);
|
||||
return $error;
|
||||
}
|
||||
@@ -117,12 +117,12 @@ final class Mail {
|
||||
$message = preg_replace('/\b(?:[a-z0-9-]+\.)+[a-z]{2,}\b/i', '[host]', (string) $message);
|
||||
$message = preg_replace('/\b(?:\d{1,3}\.){3}\d{1,3}\b/', '[ip]', (string) $message);
|
||||
$message = preg_replace('/\b(?:password|passwd|username|user|login|credential)\s*[:=]\s*[^\s,;]+/i', '$1=[redacted]', (string) $message);
|
||||
error_log('[AKSRT] SMTP 测试失败:' . substr((string) $message, 0, 500));
|
||||
error_log('[Jio] SMTP 测试失败:' . substr((string) $message, 0, 500));
|
||||
}
|
||||
|
||||
private static function wrap_html(string $content, array $global): string {
|
||||
$logo = method_exists(Settings::class, 'logo_url') ? Settings::logo_url() : '';
|
||||
$background = esc_url(AKSRT_URI . '/assets/img/mail-bg.png');
|
||||
$background = esc_url(JIO_URI . '/assets/img/mail-bg.png');
|
||||
$body = preg_match('/<[^>]+>/', $content) ? wp_kses_post($content) : nl2br(esc_html($content));
|
||||
$description = esc_html((string) ($global['description'] ?? ''));
|
||||
$more = wp_kses_post((string) ($global['more_content'] ?? ''));
|
||||
|
||||
@@ -2,31 +2,31 @@
|
||||
/**
|
||||
* Registers all non-forum email notifications.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
final class MailNotifications {
|
||||
public static function init(): void {
|
||||
add_action('aksrt_order_paid', [self::class, 'order_paid'], 20, 2);
|
||||
add_action('aksrt_order_status_changed', [self::class, 'order_status'], 20, 3);
|
||||
add_action('aksrt_asset_transaction_committed', [self::class, 'asset_transaction'], 20, 2);
|
||||
add_action('aksrt_notification_sent', [self::class, 'notification'], 20, 3);
|
||||
add_action('aksrt_withdrawal_submitted', [self::class, 'withdrawal_submitted'], 20, 2);
|
||||
add_action('aksrt_withdrawal_status_changed', [self::class, 'withdrawal_status'], 20, 4);
|
||||
add_action('aksrt_ban_appeal_submitted', [self::class, 'ban_appeal_submitted'], 20, 2);
|
||||
add_action('aksrt_ban_appeal_processed', [self::class, 'ban_appeal_processed'], 20, 3);
|
||||
add_action('aksrt_new_posts_pending', [self::class, 'post_pending'], 20, 1);
|
||||
add_action('jio_order_paid', [self::class, 'order_paid'], 20, 2);
|
||||
add_action('jio_order_status_changed', [self::class, 'order_status'], 20, 3);
|
||||
add_action('jio_asset_transaction_committed', [self::class, 'asset_transaction'], 20, 2);
|
||||
add_action('jio_notification_sent', [self::class, 'notification'], 20, 3);
|
||||
add_action('jio_withdrawal_submitted', [self::class, 'withdrawal_submitted'], 20, 2);
|
||||
add_action('jio_withdrawal_status_changed', [self::class, 'withdrawal_status'], 20, 4);
|
||||
add_action('jio_ban_appeal_submitted', [self::class, 'ban_appeal_submitted'], 20, 2);
|
||||
add_action('jio_ban_appeal_processed', [self::class, 'ban_appeal_processed'], 20, 3);
|
||||
add_action('jio_new_posts_pending', [self::class, 'post_pending'], 20, 1);
|
||||
add_action('transition_post_status', [self::class, 'post_status_changed'], 20, 3);
|
||||
add_action('aksrt_report_submitted', [self::class, 'report_submitted'], 20, 2);
|
||||
add_action('aksrt_report_status_changed', [self::class, 'report_status_changed'], 20, 4);
|
||||
add_action('aksrt_friend_link_submitted', [self::class, 'friend_link_submitted'], 20, 1);
|
||||
add_action('aksrt_user_phone_changed', [self::class, 'phone_changed'], 20, 2);
|
||||
add_action('aksrt_user_restriction_changed', [self::class, 'restriction_changed'], 20, 4);
|
||||
add_action('aksrt_ticket_urged', [self::class, 'ticket_urged'], 20, 1);
|
||||
add_action('jio_report_submitted', [self::class, 'report_submitted'], 20, 2);
|
||||
add_action('jio_report_status_changed', [self::class, 'report_status_changed'], 20, 4);
|
||||
add_action('jio_friend_link_submitted', [self::class, 'friend_link_submitted'], 20, 1);
|
||||
add_action('jio_user_phone_changed', [self::class, 'phone_changed'], 20, 2);
|
||||
add_action('jio_user_restriction_changed', [self::class, 'restriction_changed'], 20, 4);
|
||||
add_action('jio_ticket_urged', [self::class, 'ticket_urged'], 20, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -40,7 +40,7 @@ final class MailNotifications {
|
||||
'count' => (int) ($ticket['urge_count'] ?? 0),
|
||||
'ticket_num' => (string) ($ticket['ticket_num'] ?? ''),
|
||||
'title' => (string) ($ticket['title'] ?? ''),
|
||||
'url' => admin_url('users.php?page=aksrt_tickets&id=' . (int) ($ticket['id'] ?? 0)),
|
||||
'url' => admin_url('users.php?page=jio_tickets&id=' . (int) ($ticket['id'] ?? 0)),
|
||||
];
|
||||
$assignee = get_userdata((int) ($ticket['admin_id'] ?? 0));
|
||||
if ($assignee instanceof \WP_User && is_email($assignee->user_email)) {
|
||||
@@ -55,7 +55,7 @@ final class MailNotifications {
|
||||
if (!$user instanceof \WP_User) return;
|
||||
self::send('user_ban', $user->user_email, [
|
||||
'username' => $user->display_name,
|
||||
'status' => $action === 'removed' ? __('限制已解除', 'aksrt') : $type,
|
||||
'status' => $action === 'removed' ? __('限制已解除', 'jio') : $type,
|
||||
'note' => $reason,
|
||||
]);
|
||||
}
|
||||
@@ -107,7 +107,7 @@ final class MailNotifications {
|
||||
}
|
||||
|
||||
public static function asset_transaction($result, $command): void {
|
||||
if (!$result instanceof \AKSRT\Ledger\LedgerResult || !$command instanceof \AKSRT\Ledger\LedgerCommand || $result->replayed) return;
|
||||
if (!$result instanceof \Jio\Ledger\LedgerResult || !$command instanceof \Jio\Ledger\LedgerCommand || $result->replayed) return;
|
||||
$reason = $command->reason;
|
||||
if (!in_array($reason, ['affiliate_commission', 'creator_income', 'transfer', 'tip', 'referral'], true)) return;
|
||||
foreach ($result->entries as $entry) {
|
||||
@@ -115,7 +115,7 @@ final class MailNotifications {
|
||||
$user = get_userdata((int) ($entry['user_id'] ?? 0));
|
||||
if (!$user instanceof \WP_User) continue;
|
||||
$amount = self::minor_amount((string) ($entry['asset'] ?? 'balance'), (int) $entry['delta_minor']);
|
||||
$url = function_exists('aksrt_get_user_center_url') ? aksrt_get_user_center_url('credits') : home_url('/');
|
||||
$url = function_exists('jio_get_user_center_url') ? jio_get_user_center_url('credits') : home_url('/');
|
||||
if ($reason === 'affiliate_commission') {
|
||||
self::send('affiliate_commission', $user->user_email, ['username' => $user->display_name, 'amount' => $amount, 'order_number' => $command->ref_key, 'url' => $url]);
|
||||
} elseif ($reason === 'creator_income') {
|
||||
@@ -126,8 +126,8 @@ final class MailNotifications {
|
||||
$sender = get_userdata((int) ($entry['counterparty_user_id'] ?? 0));
|
||||
self::send('transfer_received', $user->user_email, [
|
||||
'username' => $user->display_name,
|
||||
'sender' => $sender instanceof \WP_User ? $sender->display_name : __('其他用户', 'aksrt'),
|
||||
'asset' => ((string) ($entry['asset'] ?? '') === 'points') ? __('积分', 'aksrt') : __('余额', 'aksrt'),
|
||||
'sender' => $sender instanceof \WP_User ? $sender->display_name : __('其他用户', 'jio'),
|
||||
'asset' => ((string) ($entry['asset'] ?? '') === 'points') ? __('积分', 'jio') : __('余额', 'jio'),
|
||||
'amount' => $amount,
|
||||
'note' => (string) ($entry['remark'] ?? ''),
|
||||
'url' => $url,
|
||||
@@ -155,19 +155,19 @@ final class MailNotifications {
|
||||
public static function auth_submitted(int $user_id, array $application): void {
|
||||
$user = get_userdata($user_id);
|
||||
self::send_admin('auth_apply_admin', [
|
||||
'username' => $user instanceof \WP_User ? $user->display_name : (string) ($application['public_name'] ?? __('用户', 'aksrt')),
|
||||
'url' => admin_url('users.php?page=aksrt_users_verify'),
|
||||
'username' => $user instanceof \WP_User ? $user->display_name : (string) ($application['public_name'] ?? __('用户', 'jio')),
|
||||
'url' => admin_url('users.php?page=jio_users_verify'),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function auth_reviewed(int $user_id, string $status, string $note, int $reviewer_id): void {
|
||||
$user = get_userdata($user_id);
|
||||
if ($user instanceof \WP_User) self::send('auth_apply_result', $user->user_email, ['username' => $user->display_name, 'status' => $status, 'note' => $note, 'url' => function_exists('aksrt_get_user_center_tab_url') ? aksrt_get_user_center_tab_url('auth') : home_url('/')]);
|
||||
if ($user instanceof \WP_User) self::send('auth_apply_result', $user->user_email, ['username' => $user->display_name, 'status' => $status, 'note' => $note, 'url' => function_exists('jio_get_user_center_tab_url') ? jio_get_user_center_tab_url('auth') : home_url('/')]);
|
||||
}
|
||||
|
||||
public static function ban_appeal_submitted(int $user_id, array $payload): void {
|
||||
$user = get_userdata($user_id);
|
||||
if ($user instanceof \WP_User) self::send_admin('ban_appeal_admin', ['username' => $user->display_name, 'url' => admin_url('users.php?page=aksrt_user_ban&type=appeal&status=pending')]);
|
||||
if ($user instanceof \WP_User) self::send_admin('ban_appeal_admin', ['username' => $user->display_name, 'url' => admin_url('users.php?page=jio_user_ban&type=appeal&status=pending')]);
|
||||
}
|
||||
|
||||
public static function ban_appeal_processed(int $user_id, string $decision, string $note): void {
|
||||
@@ -196,7 +196,7 @@ final class MailNotifications {
|
||||
|
||||
public static function report_submitted(int $report_id, array $report): void {
|
||||
$reporter = get_userdata((int) ($report['reporter_id'] ?? 0));
|
||||
self::send_admin('report_admin', ['username' => $reporter instanceof \WP_User ? $reporter->display_name : __('用户', 'aksrt'), 'title' => (string) ($report['target_type'] ?? ''), 'url' => admin_url('users.php?page=aksrt_user_ban')]);
|
||||
self::send_admin('report_admin', ['username' => $reporter instanceof \WP_User ? $reporter->display_name : __('用户', 'jio'), 'title' => (string) ($report['target_type'] ?? ''), 'url' => admin_url('users.php?page=jio_user_ban')]);
|
||||
}
|
||||
|
||||
public static function report_status_changed(int $report_id, int $reporter_id, string $status, string $note = ''): void {
|
||||
@@ -206,21 +206,21 @@ final class MailNotifications {
|
||||
}
|
||||
// 状态值中文化后进入邮件;处理说明来自后台“处理说明”输入(钩子第 4 参)。
|
||||
$labels = [
|
||||
'pending' => __('待处理', 'aksrt'),
|
||||
'reviewing' => __('审核中', 'aksrt'),
|
||||
'resolved' => __('已解决', 'aksrt'),
|
||||
'dismissed' => __('已驳回', 'aksrt'),
|
||||
'pending' => __('待处理', 'jio'),
|
||||
'reviewing' => __('审核中', 'jio'),
|
||||
'resolved' => __('已解决', 'jio'),
|
||||
'dismissed' => __('已驳回', 'jio'),
|
||||
];
|
||||
self::send('report_result', $reporter->user_email, [
|
||||
'username' => $reporter->display_name,
|
||||
'status' => $labels[$status] ?? $status,
|
||||
'note' => $note !== '' ? $note : __('—', 'aksrt'),
|
||||
'note' => $note !== '' ? $note : __('—', 'jio'),
|
||||
'url' => home_url('/'),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function friend_link_submitted(array $link): void {
|
||||
self::send_admin('links_submit_admin', ['title' => (string) ($link['name'] ?? ''), 'username' => __('访客', 'aksrt'), 'url' => (string) ($link['url'] ?? '')]);
|
||||
self::send_admin('links_submit_admin', ['title' => (string) ($link['name'] ?? ''), 'username' => __('访客', 'jio'), 'url' => (string) ($link['url'] ?? '')]);
|
||||
}
|
||||
|
||||
/** @param array<string,mixed> $vars */
|
||||
@@ -248,7 +248,7 @@ final class MailNotifications {
|
||||
/** @return array<string,string> */
|
||||
private static function order_vars(string $order_number, array $order, \WP_User $user): array {
|
||||
$product = (string) ($order['product_type'] ?? 'order');
|
||||
return ['username' => $user->display_name, 'order_number' => $order_number, 'product' => $product, 'amount' => (string) ($order['amount'] ?? ''), 'currency' => (string) ($order['currency'] ?? 'CNY'), 'payment_method' => (string) ($order['payment_method'] ?? ''), 'url' => function_exists('aksrt_get_user_center_url') ? aksrt_get_user_center_url('orders') : home_url('/')];
|
||||
return ['username' => $user->display_name, 'order_number' => $order_number, 'product' => $product, 'amount' => (string) ($order['amount'] ?? ''), 'currency' => (string) ($order['currency'] ?? 'CNY'), 'payment_method' => (string) ($order['payment_method'] ?? ''), 'url' => function_exists('jio_get_user_center_url') ? jio_get_user_center_url('orders') : home_url('/')];
|
||||
}
|
||||
|
||||
private static function minor_amount(string $asset, int $minor): string {
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
/**
|
||||
* Canonical email event catalog and admin schema.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -104,7 +104,7 @@ final class MailTemplates {
|
||||
['key' => 'email_test_to', 'label' => '测试收件地址', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'email_test_send', 'label' => '发送测试邮件', 'type' => 'button', 'buttonType' => 'primary', 'buttonText' => '发送测试邮件', 'ui_only' => true],
|
||||
]];
|
||||
return ['key' => 'email', 'title' => '邮件事件与 SMTP', 'version' => '3.0.0', 'option_key' => 'aksrt_settings', 'groups' => $groups];
|
||||
return ['key' => 'email', 'title' => '邮件事件与 SMTP', 'version' => '3.0.0', 'option_key' => 'jio_settings', 'groups' => $groups];
|
||||
}
|
||||
|
||||
/** @return array<string, mixed> */
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -32,7 +32,7 @@ class PaymentRuntime {
|
||||
'vip_free_download' => false,
|
||||
'vip_exempt_roles' => [],
|
||||
'catalog_note' => '',
|
||||
'manual_delivery_note' => __('付费或人工确认内容请在订单备注中记录交付方式。', 'aksrt'),
|
||||
'manual_delivery_note' => __('付费或人工确认内容请在订单备注中记录交付方式。', 'jio'),
|
||||
'no_logged_in' => !isset($settings['pay_no_logged_in']) || !empty($settings['pay_no_logged_in']),
|
||||
'free_logged_show' => !isset($settings['pay_free_logged_show']) || !empty($settings['pay_free_logged_show']),
|
||||
'down_alone_page' => !empty($settings['down_alone_page']),
|
||||
@@ -93,7 +93,7 @@ class PaymentRuntime {
|
||||
'desc' => $desc,
|
||||
'packages_raw' => $packages,
|
||||
'package_count' => self::count_structured_lines($packages),
|
||||
'help_text' => $desc !== '' ? $desc : __('当前支持人工确认与测试联调;接入真实网关时复用同一组字段。', 'aksrt'),
|
||||
'help_text' => $desc !== '' ? $desc : __('当前支持人工确认与测试联调;接入真实网关时复用同一组字段。', 'jio'),
|
||||
'product' => [
|
||||
'name' => sanitize_text_field((string) ($settings['pay_balance_product_name'] ?? '')),
|
||||
'price' => self::money_decimal($settings['pay_balance_price'] ?? '0.00', '0.00'),
|
||||
@@ -151,8 +151,8 @@ class PaymentRuntime {
|
||||
}
|
||||
|
||||
$filename = 'vip-' . $level . '.svg';
|
||||
if (defined('AKSRT_DIR') && is_file(AKSRT_DIR . '/assets/img/user/vip/' . $filename)) {
|
||||
return defined('AKSRT_URI') ? AKSRT_URI . '/assets/img/user/vip/' . $filename : '';
|
||||
if (defined('JIO_DIR') && is_file(JIO_DIR . '/assets/img/user/vip/' . $filename)) {
|
||||
return defined('JIO_URI') ? JIO_URI . '/assets/img/user/vip/' . $filename : '';
|
||||
}
|
||||
|
||||
return '';
|
||||
@@ -175,22 +175,22 @@ class PaymentRuntime {
|
||||
$name1 = sanitize_text_field(wp_strip_all_tags($name1_html));
|
||||
$name2 = sanitize_text_field(wp_strip_all_tags($name2_html));
|
||||
if ($name1 === '') {
|
||||
$name1 = __('黄金会员', 'aksrt');
|
||||
$name1 = __('黄金会员', 'jio');
|
||||
$name1_html = $name1;
|
||||
}
|
||||
if ($name2 === '') {
|
||||
$name2 = __('钻石会员', 'aksrt');
|
||||
$name2 = __('钻石会员', 'jio');
|
||||
$name2_html = $name2;
|
||||
}
|
||||
|
||||
$badge = $vip2_enabled ? $name2 : ($vip1_enabled ? $name1 : __('VIP', 'aksrt'));
|
||||
$badge = $vip2_enabled ? $name2 : ($vip1_enabled ? $name1 : __('VIP', 'jio'));
|
||||
|
||||
$renew_price_type = sanitize_key((string) ($settings['vip_renew_price_type'] ?? 'discount'));
|
||||
if (!in_array($renew_price_type, ['same', 'discount', 'reduce', 'customize'], true)) {
|
||||
$renew_price_type = 'discount';
|
||||
}
|
||||
|
||||
$desc = wp_kses_post((string) ($settings['pay_user_vip_desc'] ?? __('开通VIP会员,享受会员专属折扣以及多项特权', 'aksrt')));
|
||||
$desc = wp_kses_post((string) ($settings['pay_user_vip_desc'] ?? __('开通VIP会员,享受会员专属折扣以及多项特权', 'jio')));
|
||||
$more = (string) ($settings['pay_user_vip_more'] ?? '<div>购买后不支持退款</div><div>VIP权益仅适用于本站</div><div>欢迎与站长联系</div>');
|
||||
|
||||
return [
|
||||
@@ -208,7 +208,7 @@ class PaymentRuntime {
|
||||
'enabled' => $vip1_enabled,
|
||||
'name' => $name1,
|
||||
'name_html' => $name1_html,
|
||||
'desc' => wp_kses_post((string) ($settings['pay_user_vip_1_desc'] ?? __('尊享专属特权', 'aksrt'))),
|
||||
'desc' => wp_kses_post((string) ($settings['pay_user_vip_1_desc'] ?? __('尊享专属特权', 'jio'))),
|
||||
'equity' => wp_kses_post((string) (($settings['pay_user_vip_1_equity'] ?? '') !== '' ? $settings['pay_user_vip_1_equity'] : '<li>全站资源折扣购买</li><li>部分内容免费阅读</li><li>一对一技术指导</li><li>VIP用户专属QQ群</li>')),
|
||||
'img_icon' => self::get_vip_icon_url(1, (string) ($settings['vip_1_img_icon'] ?? '')),
|
||||
'product_s' => !isset($settings['vip_1_product_s']) || !empty($settings['vip_1_product_s']),
|
||||
@@ -220,7 +220,7 @@ class PaymentRuntime {
|
||||
'enabled' => $vip2_enabled,
|
||||
'name' => $name2,
|
||||
'name_html' => $name2_html,
|
||||
'desc' => wp_kses_post((string) ($settings['pay_user_vip_2_desc'] ?? __('尊享专属特权', 'aksrt'))),
|
||||
'desc' => wp_kses_post((string) ($settings['pay_user_vip_2_desc'] ?? __('尊享专属特权', 'jio'))),
|
||||
'equity' => wp_kses_post((string) (($settings['pay_user_vip_2_equity'] ?? '') !== '' ? $settings['pay_user_vip_2_equity'] : '<li>全站资源折扣购买</li><li>部分内容免费阅读</li><li>一对一技术指导</li><li>VIP用户专属QQ群</li>')),
|
||||
'img_icon' => self::get_vip_icon_url(2, (string) ($settings['vip_2_img_icon'] ?? '')),
|
||||
'product_s' => !isset($settings['vip_2_product_s']) || !empty($settings['vip_2_product_s']),
|
||||
@@ -273,7 +273,7 @@ class PaymentRuntime {
|
||||
'vip2' => $clamp_ratio($settings['payment_revenue_points_ratio_vip_2'] ?? 0),
|
||||
],
|
||||
],
|
||||
'note' => $note !== '' ? wp_kses_post($note) : __('<p>订单完成并经过结算周期后,作者分成会自动转入对应的钱包。</p>', 'aksrt'),
|
||||
'note' => $note !== '' ? wp_kses_post($note) : __('<p>订单完成并经过结算周期后,作者分成会自动转入对应的钱包。</p>', 'jio'),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -348,7 +348,7 @@ class PaymentRuntime {
|
||||
|
||||
public static function affiliate_enabled(): bool { return !empty(self::get_payment_affiliate_settings()['enabled']); }
|
||||
public static function affiliate_ratio_for_user(int $user_id): int {
|
||||
$level = function_exists('aksrt_get_user_vip_level') ? (int) aksrt_get_user_vip_level($user_id) : 0;
|
||||
$level = function_exists('jio_get_user_vip_level') ? (int) jio_get_user_vip_level($user_id) : 0;
|
||||
return self::affiliate_ratio_for_level($level);
|
||||
}
|
||||
public static function affiliate_ratio_for_level(int $level): int {
|
||||
@@ -384,7 +384,7 @@ class PaymentRuntime {
|
||||
|| !empty($settings['pay_vip_pass_charge_s']);
|
||||
|
||||
return [
|
||||
'help_text' => __('微信 / 支付宝可在官方与易支付之间选择;PayPal、Stripe 独立开关。异步回调由各网关验签。', 'aksrt'),
|
||||
'help_text' => __('微信 / 支付宝可在官方与易支付之间选择;PayPal、Stripe 独立开关。异步回调由各网关验签。', 'jio'),
|
||||
'wechat_sdk_options' => $wechat,
|
||||
'alipay_sdk_options' => $alipay,
|
||||
'paypal_enabled' => $paypal_enabled,
|
||||
@@ -416,7 +416,7 @@ class PaymentRuntime {
|
||||
}
|
||||
|
||||
/**
|
||||
* Order display / checkout policy (legacy pay_* + AKSRT order ops).
|
||||
* Order display / checkout policy (legacy pay_* + Jio order ops).
|
||||
*
|
||||
* @return array<string,mixed>
|
||||
*/
|
||||
@@ -585,7 +585,7 @@ class PaymentRuntime {
|
||||
if (!is_string($value)) {
|
||||
throw new \InvalidArgumentException('money_decimal_must_be_string');
|
||||
}
|
||||
$amount = \AKSRT\Ledger\AssetAmount::balance(trim($value));
|
||||
$amount = \Jio\Ledger\AssetAmount::balance(trim($value));
|
||||
return $amount->minor() <= $max_minor ? $amount->decimal() : $default;
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
return $default;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -150,11 +150,11 @@ class PostDisplay {
|
||||
public static function get_post_page_settings(): array {
|
||||
$settings = Settings::get_all();
|
||||
|
||||
// Canonical render keys (used by aksrt_single_*). Legacy *_s aliases kept for older callers.
|
||||
// Canonical render keys (used by jio_single_*). Legacy *_s aliases kept for older callers.
|
||||
$breadcrumbs = !isset($settings['breadcrumbs_single_s']) || !empty($settings['breadcrumbs_single_s']);
|
||||
// 参考主题语义:switcher 开 = 面包屑用“首页”替代网站名称。
|
||||
$breadcrumbs_home_replace = !isset($settings['breadcrumbs_home_text']) || !empty($settings['breadcrumbs_home_text']);
|
||||
$breadcrumbs_home = $breadcrumbs_home_replace ? __('首页', 'aksrt') : (string) get_bloginfo('name');
|
||||
$breadcrumbs_home = $breadcrumbs_home_replace ? __('首页', 'jio') : (string) get_bloginfo('name');
|
||||
$prevnext = !isset($settings['post_prevnext_s']) || !empty($settings['post_prevnext_s']);
|
||||
$authordesc = !isset($settings['post_authordesc_s']) || !empty($settings['post_authordesc_s']);
|
||||
$hide_time = !empty($settings['post_single_hide_time_s']);
|
||||
@@ -164,17 +164,17 @@ class PostDisplay {
|
||||
if ($rewards_text === '') {
|
||||
$rewards_text = '赞赏';
|
||||
}
|
||||
$reward_amount = static function ($value, string $default): \AKSRT\Ledger\AssetAmount {
|
||||
$reward_amount = static function ($value, string $default): \Jio\Ledger\AssetAmount {
|
||||
try {
|
||||
return \AKSRT\Ledger\AssetAmount::balance(is_string($value) ? trim($value) : '');
|
||||
return \Jio\Ledger\AssetAmount::balance(is_string($value) ? trim($value) : '');
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
return \AKSRT\Ledger\AssetAmount::balance($default);
|
||||
return \Jio\Ledger\AssetAmount::balance($default);
|
||||
}
|
||||
};
|
||||
$rewards_amounts = [];
|
||||
foreach (explode(',', (string) ($settings['post_rewards_amounts'] ?? '5.00,10.00,20.00,50.00,100.00')) as $value) {
|
||||
try {
|
||||
$parsed = \AKSRT\Ledger\AssetAmount::balance(trim($value));
|
||||
$parsed = \Jio\Ledger\AssetAmount::balance(trim($value));
|
||||
if ($parsed->minor() > 0) {
|
||||
$rewards_amounts[] = $parsed->decimal();
|
||||
}
|
||||
@@ -187,7 +187,7 @@ class PostDisplay {
|
||||
}
|
||||
$rewards_min_amount = $reward_amount($settings['post_rewards_min'] ?? '1.00', '1.00');
|
||||
if ($rewards_min_amount->minor() <= 0) {
|
||||
$rewards_min_amount = \AKSRT\Ledger\AssetAmount::balance('0.01');
|
||||
$rewards_min_amount = \Jio\Ledger\AssetAmount::balance('0.01');
|
||||
}
|
||||
$rewards_max_amount = $reward_amount($settings['post_rewards_max'] ?? '1000.00', '1000.00');
|
||||
if ($rewards_max_amount->minor() < $rewards_min_amount->minor()) {
|
||||
@@ -365,11 +365,11 @@ class PostDisplay {
|
||||
|
||||
return [
|
||||
'enabled' => !isset($settings['post_article_s']) || !empty($settings['post_article_s']),
|
||||
'btn_text' => sanitize_text_field((string) ($settings['post_article_btn_txte'] ?? '')) ?: __('发布文章', 'aksrt'),
|
||||
'btn_text' => sanitize_text_field((string) ($settings['post_article_btn_txte'] ?? '')) ?: __('发布文章', 'jio'),
|
||||
'title_min' => $title_min,
|
||||
'title_max' => $title_max,
|
||||
'title_placeholder' => sanitize_text_field((string) ($settings['post_t_placeholder'] ?? '')) ?: __('请输入标题', 'aksrt'),
|
||||
'content_placeholder' => sanitize_textarea_field((string) ($settings['post_c_placeholder'] ?? '')) ?: __('请输入内容', 'aksrt'),
|
||||
'title_placeholder' => sanitize_text_field((string) ($settings['post_t_placeholder'] ?? '')) ?: __('请输入标题', 'jio'),
|
||||
'content_placeholder' => sanitize_textarea_field((string) ($settings['post_c_placeholder'] ?? '')) ?: __('请输入内容', 'jio'),
|
||||
'allowed_cat_ids' => is_array($settings['post_article_cat'] ?? null) ? array_values(array_filter(array_map('intval', $settings['post_article_cat']))) : [],
|
||||
'default_user_id' => max(0, (int) ($settings['post_article_user'] ?? 1)),
|
||||
'allow_tags' => !isset($settings['post_article_tag']) || !empty($settings['post_article_tag']),
|
||||
@@ -414,16 +414,16 @@ class PostDisplay {
|
||||
'upload_img' => (!isset($settings['comment_img']) || !empty($settings['comment_img']))
|
||||
&& !empty($settings['comment_upload_img'])
|
||||
&& is_user_logged_in()
|
||||
&& function_exists('aksrt_user_can')
|
||||
&& aksrt_user_can('upload_comment_image', get_current_user_id()),
|
||||
&& function_exists('jio_user_can')
|
||||
&& jio_user_can('upload_comment_image', get_current_user_id()),
|
||||
],
|
||||
'like_enabled' => !isset($settings['comment_like_s']) || !empty($settings['comment_like_s']),
|
||||
'author_tag' => !isset($settings['comment_author_tag']) || !empty($settings['comment_author_tag']),
|
||||
'corderby' => !isset($settings['comment_corderby']) || !empty($settings['comment_corderby']),
|
||||
'user_edit' => !isset($settings['user_edit_comment']) || !empty($settings['user_edit_comment']),
|
||||
'submit_text' => $submit_text !== '' ? $submit_text : __('提交评论', 'aksrt'),
|
||||
'box_placeholder' => $box_placeholder !== '' ? $box_placeholder : __('说点什么吧...', 'aksrt'),
|
||||
'title' => $title !== '' ? $title : __('评论', 'aksrt'),
|
||||
'submit_text' => $submit_text !== '' ? $submit_text : __('提交评论', 'jio'),
|
||||
'box_placeholder' => $box_placeholder !== '' ? $box_placeholder : __('说点什么吧...', 'jio'),
|
||||
'title' => $title !== '' ? $title : __('评论', 'jio'),
|
||||
'close_comments' => !empty($settings['close_comments']),
|
||||
'user_url' => !empty($settings['comment_user_url_s']),
|
||||
];
|
||||
|
||||
+22
-22
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -30,29 +30,29 @@ class Settings {
|
||||
private static $cached_all = null;
|
||||
|
||||
/**
|
||||
* 所有独立 option key(非 aksrt_settings)。
|
||||
* 所有独立 option key(非 jio_settings)。
|
||||
* 用于导入导出完整性检查。
|
||||
*/
|
||||
public const STANDALONE_OPTION_KEYS = [
|
||||
'aksrt_captcha_config',
|
||||
'aksrt_moderation_config',
|
||||
'aksrt_footer_tabbar',
|
||||
'aksrt_floating_buttons',
|
||||
'aksrt_credit_settings',
|
||||
'aksrt_notification_settings',
|
||||
'aksrt_friend_links',
|
||||
'aksrt_category_recommend',
|
||||
'jio_captcha_config',
|
||||
'jio_moderation_config',
|
||||
'jio_footer_tabbar',
|
||||
'jio_floating_buttons',
|
||||
'jio_credit_settings',
|
||||
'jio_notification_settings',
|
||||
'jio_friend_links',
|
||||
'jio_category_recommend',
|
||||
];
|
||||
|
||||
public const SCHEMA_MANAGED_STANDALONE_OPTION_KEYS = [
|
||||
'aksrt_captcha_config',
|
||||
'jio_captcha_config',
|
||||
];
|
||||
|
||||
/**
|
||||
* 包含 secret 字段的 option key — 永不进入独立导入导出。
|
||||
*/
|
||||
public const SECRET_OPTION_KEYS = [
|
||||
'aksrt_captcha_config',
|
||||
'jio_captcha_config',
|
||||
];
|
||||
|
||||
private function __construct() {}
|
||||
@@ -101,7 +101,7 @@ class Settings {
|
||||
*/
|
||||
public static function on_option_updated(string $option_name): void {
|
||||
$tracked = array_merge(
|
||||
['aksrt_settings'],
|
||||
['jio_settings'],
|
||||
self::STANDALONE_OPTION_KEYS
|
||||
);
|
||||
|
||||
@@ -134,9 +134,9 @@ class Settings {
|
||||
return self::$cached_all;
|
||||
}
|
||||
|
||||
// Canonical theme settings live only in aksrt_settings.
|
||||
// Canonical theme settings live only in jio_settings.
|
||||
// Operational configs (captcha/moderation/oauth/footer/etc.) stay standalone.
|
||||
$settings = get_option('aksrt_settings', []);
|
||||
$settings = get_option('jio_settings', []);
|
||||
if (!is_array($settings)) {
|
||||
$settings = [];
|
||||
}
|
||||
@@ -163,7 +163,7 @@ class Settings {
|
||||
* @return array
|
||||
*/
|
||||
public static function read_domain(string $domain, string $section = ''): array {
|
||||
$provider = \AKSRT\Admin\SchemaProvider::get_instance();
|
||||
$provider = \Jio\Admin\SchemaProvider::get_instance();
|
||||
return $provider->read_settings($domain, $section);
|
||||
}
|
||||
|
||||
@@ -181,13 +181,13 @@ class Settings {
|
||||
* @return bool
|
||||
*/
|
||||
public static function write_domain(string $domain, string $section, array $data): bool {
|
||||
$provider = \AKSRT\Admin\SchemaProvider::get_instance();
|
||||
$provider = \Jio\Admin\SchemaProvider::get_instance();
|
||||
$result = $provider->write_settings($domain, $data, $section);
|
||||
|
||||
if ($result) {
|
||||
self::flush_settings_cache();
|
||||
$option_key = $provider->get_option_key($domain, $section);
|
||||
do_action('aksrt_settings_domain_saved', $domain, $section, $option_key);
|
||||
do_action('jio_settings_domain_saved', $domain, $section, $option_key);
|
||||
}
|
||||
|
||||
return $result;
|
||||
@@ -199,7 +199,7 @@ class Settings {
|
||||
* 获取指定 domain/section 的默认值。
|
||||
*/
|
||||
public static function get_domain_defaults(string $domain, string $section = ''): array {
|
||||
$provider = \AKSRT\Admin\SchemaProvider::get_instance();
|
||||
$provider = \Jio\Admin\SchemaProvider::get_instance();
|
||||
return $provider->get_defaults($domain, $section);
|
||||
}
|
||||
|
||||
@@ -209,12 +209,12 @@ class Settings {
|
||||
* 重置指定 domain/section 到默认值。
|
||||
*/
|
||||
public static function reset_domain(string $domain, string $section = ''): bool {
|
||||
$provider = \AKSRT\Admin\SchemaProvider::get_instance();
|
||||
$provider = \Jio\Admin\SchemaProvider::get_instance();
|
||||
$result = $provider->reset_to_defaults($domain, $section);
|
||||
|
||||
if ($result) {
|
||||
self::flush_settings_cache();
|
||||
do_action('aksrt_settings_domain_reset', $domain, $section);
|
||||
do_action('jio_settings_domain_reset', $domain, $section);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -11,7 +11,7 @@ class ThemeSearch {
|
||||
|
||||
public static function search_placeholder(): string {
|
||||
$placeholder = trim((string) Settings::get_value('search_placeholder', ''));
|
||||
return $placeholder !== '' ? $placeholder : __('开启精彩搜索', 'aksrt');
|
||||
return $placeholder !== '' ? $placeholder : __('开启精彩搜索', 'jio');
|
||||
}
|
||||
|
||||
public static function search_history_enabled(): bool {
|
||||
@@ -49,7 +49,7 @@ class ThemeSearch {
|
||||
|
||||
public static function search_popular_title(): string {
|
||||
$title = trim((string) Settings::get_value('search_popular_title', ''));
|
||||
return $title !== '' ? $title : __('热门搜索', 'aksrt');
|
||||
return $title !== '' ? $title : __('热门搜索', 'jio');
|
||||
}
|
||||
|
||||
public static function search_popular_sticky(): array {
|
||||
@@ -130,7 +130,7 @@ class ThemeSearch {
|
||||
$enabled = !empty($s['search_ms_s']);
|
||||
$api_url = esc_url_raw(trim((string) ($opt['api_url'] ?? 'http://127.0.0.1:7700')));
|
||||
$api_key = sanitize_text_field((string) ($opt['api_key'] ?? ''));
|
||||
$index_prefix = sanitize_key((string) ($opt['index_prefix'] ?? 'aksrt'));
|
||||
$index_prefix = sanitize_key((string) ($opt['index_prefix'] ?? 'jio'));
|
||||
$synonyms_raw = $opt['synonyms'] ?? [];
|
||||
$synonyms = [];
|
||||
foreach ((array) $synonyms_raw as $row) {
|
||||
@@ -148,9 +148,9 @@ class ThemeSearch {
|
||||
'enabled' => $enabled,
|
||||
'api_url' => $api_url,
|
||||
'api_key' => $api_key,
|
||||
'index_prefix' => $index_prefix !== '' ? $index_prefix : 'aksrt',
|
||||
'index_prefix' => $index_prefix !== '' ? $index_prefix : 'jio',
|
||||
'synonyms' => $synonyms,
|
||||
'index_name' => ($index_prefix !== '' ? $index_prefix : 'aksrt') . '_posts',
|
||||
'index_name' => ($index_prefix !== '' ? $index_prefix : 'jio') . '_posts',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -183,9 +183,9 @@ class ThemeSearch {
|
||||
if ($key === 'title') $parts[] = $wpdb->prepare("{$wpdb->posts}.post_title LIKE %s", $like);
|
||||
elseif ($key === 'content') $parts[] = $wpdb->prepare("{$wpdb->posts}.post_content LIKE %s", $like);
|
||||
elseif ($key === 'excerpt') $parts[] = $wpdb->prepare("{$wpdb->posts}.post_excerpt LIKE %s", $like);
|
||||
elseif (in_array($key, $taxonomies, true)) $parts[] = $wpdb->prepare('(aksrt_search_tt.taxonomy = %s AND aksrt_search_terms.name LIKE %s)', $key, $like);
|
||||
elseif ($key === 'coment') $parts[] = $wpdb->prepare('aksrt_search_comments.comment_content LIKE %s', $like);
|
||||
elseif ($key === 'user') $parts[] = $wpdb->prepare('(aksrt_search_users.user_nicename LIKE %s OR aksrt_search_users.display_name LIKE %s)', $like, $like);
|
||||
elseif (in_array($key, $taxonomies, true)) $parts[] = $wpdb->prepare('(jio_search_tt.taxonomy = %s AND jio_search_terms.name LIKE %s)', $key, $like);
|
||||
elseif ($key === 'coment') $parts[] = $wpdb->prepare('jio_search_comments.comment_content LIKE %s', $like);
|
||||
elseif ($key === 'user') $parts[] = $wpdb->prepare('(jio_search_users.user_nicename LIKE %s OR jio_search_users.display_name LIKE %s)', $like, $like);
|
||||
}
|
||||
if ($parts) {
|
||||
$groups[] = '(' . implode(' OR ', $parts) . ')';
|
||||
@@ -207,15 +207,15 @@ class ThemeSearch {
|
||||
global $wpdb;
|
||||
$keys = self::search_custom_key();
|
||||
if (in_array('coment', $keys, true)) {
|
||||
$join .= " LEFT JOIN {$wpdb->comments} AS aksrt_search_comments ON ({$wpdb->posts}.ID = aksrt_search_comments.comment_post_ID)";
|
||||
$join .= " LEFT JOIN {$wpdb->comments} AS jio_search_comments ON ({$wpdb->posts}.ID = jio_search_comments.comment_post_ID)";
|
||||
}
|
||||
if (in_array('user', $keys, true)) {
|
||||
$join .= " LEFT JOIN {$wpdb->users} AS aksrt_search_users ON ({$wpdb->posts}.post_author = aksrt_search_users.ID)";
|
||||
$join .= " LEFT JOIN {$wpdb->users} AS jio_search_users ON ({$wpdb->posts}.post_author = jio_search_users.ID)";
|
||||
}
|
||||
if (array_intersect(['post_tag', 'category'], $keys)) {
|
||||
$join .= " LEFT JOIN {$wpdb->term_relationships} AS aksrt_search_tr ON ({$wpdb->posts}.ID = aksrt_search_tr.object_id)";
|
||||
$join .= " LEFT JOIN {$wpdb->term_taxonomy} AS aksrt_search_tt ON (aksrt_search_tr.term_taxonomy_id = aksrt_search_tt.term_taxonomy_id)";
|
||||
$join .= " LEFT JOIN {$wpdb->terms} AS aksrt_search_terms ON (aksrt_search_tt.term_id = aksrt_search_terms.term_id)";
|
||||
$join .= " LEFT JOIN {$wpdb->term_relationships} AS jio_search_tr ON ({$wpdb->posts}.ID = jio_search_tr.object_id)";
|
||||
$join .= " LEFT JOIN {$wpdb->term_taxonomy} AS jio_search_tt ON (jio_search_tr.term_taxonomy_id = jio_search_tt.term_taxonomy_id)";
|
||||
$join .= " LEFT JOIN {$wpdb->terms} AS jio_search_terms ON (jio_search_tt.term_id = jio_search_terms.term_id)";
|
||||
}
|
||||
return $join;
|
||||
}
|
||||
@@ -279,10 +279,10 @@ class ThemeSearch {
|
||||
|
||||
$orderby = isset($_REQUEST['orderby']) ? sanitize_key((string) wp_unslash($_REQUEST['orderby'])) : '';
|
||||
$meta_keys = [
|
||||
'views' => 'aksrt_post_views',
|
||||
'like' => '_aksrt_like_count',
|
||||
'favorite' => '_aksrt_favorite_count',
|
||||
'sales_volume' => '_aksrt_sales_volume',
|
||||
'views' => 'jio_post_views',
|
||||
'like' => '_jio_like_count',
|
||||
'favorite' => '_jio_favorite_count',
|
||||
'sales_volume' => '_jio_sales_volume',
|
||||
];
|
||||
if (isset($meta_keys[$orderby])) {
|
||||
$query->set('meta_key', $meta_keys[$orderby]);
|
||||
@@ -390,7 +390,7 @@ class ThemeSearch {
|
||||
|
||||
/** 全局主题色:theme_skin_custom 优先,清空时使用 theme_skin 预置色(对齐参考主题 zib_head_css)。 */
|
||||
public static function theme_color(): string {
|
||||
$custom = \AKSRT\Core\Color::sanitize(Settings::get_value('theme_skin_custom', ''));
|
||||
$custom = \Jio\Core\Color::sanitize(Settings::get_value('theme_skin_custom', ''));
|
||||
if ($custom !== '') {
|
||||
return $custom;
|
||||
}
|
||||
@@ -400,7 +400,7 @@ class ThemeSearch {
|
||||
|
||||
/** 夜间模式主题色;未设置返回空串,夜间沿用全局主题色。 */
|
||||
public static function dark_theme_color(): string {
|
||||
return \AKSRT\Core\Color::sanitize(Settings::get_value('dark_theme_skin_custom', ''));
|
||||
return \Jio\Core\Color::sanitize(Settings::get_value('dark_theme_skin_custom', ''));
|
||||
}
|
||||
|
||||
public static function get_theme_mode_button_positions(): array {
|
||||
@@ -426,7 +426,7 @@ class ThemeSearch {
|
||||
if (!is_array($bg)) {
|
||||
return '';
|
||||
}
|
||||
$color = \AKSRT\Core\Color::sanitize($bg['color'] ?? '');
|
||||
$color = \Jio\Core\Color::sanitize($bg['color'] ?? '');
|
||||
$image = esc_url_raw(trim((string) ($bg['image'] ?? '')));
|
||||
if ($color === '' && $image === '') {
|
||||
return '';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
namespace Jio\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
@@ -163,7 +163,7 @@ class UserRuntime {
|
||||
* 缺键即用默认值,因此这里改走 SchemaProvider 的带默认读取。
|
||||
*/
|
||||
private static function read_report_section(): array {
|
||||
$settings = class_exists('\AKSRT\Admin\SchemaProvider')
|
||||
$settings = class_exists('\Jio\Admin\SchemaProvider')
|
||||
? Settings::read_domain('users', 'report')
|
||||
: [];
|
||||
return is_array($settings) && $settings ? $settings : Settings::get_all();
|
||||
@@ -262,7 +262,7 @@ class UserRuntime {
|
||||
}
|
||||
$cat_name = sanitize_text_field((string) ($cat['cat_name'] ?? ''));
|
||||
if ($cat_name === '') {
|
||||
$cat_name = __('未命名', 'aksrt');
|
||||
$cat_name = __('未命名', 'jio');
|
||||
}
|
||||
$items_out = [];
|
||||
$items = is_array($cat['items'] ?? null) ? $cat['items'] : [];
|
||||
|
||||
Reference in new issue
Block a user