feat(navigation): hard-switch to Zibll navigation and Font Awesome 5
This commit is contained in:
1 parent
3c3ddac8be
commit
a0b84977a2
630 files changed
+101647
-11293
No files matched your search
@@ -223,7 +223,8 @@ add_action('init', function () {
|
||||
add_filter('query_vars', function ($vars) {
|
||||
$vars[] = 'aksrt_is_resource_archive';
|
||||
$vars[] = 'aksrt_legacy_resource';
|
||||
$vars[] = 'aksrt_search_type';
|
||||
$vars[] = 'type';
|
||||
$vars[] = 'trem';
|
||||
return $vars;
|
||||
});
|
||||
|
||||
@@ -331,7 +332,11 @@ add_action('pre_get_posts', function ($query) {
|
||||
|
||||
// 站内搜索:分类/标签名搜索(内容类型始终为 post)
|
||||
if ($query->is_search() && empty($query->get('post_type'))) {
|
||||
$search_type = sanitize_key((string) $query->get('aksrt_search_type'));
|
||||
$search_type = sanitize_key((string) $query->get('type'));
|
||||
$trem = absint($query->get('trem'));
|
||||
if ($trem > 0) {
|
||||
$query->set('cat', $trem);
|
||||
}
|
||||
|
||||
if (in_array($search_type, ['category', 'tag'], true)) {
|
||||
$taxonomy = $search_type === 'category' ? 'category' : 'post_tag';
|
||||
|
||||
@@ -47,7 +47,12 @@ add_filter('manage_post_posts_columns', function ($columns) {
|
||||
|
||||
add_action('admin_enqueue_scripts', function ($hook) {
|
||||
if ($hook !== 'edit.php') return;
|
||||
wp_enqueue_style('font-awesome-5', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css', [], '5.15.4');
|
||||
wp_enqueue_style(
|
||||
'aksrt-font-awesome',
|
||||
get_template_directory_uri() . '/assets/vendor/fontawesome5/css/all.min.css',
|
||||
[],
|
||||
'5.15.4'
|
||||
);
|
||||
});
|
||||
|
||||
add_action('manage_post_posts_custom_column', function ($column, $post_id) {
|
||||
@@ -65,12 +70,12 @@ add_action('manage_post_posts_custom_column', function ($column, $post_id) {
|
||||
};
|
||||
|
||||
$parts = [];
|
||||
$parts[] = '<span title="' . esc_attr__('浏览', 'aksrt') . '" style="margin-right:4px;"><i class="fas fa-eye" style="color:#8a909c;font-size:12px;"></i> ' . esc_html($format($views)) . '</span>';
|
||||
$parts[] = '<span title="' . esc_attr__('点赞', 'aksrt') . '" style="margin-right:4px;"><i class="fas fa-thumbs-up" style="color:#1890ff;font-size:12px;"></i> ' . esc_html($format($likes)) . '</span>';
|
||||
$parts[] = '<span title="' . esc_attr__('收藏', 'aksrt') . '" style="margin-right:4px;"><i class="fas fa-star" style="color:#f39c12;font-size:12px;"></i> ' . esc_html($format($favorites)) . '</span>';
|
||||
$parts[] = '<span title="' . esc_attr__('浏览', 'aksrt') . '" style="margin-right:4px;"><i class="fa fas fa-eye" style="color:#8a909c;font-size:12px;"></i> ' . esc_html($format($views)) . '</span>';
|
||||
$parts[] = '<span title="' . esc_attr__('点赞', 'aksrt') . '" style="margin-right:4px;"><i class="fa fas fa-thumbs-up" style="color:#1890ff;font-size:12px;"></i> ' . esc_html($format($likes)) . '</span>';
|
||||
$parts[] = '<span title="' . esc_attr__('收藏', 'aksrt') . '" style="margin-right:4px;"><i class="fa fas fa-star" style="color:#f39c12;font-size:12px;"></i> ' . esc_html($format($favorites)) . '</span>';
|
||||
|
||||
if ($downloads > 0) {
|
||||
$parts[] = '<span title="' . esc_attr__('下载', 'aksrt') . '"><i class="fas fa-download" style="color:#52c41a;font-size:12px;"></i> ' . esc_html($format($downloads)) . '</span>';
|
||||
$parts[] = '<span title="' . esc_attr__('下载', 'aksrt') . '"><i class="fa fas fa-download" style="color:#52c41a;font-size:12px;"></i> ' . esc_html($format($downloads)) . '</span>';
|
||||
}
|
||||
|
||||
echo implode(' · ', $parts);
|
||||
|
||||
@@ -155,7 +155,7 @@ if (!function_exists('aksrt_get_ajax_number_paginate')) {
|
||||
// Prev.
|
||||
if ($page > 1) {
|
||||
$url = esc_url(str_replace('%#%', (string) ($page - 1), $base));
|
||||
$links[] = '<a class="' . esc_attr($next_class) . ' prev page-numbers" ajax-replace="true" href="' . $url . '"><i class="fa fa-angle-left em12" aria-hidden="true"></i></a>';
|
||||
$links[] = '<a class="' . esc_attr($next_class) . ' prev page-numbers" ajax-replace="true" href="' . $url . '"><i class="fa fas fa-angle-left em12" aria-hidden="true"></i></a>';
|
||||
}
|
||||
|
||||
for ($n = 1; $n <= $total_pages; $n++) {
|
||||
@@ -182,7 +182,7 @@ if (!function_exists('aksrt_get_ajax_number_paginate')) {
|
||||
// Next.
|
||||
if ($page < $total_pages) {
|
||||
$url = esc_url(str_replace('%#%', (string) ($page + 1), $base));
|
||||
$links[] = '<a class="' . esc_attr($next_class) . ' next page-numbers" ajax-replace="true" href="' . $url . '"><i class="fa fa-angle-right em12" aria-hidden="true"></i></a>';
|
||||
$links[] = '<a class="' . esc_attr($next_class) . ' next page-numbers" ajax-replace="true" href="' . $url . '"><i class="fa fas fa-angle-right em12" aria-hidden="true"></i></a>';
|
||||
}
|
||||
|
||||
return '<div class="pagenav ' . esc_attr($pag_class) . '">' . implode('', $links) . '</div>';
|
||||
|
||||
@@ -408,7 +408,7 @@ if (!function_exists('aksrt_comments_render_signarea')) :
|
||||
$oauth_providers = is_array($ctx['oauth_providers'] ?? null) ? $ctx['oauth_providers'] : [];
|
||||
?>
|
||||
<div class="comment-signarea text-center box-body radius8">
|
||||
<i class="fas fa-lock" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-lock" aria-hidden="true"></i>
|
||||
<span><?php esc_html_e('登录后参与评论', 'aksrt'); ?></span>
|
||||
<div class="comment-login-prompt__btns">
|
||||
<a class="signin-loader but hollow" href="<?php echo esc_url(function_exists('aksrt_get_login_url') ? aksrt_get_login_url(get_permalink()) : wp_login_url(get_permalink())); ?>"><?php esc_html_e('登录', 'aksrt'); ?></a>
|
||||
@@ -513,7 +513,7 @@ if (!function_exists('aksrt_comments_render_form')) :
|
||||
$req_mark = $require_name_email ? '(' . __('必填', 'aksrt') . ')' : '';
|
||||
?>
|
||||
<span class="dropup relative" id="comment-user-info"<?php echo $require_name_email ? ' require_name_email="true"' : ''; ?>>
|
||||
<a class="but mr6" data-toggle-class="open" data-target="#comment-user-info" href="javascript:;"><i class="fa fa-fw fa-user" aria-hidden="true"></i><span class="hide-sm"><?php esc_html_e('昵称', 'aksrt'); ?></span></a>
|
||||
<a class="but mr6" data-toggle-class="open" data-target="#comment-user-info" href="javascript:;"><i class="fa fas fa-fw fa-user" aria-hidden="true"></i><span class="hide-sm"><?php esc_html_e('昵称', 'aksrt'); ?></span></a>
|
||||
<div class="dropdown-menu box-body" style="width:250px;">
|
||||
<div class="mb20">
|
||||
<p><?php esc_html_e('请填写用户信息:', 'aksrt'); ?></p>
|
||||
@@ -646,7 +646,7 @@ if (!function_exists('aksrt_comments_render_empty')) :
|
||||
?>
|
||||
<div class="comments-empty post_ajax_loader">
|
||||
<div class="comments-empty__icon">
|
||||
<i class="far fa-comment-dots"></i>
|
||||
<i class="fa fas fa-comment-dots"></i>
|
||||
</div>
|
||||
<p class="comments-empty__text"><?php echo esc_html($text); ?></p>
|
||||
<p class="comments-empty__hint"><?php echo esc_html($hint); ?></p>
|
||||
|
||||
@@ -307,7 +307,7 @@ if (!function_exists('aksrt_breadcrumbs')) :
|
||||
$last = $single_text ? __('正文', 'aksrt') : get_the_title();
|
||||
// New route: hand-built ancestor chain (no get_category_parents noise).
|
||||
$parts = [];
|
||||
$parts[] = '<li><a href="' . esc_url(home_url('/')) . '"><i class="fa fa-map-marker"></i> ' . esc_html($home_text) . '</a></li>';
|
||||
$parts[] = '<li><a href="' . esc_url(home_url('/')) . '"><i class="fa fas fa-map-marker-alt"></i> ' . esc_html($home_text) . '</a></li>';
|
||||
$ancestors = array_reverse(get_ancestors((int) $category->term_id, 'category'));
|
||||
foreach ($ancestors as $ancestor_id) {
|
||||
$ancestor = get_term((int) $ancestor_id, 'category');
|
||||
@@ -321,7 +321,7 @@ if (!function_exists('aksrt_breadcrumbs')) :
|
||||
return;
|
||||
}
|
||||
$items = [];
|
||||
$items[] = '<li class="breadcrumbs__item breadcrumbs__item--home"><a href="' . esc_url(home_url('/')) . '"><i class="fa fa-map-marker" aria-hidden="true"></i><span>' . esc_html($home_text) . '</span></a></li>';
|
||||
$items[] = '<li class="breadcrumbs__item breadcrumbs__item--home"><a href="' . esc_url(home_url('/')) . '"><i class="fa fas fa-map-marker-alt" aria-hidden="true"></i><span>' . esc_html($home_text) . '</span></a></li>';
|
||||
if (is_category()) {
|
||||
$term = get_queried_object();
|
||||
if ($term instanceof WP_Term) {
|
||||
|
||||
@@ -246,10 +246,10 @@ if (!function_exists('aksrt_author_minicard')) :
|
||||
$current = get_current_user_id();
|
||||
if ($current !== $user_id) {
|
||||
if (is_user_logged_in()) {
|
||||
$follow = '<button type="button" class="focus-color px12 ml10 follow flex0 but" data-aksrt-follow="' . (int) $user_id . '"><i class="fa fa-heart em09" aria-hidden="true"></i> ' . esc_html__('关注', 'aksrt') . '</button>';
|
||||
$follow = '<button type="button" class="focus-color px12 ml10 follow flex0 but" data-aksrt-follow="' . (int) $user_id . '"><i class="fa fas fa-heart em09" aria-hidden="true"></i> ' . esc_html__('关注', 'aksrt') . '</button>';
|
||||
} else {
|
||||
$login = function_exists('aksrt_get_login_url') ? aksrt_get_login_url() : wp_login_url();
|
||||
$follow = '<a class="focus-color px12 ml10 follow flex0 but" href="' . esc_url($login) . '"><i class="fa fa-heart em09" aria-hidden="true"></i> ' . esc_html__('关注', 'aksrt') . '</a>';
|
||||
$follow = '<a class="focus-color px12 ml10 follow flex0 but" href="' . esc_url($login) . '"><i class="fa fas fa-heart em09" aria-hidden="true"></i> ' . esc_html__('关注', 'aksrt') . '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,29 +7,6 @@
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if (!function_exists('aksrt_get_header_newposts_config')) :
|
||||
/**
|
||||
* @return array{enabled:bool,text:string,radius:int,radius_pill:bool,class:string,types:string[]}
|
||||
*/
|
||||
function aksrt_get_header_newposts_config(): array {
|
||||
$cfg = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_header_newposts_config()
|
||||
: ['enabled' => true, 'text' => __('发布', 'aksrt'), 'radius' => 20, 'class' => 'jb-blue', 'types' => []];
|
||||
// Single source: header_newposts_enabled (zibll nav_newposts).
|
||||
// FacadeBulk maps publish_btn to the same setting.
|
||||
|
||||
$types = is_array($cfg['types'] ?? null) ? $cfg['types'] : [];
|
||||
if (!$types) {
|
||||
$types = ['post'];
|
||||
}
|
||||
$cfg['types'] = $types;
|
||||
if (empty($cfg['class'])) {
|
||||
$cfg['class'] = 'jb-blue';
|
||||
}
|
||||
return $cfg;
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_get_new_add_actions')) :
|
||||
/**
|
||||
* Build multi-type publish actions.
|
||||
@@ -52,7 +29,7 @@ if (!function_exists('aksrt_get_new_add_actions')) :
|
||||
'type' => 'post',
|
||||
'url' => $url,
|
||||
'label' => __('写文章', 'aksrt'),
|
||||
'icon' => 'fas fa-file-alt',
|
||||
'icon' => 'fa fas fa-file-alt',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -62,29 +39,14 @@ endif;
|
||||
|
||||
if (!function_exists('aksrt_normalize_header_cta_label')) :
|
||||
/**
|
||||
* Normalize CTA label HTML: map FA4 classes and keep a single leading icon.
|
||||
* Normalize CTA label HTML: map FA5 classes and keep a single leading icon.
|
||||
*/
|
||||
function aksrt_normalize_header_cta_label(string $label, string $fallback_icon = 'fas fa-pen'): string {
|
||||
function aksrt_normalize_header_cta_label(string $label, string $fallback_icon = 'fa fas fa-pen'): string {
|
||||
$label = trim($label);
|
||||
if ($label === '') {
|
||||
return '<i class="' . esc_attr($fallback_icon) . '" aria-hidden="true"></i> ' . esc_html__('发布', 'aksrt');
|
||||
}
|
||||
|
||||
$replacements = [
|
||||
'fa-file-text-o' => 'fa-file-alt',
|
||||
'fa-file-text' => 'fa-file-alt',
|
||||
'fa-pencil-square-o' => 'fa-edit',
|
||||
'fa-pencil' => 'fa-pen',
|
||||
'fa-comments-o' => 'fa-comments',
|
||||
'fa-clock-o' => 'fa-clock',
|
||||
'fa-calendar-check-o' => 'fa-calendar-check',
|
||||
'fa-diamond' => 'fa-gem',
|
||||
];
|
||||
$label = strtr($label, $replacements);
|
||||
|
||||
$label = preg_replace('/\bclass=(["\'])fa\s+/', 'class=$1fas ', $label) ?? $label;
|
||||
$label = preg_replace('/<i\s+class=(["\'])(?!fas\b|far\b|fab\b)/', '<i class=$1fas ', $label) ?? $label;
|
||||
|
||||
if (stripos($label, '<i') === false) {
|
||||
// No space between icon and label — spacing via CSS margin (zibll .but > .fa).
|
||||
$label = '<i class="' . esc_attr($fallback_icon) . '" aria-hidden="true"></i><span class="navbar-cta-text">' . esc_html(wp_strip_all_tags($label)) . '</span>';
|
||||
@@ -118,13 +80,13 @@ if (!function_exists('aksrt_render_new_add_btns')) :
|
||||
'type' => 'post',
|
||||
'url' => $fallback,
|
||||
'label' => __('写文章', 'aksrt'),
|
||||
'icon' => 'fas fa-file-alt',
|
||||
'icon' => 'fa fas fa-file-alt',
|
||||
]];
|
||||
}
|
||||
if ($label === '') {
|
||||
$label = __('发布', 'aksrt');
|
||||
}
|
||||
$label_html = aksrt_normalize_header_cta_label((string) $label, 'fas fa-pen');
|
||||
$label_html = aksrt_normalize_header_cta_label((string) $label, 'fa fas fa-pen');
|
||||
|
||||
// Split paint classes vs wrapper tokens.
|
||||
$class_tokens = preg_split('/\s+/', trim($class), -1, PREG_SPLIT_NO_EMPTY) ?: [];
|
||||
@@ -161,7 +123,7 @@ if (!function_exists('aksrt_render_new_add_btns')) :
|
||||
// data-aksrt-newadd: JS may portal menu to body so chip width cannot track menu.
|
||||
$html = '<span class="' . esc_attr(trim(implode(' ', $wrap_tokens) . ' hover-show')) . '" data-aksrt-newadd="1">';
|
||||
$html .= '<span class="newadd-btns__toggle navbar-cta ' . esc_attr($cta_class) . '">' . $label_html
|
||||
. '<i class="fas fa-caret-down" aria-hidden="true"></i></span>';
|
||||
. '<i class="fa fas fa-caret-down" aria-hidden="true"></i></span>';
|
||||
$html .= '<div class="hover-show-con dropdown-menu drop-newadd" role="menu">';
|
||||
foreach ($actions as $a) {
|
||||
$html .= '<a rel="nofollow" class="btn-newadd newadd-btns__item" role="menuitem" href="' . esc_url($a['url']) . '">';
|
||||
@@ -179,7 +141,20 @@ if (!function_exists('aksrt_render_header_menu_buttons')) :
|
||||
* Publish + optional VIP open button for header CTA.
|
||||
*/
|
||||
function aksrt_render_header_menu_buttons(): string {
|
||||
$cfg = aksrt_get_header_newposts_config();
|
||||
$settings = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_all() : [];
|
||||
$types = is_array($settings['nav_newposts_btns'] ?? null)
|
||||
? array_values(array_intersect(array_map('sanitize_key', $settings['nav_newposts_btns']), ['post']))
|
||||
: ['post'];
|
||||
if (!$types) {
|
||||
$types = ['post'];
|
||||
}
|
||||
$cfg = [
|
||||
'enabled' => !isset($settings['nav_newposts']) || !empty($settings['nav_newposts']),
|
||||
'text' => trim((string) ($settings['nav_newposts_text'] ?? __('发布', 'aksrt'))),
|
||||
'radius_pill' => !isset($settings['nav_newposts_radius']) || !empty($settings['nav_newposts_radius']),
|
||||
'class' => sanitize_html_class((string) (($settings['nav_newposts_class'] ?? '') ?: 'jb-blue')),
|
||||
'types' => $types,
|
||||
];
|
||||
$html = '';
|
||||
if (!empty($cfg['enabled'])) {
|
||||
// zibll default: but nowave jb-blue (+ radius).
|
||||
@@ -189,18 +164,14 @@ if (!function_exists('aksrt_render_header_menu_buttons')) :
|
||||
$skin = 'jb-blue';
|
||||
}
|
||||
$class .= ' ' . $skin;
|
||||
$radius = (int) ($cfg['radius'] ?? 20);
|
||||
$pill = !empty($cfg['radius_pill']) || $radius >= 16;
|
||||
$pill = !empty($cfg['radius_pill']);
|
||||
if ($pill && !str_contains($class, 'radius')) {
|
||||
$class .= ' radius';
|
||||
}
|
||||
$radius_attr = $radius > 0
|
||||
? ' data-radius="' . esc_attr((string) $radius) . '" style="--navbar-cta-radius:' . $radius . 'px"'
|
||||
: '';
|
||||
$label = (string) ($cfg['text'] ?? __('发布', 'aksrt'));
|
||||
$btn = aksrt_render_new_add_btns($cfg['types'] ?? ['post'], $class, $label);
|
||||
if ($btn !== '') {
|
||||
$html .= '<div class="navbar-form navbar-right navbar-but"' . $radius_attr . '>' . $btn . '</div>';
|
||||
$html .= $btn;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,7 +180,7 @@ if (!function_exists('aksrt_render_header_menu_buttons')) :
|
||||
$show_vip = false;
|
||||
if (class_exists('\AKSRT\Settings\Settings')) {
|
||||
$vs = \AKSRT\Settings\Settings::get_payment_vip_settings();
|
||||
$show_vip = !empty($vs['enabled']) && !empty(\AKSRT\Settings\Settings::get_header_nav_settings()['nav_pay_vip']);
|
||||
$show_vip = !empty($vs['enabled']) && (!isset($settings['nav_pay_vip']) || !empty($settings['nav_pay_vip']));
|
||||
}
|
||||
if ($show_vip) {
|
||||
$is_vip = false;
|
||||
@@ -228,14 +199,13 @@ if (!function_exists('aksrt_render_header_menu_buttons')) :
|
||||
}
|
||||
}
|
||||
}
|
||||
$html .= '<div class="navbar-form navbar-right navbar-vip">';
|
||||
// zibll: span.hover-show wraps button + .hover-show-con.sub-vip-card
|
||||
$html .= '<span class="hover-show inline-block navbar-vip-hover">';
|
||||
$html .= '<a class="but jb-red radius payvip-icon navbar-cta ' . esc_attr($cls) . '" href="javascript:;"'
|
||||
$html .= '<a class="but jb-red radius payvip-icon ml10 navbar-cta ' . esc_attr($cls) . '" href="javascript:;"'
|
||||
. ($user_id > 0 ? ' vip-level="1"' : '') . '>';
|
||||
$html .= '<i class="fas fa-gem" aria-hidden="true"></i>'
|
||||
$html .= '<svg class="icon em12 mr3" aria-hidden="true"><use xlink:href="#icon-vip_1"></use></svg>'
|
||||
. '<span class="navbar-cta-text">' . esc_html__('开通会员', 'aksrt') . '</span>';
|
||||
$html .= '</a>' . $hover . '</span></div>';
|
||||
$html .= '</a>' . $hover . '</span>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,13 +45,13 @@ if (!function_exists('aksrt_header_user_checkin_btn')) :
|
||||
$compact_class = $compact ? ' aksrt-header-checkin--compact' : '';
|
||||
if ($signed) {
|
||||
return '<button type="button" class="but block c-yellow aksrt-header-checkin' . $compact_class . ' is-done" disabled>'
|
||||
. '<i class="fas fa-calendar-check" aria-hidden="true"></i>'
|
||||
. '<i class="fa fas fa-calendar-check" aria-hidden="true"></i>'
|
||||
. '<span>' . esc_html($compact ? __('已签到', 'aksrt') : __('今日已签到', 'aksrt')) . '</span>'
|
||||
. '</button>';
|
||||
}
|
||||
|
||||
return '<button type="button" class="but block c-yellow aksrt-header-checkin' . $compact_class . '" data-aksrt-checkin="1">'
|
||||
. '<i class="fas fa-calendar-check" aria-hidden="true"></i>'
|
||||
. '<i class="fa fas fa-calendar-check" aria-hidden="true"></i>'
|
||||
. '<span>' . esc_html($compact ? __('签到', 'aksrt') : __('签到领取今日奖励', 'aksrt')) . '</span>'
|
||||
. '</button>';
|
||||
}
|
||||
@@ -77,9 +77,9 @@ if (!function_exists('aksrt_header_user_wallet_mini')) :
|
||||
$center = function_exists('aksrt_get_user_center_url') ? aksrt_get_user_center_url('credits') : '#';
|
||||
|
||||
$html = '<a class="aksrt-header-wallet flex ac jsb" href="' . esc_url($center) . '">';
|
||||
$html .= '<span class="aksrt-header-wallet__item"><i class="fas fa-coins" aria-hidden="true"></i> '
|
||||
$html .= '<span class="aksrt-header-wallet__item"><i class="fa fas fa-database" aria-hidden="true"></i> '
|
||||
. esc_html($currency) . ' <b>' . esc_html(number_format_i18n($credits)) . '</b></span>';
|
||||
$html .= '<span class="aksrt-header-wallet__item"><i class="fas fa-wallet" aria-hidden="true"></i> '
|
||||
$html .= '<span class="aksrt-header-wallet__item"><i class="fa fas fa-money-bill" aria-hidden="true"></i> '
|
||||
. esc_html__('余额', 'aksrt') . ' <b>' . esc_html(number_format_i18n($wallet, 2)) . '</b></span>';
|
||||
$html .= '</a>';
|
||||
return $html;
|
||||
@@ -117,9 +117,9 @@ if (!function_exists('aksrt_header_payvip_bar')) :
|
||||
return '';
|
||||
}
|
||||
|
||||
$nav = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_header_nav_settings()
|
||||
: ['nav_user_pay_vip' => true];
|
||||
$settings = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_all()
|
||||
: [];
|
||||
|
||||
$level = function_exists('aksrt_get_user_vip_level') ? (int) aksrt_get_user_vip_level($user_id) : 0;
|
||||
if ($level > 0) {
|
||||
@@ -133,7 +133,7 @@ if (!function_exists('aksrt_header_payvip_bar')) :
|
||||
$html = '<div class="mt10 em09 aksrt-header-payvip is-vip">';
|
||||
$html .= '<span class="radius4 payvip-icon btn-block text-center vipbg-v2 level-' . (int) $level . ' aksrt-header-payvip__active">';
|
||||
$html .= '<span class="aksrt-header-payvip__level">';
|
||||
$html .= '<i class="fas fa-gem" aria-hidden="true"></i>';
|
||||
$html .= '<i class="fa fas fa-gem" aria-hidden="true"></i>';
|
||||
$html .= '<span>' . esc_html($name) . '</span>';
|
||||
$html .= '</span>';
|
||||
if ($exp_label !== '') {
|
||||
@@ -144,14 +144,14 @@ if (!function_exists('aksrt_header_payvip_bar')) :
|
||||
}
|
||||
|
||||
// Open-VIP CTA only when user-box switch is on (zibll nav_user_pay_vip).
|
||||
if (empty($nav['nav_user_pay_vip'])) {
|
||||
if (isset($settings['nav_user_pay_vip']) && empty($settings['nav_user_pay_vip'])) {
|
||||
return '';
|
||||
}
|
||||
|
||||
// Match check-in CTA geometry (full width, 6px radius) — not top-nav navbar-cta chips.
|
||||
return '<div class="mt10 em09 aksrt-header-payvip">'
|
||||
. '<a class="pay-vip but block payvip-icon aksrt-header-payvip__cta" href="javascript:;" vip-level="1">'
|
||||
. '<i class="fas fa-gem" aria-hidden="true"></i>'
|
||||
. '<i class="fa fas fa-gem" aria-hidden="true"></i>'
|
||||
. '<span>' . esc_html__('开通会员 尊享会员权益', 'aksrt') . '</span>'
|
||||
. '</a></div>';
|
||||
}
|
||||
@@ -173,7 +173,7 @@ if (!function_exists('aksrt_render_signout_modal')) :
|
||||
<div class="modal-dialog modal-mini" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body text-center" style="padding:24px;">
|
||||
<div class="em2x mb10"><i class="fa fa-sign-out" aria-hidden="true"></i></div>
|
||||
<div class="em2x mb10"><i class="fa fas fa-sign-out-alt" aria-hidden="true"></i></div>
|
||||
<div class="mb15"><?php esc_html_e('确认退出当前账号?', 'aksrt'); ?></div>
|
||||
<div class="but-average flex jc" style="gap:10px;">
|
||||
<button type="button" class="but" data-dismiss="modal"><?php esc_html_e('取消', 'aksrt'); ?></button>
|
||||
|
||||
@@ -143,19 +143,6 @@ if (!function_exists('aksrt_homepage_sticky_tabs_enabled')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_homepage_module_hero_enabled')) {
|
||||
/**
|
||||
* Whether the fixed homepage should render the built-in hero section.
|
||||
*/
|
||||
function aksrt_homepage_module_hero_enabled(): bool {
|
||||
if (class_exists('\AKSRT\Settings\Settings')) {
|
||||
return \AKSRT\Settings\Settings::homepage_module_hero_enabled();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_homepage_module_banner_enabled')) {
|
||||
/**
|
||||
* Whether the fixed homepage should render the built-in banner section.
|
||||
@@ -333,7 +320,7 @@ if (!function_exists('aksrt_homepage_render_sortbar')) {
|
||||
<div class="aksrt-homepage__sortbar-dropdown">
|
||||
<button type="button" class="aksrt-homepage__sortbar-current" data-sort-dropdown-trigger>
|
||||
<?php echo esc_html($all_labels[$current] ?? $current); ?>
|
||||
<i class="fas fa-caret-down" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-caret-down" aria-hidden="true"></i>
|
||||
</button>
|
||||
<div class="aksrt-homepage__sortbar-dropdown-menu" hidden>
|
||||
<?php foreach ($sort_items as $sort_key => $label) : ?>
|
||||
|
||||
@@ -54,5 +54,5 @@ function aksrt_get_translate_language_btn(string $class = ''): string {
|
||||
$toggle = !$is_mobile ? '' : ' data-toggle="dropdown"';
|
||||
return '<div class="dropdown language-dropdown ' . esc_attr($class) . $hover . '">'
|
||||
. '<a href="javascript:;" class="toggle-radius"' . $toggle . ' title="' . esc_attr__('切换语言', 'aksrt') . '">'
|
||||
. '<i class="fas fa-language" aria-hidden="true"></i></a>' . $dropdown . '</div>';
|
||||
. '<i class="fa fas fa-language" aria-hidden="true"></i></a>' . $dropdown . '</div>';
|
||||
}
|
||||
@@ -83,7 +83,7 @@ if (!function_exists('aksrt_icon_card')) :
|
||||
$icon_inner = '<img' . aksrt_get_lazy_attr('lazy_other', $icon_img, 'img-icon') . ' alt="">';
|
||||
} else {
|
||||
if ($icon_fa !== '' && !str_contains($icon_fa, 'fa-') && !str_contains($icon_fa, ' ')) {
|
||||
$icon_fa = 'fa fa-' . $icon_fa;
|
||||
$icon_fa = 'fa fas fa-' . $icon_fa;
|
||||
}
|
||||
$icon_inner = '<i class="' . esc_attr($icon_fa) . '" aria-hidden="true"></i>';
|
||||
}
|
||||
@@ -239,7 +239,7 @@ if (!function_exists('aksrt_icon_cover_card')) :
|
||||
} else {
|
||||
// zibll: zib_get_cfs_icon($args['icon'], 'em09') — keep FA class + em09.
|
||||
if ($icon_fa !== '' && !str_contains($icon_fa, 'fa-') && !str_contains($icon_fa, ' ') && !str_starts_with($icon_fa, 'zibsvg-')) {
|
||||
$icon_fa = 'fa fa-' . $icon_fa;
|
||||
$icon_fa = 'fa fas fa-' . $icon_fa;
|
||||
}
|
||||
if (str_contains($icon_fa, '<')) {
|
||||
$icon_inner = wp_kses($icon_fa, [
|
||||
|
||||
+32
-31
@@ -37,7 +37,7 @@ function aksrt_parse_country_list($raw) {
|
||||
endif;
|
||||
|
||||
// ============================================================
|
||||
// Brand icon map (FA 5.15.4 free)
|
||||
// Brand icon map (FA 5.15.4)
|
||||
// ============================================================
|
||||
|
||||
if (!function_exists('aksrt_brand_icon_map')) :
|
||||
@@ -52,30 +52,30 @@ function aksrt_brand_icon_map(): array {
|
||||
return $map;
|
||||
}
|
||||
|
||||
// FA5 free has no bilibili/gitee brands — use solid stand-ins.
|
||||
// FA5 Free has no bilibili/gitee brands — use solid stand-ins.
|
||||
$map = [
|
||||
'github' => 'fab fa-github',
|
||||
'google' => 'fab fa-google',
|
||||
'x' => 'fab fa-twitter',
|
||||
'twitter' => 'fab fa-twitter',
|
||||
'email' => 'fas fa-envelope',
|
||||
'envelope' => 'fas fa-envelope',
|
||||
'wechat' => 'fab fa-weixin',
|
||||
'weixin' => 'fab fa-weixin',
|
||||
'qq' => 'fab fa-qq',
|
||||
'weibo' => 'fab fa-weibo',
|
||||
'telegram' => 'fab fa-telegram-plane',
|
||||
'discord' => 'fab fa-discord',
|
||||
'bilibili' => 'fas fa-tv',
|
||||
'linkedin' => 'fab fa-linkedin-in',
|
||||
'facebook' => 'fab fa-facebook-f',
|
||||
'youtube' => 'fab fa-youtube',
|
||||
'instagram' => 'fab fa-instagram',
|
||||
'web' => 'fas fa-globe',
|
||||
'globe' => 'fas fa-globe',
|
||||
'gitee' => 'fas fa-code-branch',
|
||||
'baidu' => 'fas fa-paw',
|
||||
'alipay' => 'fab fa-alipay',
|
||||
'github' => 'fa fab fa-github',
|
||||
'google' => 'fa fab fa-google',
|
||||
'x' => 'fa fab fa-twitter',
|
||||
'twitter' => 'fa fab fa-twitter',
|
||||
'email' => 'fa fas fa-envelope',
|
||||
'envelope' => 'fa fas fa-envelope',
|
||||
'wechat' => 'fa fab fa-weixin',
|
||||
'weixin' => 'fa fab fa-weixin',
|
||||
'qq' => 'fa fab fa-qq',
|
||||
'weibo' => 'fa fab fa-weibo',
|
||||
'telegram' => 'fa fab fa-telegram-plane',
|
||||
'discord' => 'fa fab fa-discord',
|
||||
'bilibili' => 'fa fas fa-tv',
|
||||
'linkedin' => 'fa fab fa-linkedin',
|
||||
'facebook' => 'fa fab fa-facebook-f',
|
||||
'youtube' => 'fa fab fa-youtube',
|
||||
'instagram' => 'fa fab fa-instagram',
|
||||
'web' => 'fa fas fa-globe',
|
||||
'globe' => 'fa fas fa-globe',
|
||||
'gitee' => 'fa fas fa-code-branch',
|
||||
'baidu' => 'fa fas fa-paw',
|
||||
'alipay' => 'fa fab fa-alipay',
|
||||
];
|
||||
|
||||
return $map;
|
||||
@@ -86,7 +86,7 @@ if (!function_exists('aksrt_normalize_icon_key')) :
|
||||
/**
|
||||
* Normalize short key or full FA class string to a short map key.
|
||||
*
|
||||
* Examples: 'fab fa-github' | 'fabfa-github' | 'fa-github' | 'github' | 'weixin' → 'github' | 'wechat'
|
||||
* Examples: 'fa fab fa-github' | 'fa-github' | 'github' | 'weixin' → 'github' | 'wechat'
|
||||
*
|
||||
* @param string $name Raw icon key or FA class string.
|
||||
* @return string Short key (may be empty).
|
||||
@@ -97,9 +97,10 @@ function aksrt_normalize_icon_key(string $name): string {
|
||||
return '';
|
||||
}
|
||||
|
||||
// Strip style prefixes: fab/fas/far + optional space or hyphen.
|
||||
$name = preg_replace('/^(fab|fas|far)[\s-]*/i', '', $name);
|
||||
$name = preg_replace('/^fa[\s-]*/i', '', (string) $name);
|
||||
// Strip the FA5 layout/style prefixes and glyph prefix.
|
||||
$name = preg_replace('/^fa\s+(?:fas|far|fab)\s+/i', '', $name);
|
||||
$name = preg_replace('/^(?:fas|far|fab)\s+/i', '', (string) $name);
|
||||
$name = preg_replace('/^fa-/i', '', (string) $name);
|
||||
$name = trim((string) $name, "- \t\n\r\0\x0B");
|
||||
$name = strtolower($name);
|
||||
|
||||
@@ -124,7 +125,7 @@ if (!function_exists('aksrt_brand_icon_class')) :
|
||||
* Resolve a short key or FA class string to an allowlisted FA5 class.
|
||||
*
|
||||
* @param string $name Short key or full FA class string.
|
||||
* @return string e.g. 'fab fa-github', or '' if unknown.
|
||||
* @return string e.g. 'fa fab fa-github', or '' if unknown.
|
||||
*/
|
||||
function aksrt_brand_icon_class(string $name): string {
|
||||
$raw = trim($name);
|
||||
@@ -133,7 +134,7 @@ function aksrt_brand_icon_class(string $name): string {
|
||||
}
|
||||
|
||||
// Pass through already-valid full FA class strings (footer contact_more).
|
||||
if (preg_match('/^(fa[sbr]|fa)\s+fa-[\w-]+(?:\s+fa-[\w-]+)*$/i', $raw)) {
|
||||
if (preg_match('/^fa\s+(?:fas|far|fab)\s+fa-[\w-]+(?:\s+fa-[\w-]+)*$/i', $raw)) {
|
||||
// Prefer mapped short key when strip matches our catalog (normalizes weixin etc.).
|
||||
$key = aksrt_normalize_icon_key($raw);
|
||||
$map = aksrt_brand_icon_map();
|
||||
@@ -260,7 +261,7 @@ function aksrt_render_social_links(array $contacts): void {
|
||||
}
|
||||
$icon_html = aksrt_brand_icon($icon);
|
||||
if ($icon_html === '') {
|
||||
$icon_html = '<i class="fas fa-globe" aria-hidden="true"></i>';
|
||||
$icon_html = '<i class="fa fas fa-globe" aria-hidden="true"></i>';
|
||||
}
|
||||
$label = (string) ($contact['name'] ?? $contact['title'] ?? $contact['label'] ?? '');
|
||||
if ($label === '') {
|
||||
|
||||
@@ -182,7 +182,7 @@ if (!function_exists('aksrt_get_user_name')) {
|
||||
|
||||
? '<img' . aksrt_get_lazy_attr('lazy_other', $icon_url, 'aksrt-identity-certification-icon img-icon ml3') . ' alt="' . esc_attr($label) . '" title="' . esc_attr($title) . '" decoding="async">'
|
||||
|
||||
: '<span class="badg badg-sm ml3 aksrt-identity-chip aksrt-identity-chip--success" title="' . esc_attr($title) . '"><i class="fa fa-check-circle" aria-hidden="true"></i> ' . esc_html($label) . '</span>';
|
||||
: '<span class="badg badg-sm ml3 aksrt-identity-chip aksrt-identity-chip--success" title="' . esc_attr($title) . '"><i class="fa fas fa-check-circle" aria-hidden="true"></i> ' . esc_html($label) . '</span>';
|
||||
|
||||
} elseif ($type === 'level' && !empty($args['level']) && $level_html === '') {
|
||||
if ($icon_url !== '') {
|
||||
@@ -195,7 +195,7 @@ if (!function_exists('aksrt_get_user_name')) {
|
||||
if ($icon_url !== '') {
|
||||
$medal_html = '<img' . aksrt_get_lazy_attr('lazy_other', $icon_url, 'medal-icon img-icon ml3 aksrt-identity-medal is-wear') . ' alt="' . esc_attr($label) . '" title="' . esc_attr($title) . '" decoding="async">';
|
||||
} else {
|
||||
$medal_html = '<span class="badg badg-sm ml3 aksrt-identity-chip is-wear" title="' . esc_attr($title) . '"><i class="fa fa-award" aria-hidden="true"></i> ' . esc_html($label) . '</span>';
|
||||
$medal_html = '<span class="badg badg-sm ml3 aksrt-identity-chip is-wear" title="' . esc_attr($title) . '"><i class="fa fas fa-trophy" aria-hidden="true"></i> ' . esc_html($label) . '</span>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -214,7 +214,7 @@ if (!function_exists('aksrt_get_user_name')) {
|
||||
if ($icon_url !== '') {
|
||||
$medal_html = '<img' . aksrt_get_lazy_attr('lazy_other', $icon_url, 'medal-icon img-icon ml3 aksrt-identity-medal') . ' alt="' . esc_attr($label) . '" title="' . esc_attr($title) . '" decoding="async">';
|
||||
} else {
|
||||
$medal_html = '<span class="badg badg-sm ml3 aksrt-identity-chip" title="' . esc_attr($title) . '"><i class="fa fa-award" aria-hidden="true"></i> ' . esc_html($label) . '</span>';
|
||||
$medal_html = '<span class="badg badg-sm ml3 aksrt-identity-chip" title="' . esc_attr($title) . '"><i class="fa fas fa-trophy" aria-hidden="true"></i> ' . esc_html($label) . '</span>';
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -223,10 +223,10 @@ if (!function_exists('aksrt_get_user_name')) {
|
||||
$follow_html = '';
|
||||
if (!empty($args['follow']) && get_current_user_id() !== $user_id) {
|
||||
if (is_user_logged_in()) {
|
||||
$follow_html = '<button type="button" class="focus-color ml10 follow flex0 but" data-aksrt-follow="' . (int) $user_id . '"><i class="fa fa-heart em09" aria-hidden="true"></i> ' . esc_html__('关注', 'aksrt') . '</button>';
|
||||
$follow_html = '<button type="button" class="focus-color ml10 follow flex0 but" data-aksrt-follow="' . (int) $user_id . '"><i class="fa fas fa-heart em09" aria-hidden="true"></i> ' . esc_html__('关注', 'aksrt') . '</button>';
|
||||
} else {
|
||||
$login = function_exists('aksrt_get_login_url') ? aksrt_get_login_url() : wp_login_url();
|
||||
$follow_html = '<a class="focus-color ml10 follow flex0 but" href="' . esc_url($login) . '"><i class="fa fa-heart em09" aria-hidden="true"></i> ' . esc_html__('关注', 'aksrt') . '</a>';
|
||||
$follow_html = '<a class="focus-color ml10 follow flex0 but" href="' . esc_url($login) . '"><i class="fa fas fa-heart em09" aria-hidden="true"></i> ' . esc_html__('关注', 'aksrt') . '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -293,10 +293,10 @@ if (!function_exists('aksrt_render_user_medal_entry')) {
|
||||
$label = $count > 0 ? sprintf(_n('%d枚徽章', '%d枚徽章', $count, 'aksrt'), $count) : __('获取徽章', 'aksrt');
|
||||
$icons_html = implode('', $icons);
|
||||
if ($icons_html === '') {
|
||||
$icons_html = '<span class="aksrt-medal-entry__fallback" aria-hidden="true"><i class="fas fa-award"></i></span>';
|
||||
$icons_html = '<span class="aksrt-medal-entry__fallback" aria-hidden="true"><i class="fa fas fa-trophy"></i></span>';
|
||||
}
|
||||
$classes = 'aksrt-medal-entry aksrt-medal-entry--' . sanitize_html_class($context);
|
||||
return '<button type="button" class="' . esc_attr($classes) . '" data-aksrt-badges-open data-aksrt-badges-user-id="' . (int) $user_id . '" data-aksrt-badges-can-wear="' . ($can_wear ? '1' : '0') . '" aria-label="' . esc_attr($label) . '"><span class="aksrt-medal-entry__icons">' . $icons_html . '</span><span class="aksrt-medal-entry__count">' . esc_html($label) . '</span><i class="fas fa-angle-right aksrt-medal-entry__arrow" aria-hidden="true"></i></button>';
|
||||
return '<button type="button" class="' . esc_attr($classes) . '" data-aksrt-badges-open data-aksrt-badges-user-id="' . (int) $user_id . '" data-aksrt-badges-can-wear="' . ($can_wear ? '1' : '0') . '" aria-label="' . esc_attr($label) . '"><span class="aksrt-medal-entry__icons">' . $icons_html . '</span><span class="aksrt-medal-entry__count">' . esc_html($label) . '</span><i class="fa fas fa-angle-right aksrt-medal-entry__arrow" aria-hidden="true"></i></button>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -414,7 +414,7 @@ if (!function_exists('aksrt_get_worn_medal_icon')) {
|
||||
|
||||
// Text fallback (rare): small pill labelled with badge text.
|
||||
$extra = $class !== '' ? ' ' . esc_attr($class) : '';
|
||||
return '<span class="badg badg-sm ml3 aksrt-identity-medal is-wear' . $extra . '" title="' . esc_attr($label) . '"><i class="fa fa-award" aria-hidden="true"></i> ' . esc_html($label) . '</span>';
|
||||
return '<span class="badg badg-sm ml3 aksrt-identity-medal is-wear' . $extra . '" title="' . esc_attr($label) . '"><i class="fa fas fa-trophy" aria-hidden="true"></i> ' . esc_html($label) . '</span>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -353,7 +353,7 @@ if (!function_exists('aksrt_link_get_search_cover')) :
|
||||
. '<i class="line-form-line"></i>'
|
||||
. '<div class="scale-placeholder">' . esc_html(sprintf(__('%s搜索', 'aksrt'), $cfg['name'])) . '</div>'
|
||||
. '<div class="abs-right muted-color"><button type="submit" tabindex="2" class="null" aria-label="' . esc_attr__('搜索', 'aksrt') . '">'
|
||||
. '<i class="fa fa-search" aria-hidden="true"></i></button></div>'
|
||||
. '<i class="fa fas fa-search" aria-hidden="true"></i></button></div>'
|
||||
. '</div></div></form></div>';
|
||||
$i++;
|
||||
}
|
||||
@@ -407,8 +407,8 @@ if (!function_exists('aksrt_submit_links_modal')) :
|
||||
$title = (string) $args['title'];
|
||||
$header = $title !== ''
|
||||
? '<div class="mb20"><button type="button" class="close" data-dismiss="modal" aria-label="' . esc_attr__('关闭', 'aksrt') . '">'
|
||||
. '<i class="fa fa-times" aria-hidden="true"></i></button>'
|
||||
. '<b class="modal-title flex ac"><span class="toggle-radius mr10 b-theme"><i class="fa fa-pencil-square-o" aria-hidden="true"></i></span>'
|
||||
. '<i class="fa fas fa-times" aria-hidden="true"></i></button>'
|
||||
. '<b class="modal-title flex ac"><span class="toggle-radius mr10 b-theme"><i class="fa fas fa-edit" aria-hidden="true"></i></span>'
|
||||
. esc_html($title) . '</b></div>'
|
||||
: '';
|
||||
|
||||
@@ -425,7 +425,7 @@ if (!function_exists('aksrt_submit_links_modal')) :
|
||||
$body .= '<div class="muted-box text-center">';
|
||||
$body .= '<div class="mb20 muted-3-color">' . esc_html__('请先登录', 'aksrt') . '</div>';
|
||||
$body .= '<p><a href="' . esc_url($sign_url) . '" class="signin-loader but c-blue padding-lg">'
|
||||
. '<i class="fa fa-fw fa-sign-in mr10" aria-hidden="true"></i>' . esc_html__('登录', 'aksrt') . '</a></p>';
|
||||
. '<i class="fa fas fa-fw fa-sign-in-alt mr10" aria-hidden="true"></i>' . esc_html__('登录', 'aksrt') . '</a></p>';
|
||||
if (class_exists('\AKSRT\Auth\OAuth') && method_exists(\AKSRT\Auth\OAuth::get_instance(), 'render_social_buttons')) {
|
||||
$social = (string) \AKSRT\Auth\OAuth::get_instance()->render_social_buttons(__('使用以下方式快速登录', 'aksrt'));
|
||||
if ($social !== '') {
|
||||
@@ -471,7 +471,7 @@ if (!function_exists('aksrt_submit_links_modal')) :
|
||||
. '<div class="px12 muted-2-color mb6">' . esc_html__('请选择正方形 LOGO,支持 jpg/png/gif', 'aksrt') . '</div></div>';
|
||||
$body .= '</div>';
|
||||
$body .= '<div class="text-right edit-footer">'
|
||||
. '<button type="submit" class="but c-blue padding-lg aksrt-links-submit-btn"><i class="fa fa-check" aria-hidden="true"></i>'
|
||||
. '<button type="submit" class="but c-blue padding-lg aksrt-links-submit-btn"><i class="fa fas fa-check" aria-hidden="true"></i>'
|
||||
. esc_html__('确认提交', 'aksrt') . '</button></div>';
|
||||
$body .= wp_nonce_field('aksrt_frontend_links_submit', '_wpnonce', false, false);
|
||||
$body .= '<input type="hidden" name="action" value="aksrt_frontend_links_submit">';
|
||||
|
||||
+18
-32
@@ -978,15 +978,15 @@ if (!function_exists('aksrt_get_pay_type_badge')) {
|
||||
$badges = [
|
||||
AKSRT_PAY_TYPE_READING => ['label' => __('付费阅读', 'aksrt'), 'color' => '#EF4444', 'icon' => 'fa-lock'],
|
||||
AKSRT_PAY_TYPE_DOWNLOAD => ['label' => __('付费下载', 'aksrt'), 'color' => '#F97316', 'icon' => 'fa-download'],
|
||||
AKSRT_PAY_TYPE_GALLERY => ['label' => __('付费图库', 'aksrt'), 'color' => '#10B981', 'icon' => 'fa-images'],
|
||||
AKSRT_PAY_TYPE_GALLERY => ['label' => __('付费图库', 'aksrt'), 'color' => '#10B981', 'icon' => 'fa-image'],
|
||||
AKSRT_PAY_TYPE_VIDEO => ['label' => __('付费视频', 'aksrt'), 'color' => '#8B5CF6', 'icon' => 'fa-play-circle'],
|
||||
AKSRT_PAY_TYPE_VIP => ['label' => __('VIP 专属', 'aksrt'), 'color' => '#3B82F6', 'icon' => 'fa-crown'],
|
||||
AKSRT_PAY_TYPE_VIP => ['label' => __('VIP 专属', 'aksrt'), 'color' => '#3B82F6', 'icon' => 'fa-certificate'],
|
||||
];
|
||||
|
||||
if (!isset($badges[$pay_type])) return '';
|
||||
$b = $badges[$pay_type];
|
||||
return sprintf(
|
||||
'<span class="aksrt-pay-badge" style="background:%s"><i class="fas %s"></i> %s</span>',
|
||||
'<span class="aksrt-pay-badge" style="background:%s"><i class="fa %s"></i> %s</span>',
|
||||
esc_attr($b['color']), esc_attr($b['icon']), esc_html($b['label'])
|
||||
);
|
||||
}
|
||||
@@ -1008,9 +1008,9 @@ if (!function_exists('aksrt_get_pay_service_html')) {
|
||||
$items = [];
|
||||
$text = trim((string) ($service['text'] ?? ''));
|
||||
$value = trim((string) ($service['value'] ?? ''));
|
||||
$icon = trim((string) ($service['icon'] ?? 'fas fa-check-circle'));
|
||||
$icon = trim((string) ($service['icon'] ?? 'fa fas fa-check-circle'));
|
||||
if ($icon === '') {
|
||||
$icon = 'fas fa-check-circle';
|
||||
$icon = 'fa fas fa-check-circle';
|
||||
}
|
||||
|
||||
// Support multi-line pay_service textarea (one bullet per line).
|
||||
@@ -1063,7 +1063,7 @@ if (!function_exists('aksrt_get_demo_link_html')) {
|
||||
}
|
||||
$text = __('查看演示', 'aksrt');
|
||||
return sprintf(
|
||||
'<a target="_blank" rel="nofollow noopener" href="%s" class="%s"><i class="fas fa-external-link-alt" aria-hidden="true"></i><span>%s</span></a>',
|
||||
'<a target="_blank" rel="nofollow noopener" href="%s" class="%s"><i class="fa fas fa-external-link-alt" aria-hidden="true"></i><span>%s</span></a>',
|
||||
esc_url($url),
|
||||
esc_attr($class),
|
||||
esc_html($text)
|
||||
@@ -1146,7 +1146,7 @@ if (!function_exists('aksrt_get_paywall_html')) {
|
||||
|
||||
$type_labels = [
|
||||
AKSRT_PAY_TYPE_READING => ['icon' => 'fa-lock', 'label' => __('付费阅读', 'aksrt'), 'desc' => __('付费后即可查看完整内容', 'aksrt')],
|
||||
AKSRT_PAY_TYPE_GALLERY => ['icon' => 'fa-images', 'label' => __('付费图库', 'aksrt'), 'desc' => __('付费后即可查看全部图片', 'aksrt')],
|
||||
AKSRT_PAY_TYPE_GALLERY => ['icon' => 'fa-image', 'label' => __('付费图库', 'aksrt'), 'desc' => __('付费后即可查看全部图片', 'aksrt')],
|
||||
AKSRT_PAY_TYPE_VIDEO => ['icon' => 'fa-play-circle', 'label' => __('付费视频', 'aksrt'), 'desc' => __('付费后即可观看完整视频', 'aksrt')],
|
||||
];
|
||||
|
||||
@@ -1169,7 +1169,7 @@ if (!function_exists('aksrt_get_paywall_html')) {
|
||||
<div class="aksrt-paywall<?php echo $is_fragment ? ' aksrt-paywall--fragment' : ''; ?>" data-post-id="<?php echo esc_attr((string) $post->ID); ?>" data-pay-type="<?php echo esc_attr($pay_type); ?>" data-pay-modo="<?php echo esc_attr($pay_modo); ?>">
|
||||
<div class="aksrt-paywall__card" role="group" aria-label="<?php esc_attr_e('付费内容购买', 'aksrt'); ?>">
|
||||
<div class="aksrt-paywall__icon">
|
||||
<i class="fas <?php echo esc_attr($type_info['icon']); ?>" aria-hidden="true"></i>
|
||||
<i class="fa <?php echo esc_attr($type_info['icon']); ?>" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="aksrt-paywall__body">
|
||||
<h3 class="aksrt-paywall__title"><?php echo esc_html($type_info['label']); ?></h3>
|
||||
@@ -1191,25 +1191,25 @@ if (!function_exists('aksrt_get_paywall_html')) {
|
||||
<?php if (!$is_logged_in) : ?>
|
||||
<?php if ($pay_limit <= 0 && $price > 0 && $pay_modo !== 'points' && function_exists('aksrt_allow_guest_content_pay') && aksrt_allow_guest_content_pay($post)) : ?>
|
||||
<button type="button" class="but <?php echo $pay_modo === 'points' ? 'jb-yellow' : 'jb-red'; ?> padding-lg cashier-link aksrt-paywall__btn" data-aksrt-pay-content="<?php echo esc_attr((string) $post->ID); ?>">
|
||||
<i class="fa fa-shopping-cart" aria-hidden="true"></i> <?php printf(esc_html__('游客购买(%s)', 'aksrt'), $price_text); ?>
|
||||
<i class="fa fas fa-shopping-cart" aria-hidden="true"></i> <?php printf(esc_html__('游客购买(%s)', 'aksrt'), $price_text); ?>
|
||||
</button>
|
||||
<a href="<?php echo esc_url($login_url); ?>" class="aksrt-paywall__login-link"><?php esc_html_e('已有账号?登录后购买', 'aksrt'); ?></a>
|
||||
<?php else : ?>
|
||||
<a href="<?php echo esc_url($login_url); ?>" class="but jb-red padding-lg aksrt-paywall__btn">
|
||||
<i class="fa fa-sign-in" aria-hidden="true"></i> <?php esc_html_e('登录后购买', 'aksrt'); ?>
|
||||
<i class="fa fas fa-sign-in-alt" aria-hidden="true"></i> <?php esc_html_e('登录后购买', 'aksrt'); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php elseif ($member_blocked) : ?>
|
||||
<a href="<?php echo esc_url($vip_url); ?>" class="but jb-vip padding-lg aksrt-paywall__btn">
|
||||
<i class="fas fa-crown" aria-hidden="true"></i> <?php esc_html_e('开通会员后可查看', 'aksrt'); ?>
|
||||
<i class="fa fas fa-certificate" aria-hidden="true"></i> <?php esc_html_e('开通会员后可查看', 'aksrt'); ?>
|
||||
</a>
|
||||
<?php elseif ($price > 0) : ?>
|
||||
<button type="button" class="but <?php echo $pay_modo === 'points' ? 'jb-yellow' : 'jb-red'; ?> padding-lg cashier-link aksrt-paywall__btn" data-aksrt-pay-content="<?php echo esc_attr((string) $post->ID); ?>">
|
||||
<i class="fa fa-shopping-cart" aria-hidden="true"></i> <?php printf(esc_html__('立即购买(%s)', 'aksrt'), $price_text); ?>
|
||||
<i class="fa fas fa-shopping-cart" aria-hidden="true"></i> <?php printf(esc_html__('立即购买(%s)', 'aksrt'), $price_text); ?>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<p class="aksrt-paywall__hint">
|
||||
<i class="fas fa-shield-alt" aria-hidden="true"></i> <?php esc_html_e('购买后永久有效,支持重复查看', 'aksrt'); ?>
|
||||
<i class="fa fas fa-shield-alt" aria-hidden="true"></i> <?php esc_html_e('购买后永久有效,支持重复查看', 'aksrt'); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1239,7 +1239,7 @@ if (!function_exists('aksrt_render_paid_gallery')) {
|
||||
<div class="aksrt-paid-gallery" data-post-id="<?php echo esc_attr((string) $post->ID); ?>">
|
||||
<?php if ($has_access) : ?>
|
||||
<!-- 已付费:Swiper 轮播 -->
|
||||
<div class="swiper aksrt-paid-gallery__swiper">
|
||||
<div class="new-swiper aksrt-paid-gallery__swiper" data-loop="true">
|
||||
<div class="swiper-wrapper">
|
||||
<?php foreach ($images as $img_url) : ?>
|
||||
<div class="swiper-slide">
|
||||
@@ -1258,7 +1258,7 @@ if (!function_exists('aksrt_render_paid_gallery')) {
|
||||
<img<?php echo aksrt_get_lazy_attr('lazy_other', (string) $images[0], 'aksrt-gallery-locked', aksrt_get_lazy_thumb('lg')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="">
|
||||
</div>
|
||||
<div class="aksrt-paid-gallery__overlay">
|
||||
<i class="fas fa-images" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-image" aria-hidden="true"></i>
|
||||
<p><?php
|
||||
printf(
|
||||
/* translators: %d: image count */
|
||||
@@ -1271,27 +1271,13 @@ if (!function_exists('aksrt_render_paid_gallery')) {
|
||||
<span class="aksrt-paid-gallery__price"><?php echo esc_html((string) $price_label['text']); ?></span>
|
||||
<?php endif; ?>
|
||||
<button type="button" class="but jb-red padding-lg cashier-link" data-aksrt-pay-content="<?php echo esc_attr((string) $post->ID); ?>">
|
||||
<i class="fa fa-shopping-cart" aria-hidden="true"></i> <?php esc_html_e('立即购买', 'aksrt'); ?>
|
||||
<i class="fa fas fa-shopping-cart" aria-hidden="true"></i> <?php esc_html_e('立即购买', 'aksrt'); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if ($has_access) : ?>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js"></script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
new Swiper('.aksrt-paid-gallery__swiper', {
|
||||
loop: true,
|
||||
pagination: { el: '.swiper-pagination', clickable: true },
|
||||
navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev' },
|
||||
lazy: true,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
return ob_get_clean();
|
||||
}
|
||||
@@ -1331,7 +1317,7 @@ if (!function_exists('aksrt_render_paid_video')) {
|
||||
<!-- 未付费:锁定预览(不输出真实视频地址) -->
|
||||
<div class="aksrt-paid-video__locked">
|
||||
<div class="aksrt-paid-video__placeholder">
|
||||
<i class="fas fa-play-circle" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-play-circle" aria-hidden="true"></i>
|
||||
<p><?php esc_html_e('付费后即可观看完整视频', 'aksrt'); ?></p>
|
||||
<?php $price_label = function_exists('aksrt_get_pay_price_label') ? aksrt_get_pay_price_label($post) : ['text' => '']; ?>
|
||||
<?php if (!empty($price_label['text'])) : ?>
|
||||
@@ -1339,7 +1325,7 @@ if (!function_exists('aksrt_render_paid_video')) {
|
||||
<?php endif; ?>
|
||||
<p style="margin-top:14px;">
|
||||
<button type="button" class="but jb-red padding-lg cashier-link" data-aksrt-pay-content="<?php echo esc_attr((string) $post->ID); ?>">
|
||||
<i class="fa fa-shopping-cart" aria-hidden="true"></i> <?php esc_html_e('立即购买', 'aksrt'); ?>
|
||||
<i class="fa fas fa-shopping-cart" aria-hidden="true"></i> <?php esc_html_e('立即购买', 'aksrt'); ?>
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -246,9 +246,9 @@ if (!function_exists('aksrt_resource_pay_type_badge')) {
|
||||
$badges = [
|
||||
'reading' => ['label' => __('付费阅读', 'aksrt'), 'color' => '#EF4444', 'icon' => 'fa-lock'],
|
||||
'download'=> ['label' => __('付费下载', 'aksrt'), 'color' => '#F97316', 'icon' => 'fa-download'],
|
||||
'gallery' => ['label' => __('付费图库', 'aksrt'), 'color' => '#10B981', 'icon' => 'fa-images'],
|
||||
'gallery' => ['label' => __('付费图库', 'aksrt'), 'color' => '#10B981', 'icon' => 'fa-image'],
|
||||
'video' => ['label' => __('付费视频', 'aksrt'), 'color' => '#8B5CF6', 'icon' => 'fa-play-circle'],
|
||||
'vip' => ['label' => __('VIP 专属', 'aksrt'), 'color' => '#3B82F6', 'icon' => 'fa-crown'],
|
||||
'vip' => ['label' => __('VIP 专属', 'aksrt'), 'color' => '#3B82F6', 'icon' => 'fa-certificate'],
|
||||
];
|
||||
|
||||
if ($pay_type === 'download' || !isset($badges[$pay_type])) {
|
||||
@@ -257,7 +257,7 @@ if (!function_exists('aksrt_resource_pay_type_badge')) {
|
||||
|
||||
$b = $badges[$pay_type];
|
||||
return sprintf(
|
||||
'<span class="resource-pay-type-badge" style="background:%s"><i class="fas %s"></i> %s</span>',
|
||||
'<span class="resource-pay-type-badge" style="background:%s"><i class="fa %s"></i> %s</span>',
|
||||
esc_attr($b['color']),
|
||||
esc_attr($b['icon']),
|
||||
esc_html($b['label'])
|
||||
@@ -549,14 +549,14 @@ if (!function_exists('aksrt_resource_meta_icon')) {
|
||||
*/
|
||||
function aksrt_resource_meta_icon(string $field): string {
|
||||
$icons = [
|
||||
'version' => 'fas fa-code-branch',
|
||||
'size' => 'fas fa-hdd',
|
||||
'compat' => 'fas fa-laptop',
|
||||
'license' => 'fas fa-shield-alt',
|
||||
'demo_url' => 'fas fa-external-link-alt',
|
||||
'download' => 'fas fa-download',
|
||||
'views' => 'fas fa-eye',
|
||||
'version' => 'fa fas fa-code-branch',
|
||||
'size' => 'fa fas fa-hdd',
|
||||
'compat' => 'fa fas fa-laptop',
|
||||
'license' => 'fa fas fa-shield-alt',
|
||||
'demo_url' => 'fa fas fa-external-link-alt',
|
||||
'download' => 'fa fas fa-download',
|
||||
'views' => 'fa fas fa-eye',
|
||||
];
|
||||
return $icons[$field] ?? 'fas fa-info-circle';
|
||||
return $icons[$field] ?? 'fa fas fa-info-circle';
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,7 @@ if (!function_exists('aksrt_get_rewards_button')) {
|
||||
$settings = \AKSRT\Settings\Settings::get_post_page_settings();
|
||||
$label = (string) ($settings['rewards_btn_text'] ?? __('赞赏', 'aksrt'));
|
||||
return sprintf(
|
||||
'<button type="button" class="%1$s aksrt-reward-open" data-aksrt-reward-open data-user-id="%2$d" data-post-id="%3$d"><i class="fa fa-gift em09" aria-hidden="true"></i> <span class="action-btn__label">%4$s</span></button>',
|
||||
'<button type="button" class="%1$s aksrt-reward-open" data-aksrt-reward-open data-user-id="%2$d" data-post-id="%3$d"><i class="fa fas fa-gift em09" aria-hidden="true"></i> <span class="action-btn__label">%4$s</span></button>',
|
||||
esc_attr($class),
|
||||
$user_id,
|
||||
$post_id,
|
||||
@@ -49,7 +49,7 @@ if (!function_exists('aksrt_render_rewards_modal_for_user')) {
|
||||
<div class="reward-modal" id="reward-modal-<?php echo (int) $user_id; ?>" data-user-id="<?php echo (int) $user_id; ?>" data-post-id="<?php echo (int) $post_id; ?>" aria-hidden="true">
|
||||
<div class="reward-modal__overlay" data-aksrt-reward-close></div>
|
||||
<div class="reward-modal__dialog" role="dialog" aria-modal="true" aria-labelledby="reward-title-<?php echo (int) $user_id; ?>">
|
||||
<button type="button" class="reward-modal__close" data-aksrt-reward-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><i class="fas fa-times" aria-hidden="true"></i></button>
|
||||
<button type="button" class="reward-modal__close" data-aksrt-reward-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><i class="fa fas fa-times" aria-hidden="true"></i></button>
|
||||
<div class="reward-modal__content">
|
||||
<h3 id="reward-title-<?php echo (int) $user_id; ?>"><?php echo esc_html((string) ($settings['rewards_text'] ?? __('赞赏', 'aksrt'))); ?></h3>
|
||||
<p class="muted-2-color em09"><?php printf(esc_html__('赞赏将直接进入 %s 的站内余额', 'aksrt'), esc_html($recipient ? $recipient->display_name : __('作者', 'aksrt'))); ?></p>
|
||||
|
||||
@@ -44,15 +44,10 @@ if (!function_exists('aksrt_get_float_pay_vip_html')) :
|
||||
|
||||
$icon = trim((string) ($item['icon'] ?? ''));
|
||||
if ($icon === '') {
|
||||
$icon = 'fas fa-gem';
|
||||
$icon = 'fa fas fa-gem';
|
||||
}
|
||||
// FA4 leftovers from older admin data.
|
||||
$icon = strtr($icon, [
|
||||
'fa-diamond' => 'fa-gem',
|
||||
'fa fa-' => 'fas fa-',
|
||||
]);
|
||||
if (!preg_match('/\b(fas|far|fab|fal|fad)\b/', $icon)) {
|
||||
$icon = 'fas ' . ltrim(preg_replace('/^fa\s+/', '', $icon) ?? $icon);
|
||||
if (!preg_match('/^fa\s+(?:fas|far|fab)\s+fa-[a-z0-9-]+(?:\s+fa-[a-z0-9-]+)*$/i', $icon)) {
|
||||
$icon = 'fa fas fa-gem';
|
||||
}
|
||||
|
||||
// Logged-in: open modal. Guest: open login.
|
||||
@@ -127,7 +122,7 @@ if (!function_exists('aksrt_get_win_runtime_config')) :
|
||||
'signup_url' => $signup,
|
||||
'ajax_url' => admin_url('admin-ajax.php'),
|
||||
'ajaxpager' => '1',
|
||||
'ajax_trigger' => (string) ($list_style['ajax_trigger'] ?? '<i class="fa fa-angle-right"></i>加载更多'),
|
||||
'ajax_trigger' => (string) ($list_style['ajax_trigger'] ?? '<i class="fa fas fa-angle-right"></i>加载更多'),
|
||||
'ajax_nomore' => (string) ($list_style['ajax_nomore'] ?? __('没有更多内容了', 'aksrt')),
|
||||
'qj_loading' => __('加载中...', 'aksrt'),
|
||||
'is_mobile' => $is_mobile ? '1' : '',
|
||||
|
||||
@@ -22,7 +22,7 @@ if (!function_exists('aksrt_single_render_overview_widget')) :
|
||||
?>
|
||||
<section class="zib-widget single-overview-widget" aria-labelledby="single-overview-title">
|
||||
<h3 id="single-overview-title" class="single-overview-widget__title">
|
||||
<i class="far fa-file-alt" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-file-alt" aria-hidden="true"></i>
|
||||
<?php esc_html_e('文章概览', 'aksrt'); ?>
|
||||
</h3>
|
||||
<dl class="single-overview-widget__list">
|
||||
@@ -33,7 +33,7 @@ if (!function_exists('aksrt_single_render_overview_widget')) :
|
||||
<div><dt><?php esc_html_e('评论', 'aksrt'); ?></dt><dd><a href="<?php echo esc_url(get_comments_link($post_id)); ?>"><?php echo esc_html(number_format_i18n((int) ($ctx['comment_count'] ?? 0))); ?></a></dd></div>
|
||||
<?php foreach ($overview_items as $item) : ?>
|
||||
<?php if (is_array($item) && !empty($item['text'])) : ?>
|
||||
<div><dt><i class="<?php echo esc_attr((string) ($item['icon'] ?? 'far fa-circle')); ?>" aria-hidden="true"></i></dt><dd><?php echo esc_html((string) $item['text']); ?></dd></div>
|
||||
<div><dt><i class="<?php echo esc_attr((string) ($item['icon'] ?? 'fa fas fa-circle')); ?>" aria-hidden="true"></i></dt><dd><?php echo esc_html((string) $item['text']); ?></dd></div>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($modified !== '') : ?>
|
||||
|
||||
@@ -74,12 +74,12 @@ if (!function_exists('aksrt_get_posts_meta_items_html')) :
|
||||
: get_comments_link($post_id);
|
||||
$count = (int) get_comments_number($post_id);
|
||||
$html .= '<span class="item meta-comm"><a rel="nofollow" href="' . esc_attr($href) . '" title="' . esc_attr__('去评论', 'aksrt') . '">'
|
||||
. '<i class="fa fa-comment-o" aria-hidden="true"></i> ' . esc_html((string) $count) . '</a></span>';
|
||||
. '<i class="fa fas fa-comment" aria-hidden="true"></i> ' . esc_html((string) $count) . '</a></span>';
|
||||
}
|
||||
|
||||
$views = function_exists('aksrt_get_post_views') ? (int) aksrt_get_post_views($post_id) : 0;
|
||||
$views_label = function_exists('aksrt_format_number') ? aksrt_format_number($views) : number_format_i18n($views);
|
||||
$html .= '<span class="item meta-view"><i class="fa fa-eye" aria-hidden="true"></i> ' . esc_html((string) $views_label) . '</span>';
|
||||
$html .= '<span class="item meta-view"><i class="fa fas fa-eye" aria-hidden="true"></i> ' . esc_html((string) $views_label) . '</span>';
|
||||
|
||||
$like_on = true;
|
||||
if (class_exists('\AKSRT\Settings\Settings')) {
|
||||
@@ -88,7 +88,7 @@ if (!function_exists('aksrt_get_posts_meta_items_html')) :
|
||||
}
|
||||
if ($like_on && $post->post_type === 'post') {
|
||||
$likes = function_exists('aksrt_get_post_likes') ? (int) aksrt_get_post_likes($post_id) : 0;
|
||||
$html .= '<span class="item meta-like"><i class="fa fa-heart-o" aria-hidden="true"></i> ' . esc_html((string) $likes) . '</span>';
|
||||
$html .= '<span class="item meta-like"><i class="fa fas fa-heart" aria-hidden="true"></i> ' . esc_html((string) $likes) . '</span>';
|
||||
}
|
||||
|
||||
return $html;
|
||||
@@ -131,16 +131,16 @@ if (!function_exists('aksrt_get_single_meta_box')) :
|
||||
|
||||
$more .= '<div class="clearfix ml6 post-drop-meta">';
|
||||
$more .= '<button type="button" class="but cir post-drop-meta__toggle" aria-haspopup="true" aria-expanded="false" aria-label="' . esc_attr__('更多', 'aksrt') . '">';
|
||||
$more .= '<i class="fa fa-ellipsis-h" aria-hidden="true"></i></button>';
|
||||
$more .= '<i class="fa fas fa-ellipsis-h" aria-hidden="true"></i></button>';
|
||||
$more .= '<div class="post-drop-meta__menu" aria-hidden="true">';
|
||||
if ($edit_link) {
|
||||
$more .= '<a href="' . esc_url($edit_link) . '" class="post-drop-meta__item"><i class="fa fa-edit" aria-hidden="true"></i><span>' . esc_html__('编辑文章', 'aksrt') . '</span></a>';
|
||||
$more .= '<a href="' . esc_url($edit_link) . '" class="post-drop-meta__item"><i class="fa fas fa-edit" aria-hidden="true"></i><span>' . esc_html__('编辑文章', 'aksrt') . '</span></a>';
|
||||
}
|
||||
$more .= '<button type="button" class="post-drop-meta__item" data-share-copy data-share-url="' . esc_url((string) $permalink) . '"><i class="fa fa-link" aria-hidden="true"></i><span>' . esc_html__('复制链接', 'aksrt') . '</span></button>';
|
||||
$more .= '<button type="button" class="post-drop-meta__item" data-share-copy data-share-url="' . esc_url((string) $permalink) . '"><i class="fa fas fa-link" aria-hidden="true"></i><span>' . esc_html__('复制链接', 'aksrt') . '</span></button>';
|
||||
if (is_user_logged_in()) {
|
||||
$more .= '<button type="button" class="post-drop-meta__item" data-aksrt-report=\'{"target_type":"post","target_id":' . (int) $post_id . '}\'><i class="fa fa-flag" aria-hidden="true"></i><span>' . esc_html__('举报', 'aksrt') . '</span></button>';
|
||||
$more .= '<button type="button" class="post-drop-meta__item" data-aksrt-report=\'{"target_type":"post","target_id":' . (int) $post_id . '}\'><i class="fa fas fa-flag" aria-hidden="true"></i><span>' . esc_html__('举报', 'aksrt') . '</span></button>';
|
||||
} else {
|
||||
$more .= '<a href="' . esc_url($login_url) . '" class="post-drop-meta__item"><i class="fa fa-flag" aria-hidden="true"></i><span>' . esc_html__('登录后举报', 'aksrt') . '</span></a>';
|
||||
$more .= '<a href="' . esc_url($login_url) . '" class="post-drop-meta__item"><i class="fa fas fa-flag" aria-hidden="true"></i><span>' . esc_html__('登录后举报', 'aksrt') . '</span></a>';
|
||||
}
|
||||
$more .= '</div></div>';
|
||||
|
||||
@@ -214,7 +214,7 @@ if (!function_exists('aksrt_get_single_article_tags_html')) :
|
||||
$cat_html = aksrt_get_colored_term_tags(
|
||||
$cats,
|
||||
'but ml6 radius',
|
||||
'<i class="fa fa-folder-open-o" aria-hidden="true"></i> ',
|
||||
'<i class="fa fas fa-folder-open" aria-hidden="true"></i> ',
|
||||
['c-blue', 'c-yellow', 'c-green', 'c-purple', 'c-red']
|
||||
);
|
||||
|
||||
@@ -379,7 +379,7 @@ if (!function_exists('aksrt_resolve_allow_view_rule')) :
|
||||
$data['not_html'] = aksrt_get_allow_view_deny_shell(
|
||||
__('内容已隐藏,请登录后查看', 'aksrt'),
|
||||
'<div class="text-center em09 mt20"><p class="separator muted-3-color mb20">' . esc_html__('登录后继续查看', 'aksrt') . '</p>'
|
||||
. '<p><a href="' . esc_url($login_url) . '" class="but jb-blue padding-lg"><i class="fa fa-fw fa-sign-in" aria-hidden="true"></i>' . esc_html__('登录', 'aksrt') . '</a></p></div>'
|
||||
. '<p><a href="' . esc_url($login_url) . '" class="but jb-blue padding-lg"><i class="fa fas fa-fw fa-sign-in-alt" aria-hidden="true"></i>' . esc_html__('登录', 'aksrt') . '</a></p></div>'
|
||||
);
|
||||
} else {
|
||||
$data['allow_reason'] = __('您已登录,可查看此内容', 'aksrt');
|
||||
@@ -450,7 +450,7 @@ if (!function_exists('aksrt_get_allow_view_deny_shell')) :
|
||||
function aksrt_get_allow_view_deny_shell(string $title, string $body_html): string {
|
||||
return '<div class="zib-widget text-center allow-view-deny">'
|
||||
. '<div class="box-body">'
|
||||
. '<p class="em12 muted-2-color mb10"><i class="fa fa-lock fa-2x" aria-hidden="true"></i></p>'
|
||||
. '<p class="em12 muted-2-color mb10"><i class="fa fas fa-lock fa-2x" aria-hidden="true"></i></p>'
|
||||
. '<h3 class="em12">' . esc_html($title) . '</h3>'
|
||||
. $body_html
|
||||
. '</div></div>';
|
||||
@@ -502,7 +502,7 @@ if (!function_exists('aksrt_render_related_graphic_card')) :
|
||||
$html .= '<div class="abs-center left-bottom graphic-text">';
|
||||
$html .= '<div class="text1 text-ellipsis">' . esc_html($title) . '</div>';
|
||||
$html .= '<div class="text3 muted-2-color em09"><span class="item">' . esc_html($time) . '</span>';
|
||||
$html .= '<span class="item pull-right"><i class="fa fa-eye" aria-hidden="true"></i> ' . esc_html((string) $views_label) . '</span></div>';
|
||||
$html .= '<span class="item pull-right"><i class="fa fas fa-eye" aria-hidden="true"></i> ' . esc_html((string) $views_label) . '</span></div>';
|
||||
$html .= '</div></div></a></div></div>';
|
||||
return $html;
|
||||
}
|
||||
|
||||
@@ -53,9 +53,9 @@ if (!function_exists('aksrt_single_render_cover')) :
|
||||
}
|
||||
$ep_count = count($episodes);
|
||||
if ($ep_count > 1) : ?>
|
||||
<span class="badg badg-sm b-theme mr6"><i class="fa fa-play-circle mr3" aria-hidden="true"></i><?php printf(esc_html__('共%d集', 'aksrt'), $ep_count); ?></span>
|
||||
<span class="badg badg-sm b-theme mr6"><i class="fa fas fa-play-circle mr3" aria-hidden="true"></i><?php printf(esc_html__('共%d集', 'aksrt'), $ep_count); ?></span>
|
||||
<?php else : ?>
|
||||
<i class="fa fa-play-circle-o mr6 opacity8" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-play-circle mr6 opacity8" aria-hidden="true"></i>
|
||||
<?php endif; ?>
|
||||
<?php echo $title_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</h1>
|
||||
@@ -179,7 +179,7 @@ if (!function_exists('aksrt_single_render_box_header')) :
|
||||
?>
|
||||
<div class="article-reading-meta" aria-label="<?php esc_attr_e('阅读信息', 'aksrt'); ?>">
|
||||
<?php foreach ($reading_meta as $item) : ?>
|
||||
<span><i class="<?php echo esc_attr((string) ($item['icon'] ?? 'far fa-file-alt')); ?>" aria-hidden="true"></i><?php echo esc_html((string) ($item['text'] ?? '')); ?></span>
|
||||
<span><i class="<?php echo esc_attr((string) ($item['icon'] ?? 'fa fas fa-file-alt')); ?>" aria-hidden="true"></i><?php echo esc_html((string) ($item['text'] ?? '')); ?></span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -209,12 +209,12 @@ if (!function_exists('aksrt_render_share_dropdown')) :
|
||||
data-share-url="<?php echo esc_url($url); ?>"
|
||||
<?php if ($image !== '') : ?>data-share-image="<?php echo esc_url($image); ?>"<?php endif; ?>>
|
||||
<div class="share-dropdown__grid">
|
||||
<button type="button" class="share-item" data-platform="qq"><i class="fab fa-qq"></i><span>QQ</span></button>
|
||||
<button type="button" class="share-item" data-platform="weibo"><i class="fab fa-weibo"></i><span>微博</span></button>
|
||||
<button type="button" class="share-item" data-platform="twitter"><i class="fab fa-twitter"></i><span>X</span></button>
|
||||
<button type="button" class="share-item" data-platform="wechat"><i class="fab fa-weixin"></i><span>微信</span></button>
|
||||
<button type="button" class="share-item" data-platform="copy"><i class="fas fa-link"></i><span><?php esc_html_e('复制链接', 'aksrt'); ?></span></button>
|
||||
<button type="button" class="share-item" data-platform="poster"><i class="fas fa-image"></i><span><?php esc_html_e('海报分享', 'aksrt'); ?></span></button>
|
||||
<button type="button" class="share-item" data-platform="qq"><i class="fa fab fa-qq"></i><span>QQ</span></button>
|
||||
<button type="button" class="share-item" data-platform="weibo"><i class="fa fab fa-weibo"></i><span>微博</span></button>
|
||||
<button type="button" class="share-item" data-platform="twitter"><i class="fa fab fa-twitter"></i><span>X</span></button>
|
||||
<button type="button" class="share-item" data-platform="wechat"><i class="fa fab fa-weixin"></i><span>微信</span></button>
|
||||
<button type="button" class="share-item" data-platform="copy"><i class="fa fas fa-link"></i><span><?php esc_html_e('复制链接', 'aksrt'); ?></span></button>
|
||||
<button type="button" class="share-item" data-platform="poster"><i class="fa fas fa-image"></i><span><?php esc_html_e('海报分享', 'aksrt'); ?></span></button>
|
||||
</div>
|
||||
<div id="share-qrcode-box" aria-hidden="true"><img id="share-qrcode-image" src="" alt="QR Code"></div>
|
||||
</div>
|
||||
@@ -241,7 +241,7 @@ if (!function_exists('aksrt_single_render_actions')) :
|
||||
<div class="text-center post-actions">
|
||||
<?php if (!empty($settings['like_enabled'])) : ?>
|
||||
<button type="button" class="action action-like<?php echo $is_liked ? ' is-active' : ''; ?>" id="action-like" data-post-id="<?php echo esc_attr((string) $post_id); ?>" data-initial-active="<?php echo $is_liked ? '1' : '0'; ?>">
|
||||
<i class="<?php echo $is_liked ? 'fas' : 'far'; ?> fa-heart" aria-hidden="true"></i>
|
||||
<i class="<?php echo $is_liked ? 'fa' : 'fa'; ?> fa-heart" aria-hidden="true"></i>
|
||||
<span class="action-btn__count" data-stat-count="likes" data-base-count="<?php echo esc_attr((string) $like_count); ?>"><?php echo esc_html((string) $like_count); ?></span>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
@@ -259,14 +259,14 @@ if (!function_exists('aksrt_single_render_actions')) :
|
||||
|
||||
<?php if (!empty($settings['share_enabled'])) : ?>
|
||||
<button type="button" class="action action-share" id="action-share-trigger" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fas fa-share-alt" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-share-alt" aria-hidden="true"></i>
|
||||
<span class="action-btn__label"><?php esc_html_e('分享', 'aksrt'); ?></span>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($settings['favorite_enabled'])) : ?>
|
||||
<button type="button" class="action action-favorite<?php echo $is_favorited ? ' is-active' : ''; ?>" id="action-favorite" data-post-id="<?php echo esc_attr((string) $post_id); ?>" data-initial-active="<?php echo $is_favorited ? '1' : '0'; ?>">
|
||||
<i class="<?php echo $is_favorited ? 'fas' : 'far'; ?> fa-star" aria-hidden="true"></i>
|
||||
<i class="<?php echo $is_favorited ? 'fa' : 'fa'; ?> fa-star" aria-hidden="true"></i>
|
||||
<span class="action-btn__count" data-stat-count="favorites" data-base-count="<?php echo esc_attr((string) $favorite_count); ?>"><?php echo esc_html((string) $favorite_count); ?></span>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
@@ -442,16 +442,16 @@ if (!function_exists('aksrt_single_render_author_card')) :
|
||||
<?php else : ?>
|
||||
<?php if (is_user_logged_in()) : ?>
|
||||
<button type="button" class="but pw-1em mr6 c-red follow" data-aksrt-follow="<?php echo (int) $author_id; ?>">
|
||||
<i class="fa fa-heart em09" aria-hidden="true"></i> <span><?php esc_html_e('关注', 'aksrt'); ?></span>
|
||||
<i class="fa fas fa-heart em09" aria-hidden="true"></i> <span><?php esc_html_e('关注', 'aksrt'); ?></span>
|
||||
</button>
|
||||
<?php else : ?>
|
||||
<a href="<?php echo esc_url($login_url); ?>" class="but pw-1em mr6 c-red follow">
|
||||
<i class="fa fa-heart em09" aria-hidden="true"></i> <span><?php esc_html_e('关注', 'aksrt'); ?></span>
|
||||
<i class="fa fas fa-heart em09" aria-hidden="true"></i> <span><?php esc_html_e('关注', 'aksrt'); ?></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if (is_user_logged_in() && $aksrt_pm_on && $aksrt_msg_url !== '') : ?>
|
||||
<a class="but pw-1em mr6 c-blue" href="<?php echo esc_url(add_query_arg('msg_type', 'conversation', $aksrt_msg_url)); ?>">
|
||||
<i class="fa fa-comment em09" aria-hidden="true"></i> <?php esc_html_e('私信', 'aksrt'); ?>
|
||||
<i class="fa fas fa-comment em09" aria-hidden="true"></i> <?php esc_html_e('私信', 'aksrt'); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
@@ -542,13 +542,13 @@ if (!function_exists('aksrt_single_render_prevnext')) :
|
||||
<nav class="article-nav">
|
||||
<div class="main-bg box-body radius8 main-shadow">
|
||||
<a href="<?php echo $prev ? esc_url($prev_href) : 'javascript:;'; ?>">
|
||||
<p class="muted-2-color"><i class="fa fa-angle-left em12" aria-hidden="true"></i><i class="fa fa-angle-left em12 mr6" aria-hidden="true"></i><?php esc_html_e('上一篇', 'aksrt'); ?></p>
|
||||
<p class="muted-2-color"><i class="fa fas fa-angle-left em12" aria-hidden="true"></i><i class="fa fas fa-angle-left em12 mr6" aria-hidden="true"></i><?php esc_html_e('上一篇', 'aksrt'); ?></p>
|
||||
<div class="text-ellipsis-2"><?php echo esc_html($prev_title); ?></div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="main-bg box-body radius8 main-shadow">
|
||||
<a href="<?php echo $next ? esc_url($next_href) : 'javascript:;'; ?>">
|
||||
<p class="muted-2-color"><?php esc_html_e('下一篇', 'aksrt'); ?><i class="fa fa-angle-right em12 ml6" aria-hidden="true"></i><i class="fa fa-angle-right em12" aria-hidden="true"></i></p>
|
||||
<p class="muted-2-color"><?php esc_html_e('下一篇', 'aksrt'); ?><i class="fa fas fa-angle-right em12 ml6" aria-hidden="true"></i><i class="fa fas fa-angle-right em12" aria-hidden="true"></i></p>
|
||||
<div class="text-ellipsis-2"><?php echo esc_html($next_title); ?></div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -41,13 +41,13 @@ if (!function_exists('aksrt_single_build_context')) :
|
||||
$meta_items_secondary = [];
|
||||
if ($word_count > 0) {
|
||||
$meta_items_secondary[] = [
|
||||
'icon' => 'far fa-file-word',
|
||||
'icon' => 'fa fas fa-file-word',
|
||||
'text' => sprintf(__('约 %s 字', 'aksrt'), number_format_i18n($word_count)),
|
||||
];
|
||||
}
|
||||
if ($reading_minutes > 0) {
|
||||
$meta_items_secondary[] = [
|
||||
'icon' => 'far fa-hourglass',
|
||||
'icon' => 'fa fas fa-hourglass',
|
||||
'text' => sprintf(_n('约 %d 分钟', '约 %d 分钟', $reading_minutes, 'aksrt'), $reading_minutes),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ if (!function_exists('aksrt_render_user_card_posts')) :
|
||||
echo '<span class="aksrt-more-post-card__meta muted-2-color em09">';
|
||||
echo '<item>' . esc_html($time) . '</item>';
|
||||
if ($views > 0) {
|
||||
echo '<item class="pull-right"><i class="fa fa-eye" aria-hidden="true"></i> ' . esc_html((string) $views) . '</item>';
|
||||
echo '<item class="pull-right"><i class="fa fas fa-eye" aria-hidden="true"></i> ' . esc_html((string) $views) . '</item>';
|
||||
}
|
||||
echo '</span></span></a></div>';
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ function aksrt_render_vip_badge(int $user_id = 0, string $size = 'sm'): string {
|
||||
}
|
||||
$icon = $icon_url !== ''
|
||||
? '<img' . aksrt_get_lazy_attr('lazy_other', $icon_url, 'aksrt-vip-badge__icon') . ' alt="" decoding="async">'
|
||||
: '<i class="fas fa-crown" aria-hidden="true"></i>';
|
||||
: '<i class="fa fas fa-certificate" aria-hidden="true"></i>';
|
||||
|
||||
return '<span class="aksrt-vip-badge aksrt-vip-badge--gold ' . esc_attr($size_class . ' ' . $level_class) . '" title="' . esc_attr($badge_text) . '">' . $icon . '</span>';
|
||||
}
|
||||
|
||||
@@ -47,12 +47,12 @@ if (!function_exists('aksrt_get_input_expand_but')) :
|
||||
foreach ($map as $key => $url) {
|
||||
$icons .= '<a class="smilie-icon" href="javascript:;" data-smilie="' . esc_attr((string) $key) . '"><img' . aksrt_get_lazy_attr('lazy_comment', (string) $url, '', aksrt_get_lazy_thumb('sm')) . ' alt="[' . esc_attr((string) $key) . ']" width="28" height="28"></a>';
|
||||
}
|
||||
$but = '<a class="but btn-input-expand input-smilie mr6" href="javascript:;" data-toggle-class="open" data-target=".dropdown-smilie-wrap" title="' . esc_attr__('表情', 'aksrt') . '"><i class="fa fa-fw fa-smile-o" aria-hidden="true"></i><span class="hide-sm">' . esc_html__('表情', 'aksrt') . '</span></a>';
|
||||
$but = '<a class="but btn-input-expand input-smilie mr6" href="javascript:;" data-toggle-class="open" data-target=".dropdown-smilie-wrap" title="' . esc_attr__('表情', 'aksrt') . '"><i class="fa fas fa-fw fa-smile" aria-hidden="true"></i><span class="hide-sm">' . esc_html__('表情', 'aksrt') . '</span></a>';
|
||||
$drop = '<div class="dropdown-smilie-wrap relative dropup"><div class="dropdown-smilie scroll-y mini-scrollbar dropdown-menu">' . $icons . '</div></div>';
|
||||
return '<span class="dropup relative input-expand-wrap input-expand-smilie">' . $but . $drop . '</span>';
|
||||
|
||||
case 'code':
|
||||
$but = '<a class="but btn-input-expand input-code mr6" href="javascript:;" data-toggle-class="open" data-target=".dropdown-code" title="' . esc_attr__('代码', 'aksrt') . '"><i class="fa fa-fw fa-code" aria-hidden="true"></i><span class="hide-sm">' . esc_html__('代码', 'aksrt') . '</span></a>';
|
||||
$but = '<a class="but btn-input-expand input-code mr6" href="javascript:;" data-toggle-class="open" data-target=".dropdown-code" title="' . esc_attr__('代码', 'aksrt') . '"><i class="fa fas fa-fw fa-code" aria-hidden="true"></i><span class="hide-sm">' . esc_html__('代码', 'aksrt') . '</span></a>';
|
||||
$drop = '<div class="dropdown-code dropdown-menu box-body" style="width:280px;">'
|
||||
. '<p class="muted-2-color em09 mb6">' . esc_html__('插入代码块', 'aksrt') . '</p>'
|
||||
. '<textarea class="form-control mb6" rows="4" placeholder="' . esc_attr__('粘贴代码…', 'aksrt') . '"></textarea>'
|
||||
@@ -62,7 +62,7 @@ if (!function_exists('aksrt_get_input_expand_but')) :
|
||||
|
||||
case 'image':
|
||||
$upload = !empty($arg1) || !empty($ctx['upload']);
|
||||
$but = '<a class="but btn-input-expand input-image mr6" href="javascript:;" data-toggle-class="open" data-target=".dropdown-image" title="' . esc_attr__('图片', 'aksrt') . '"><i class="fa fa-fw fa-image" aria-hidden="true"></i><span class="hide-sm">' . esc_html__('图片', 'aksrt') . '</span></a>';
|
||||
$but = '<a class="but btn-input-expand input-image mr6" href="javascript:;" data-toggle-class="open" data-target=".dropdown-image" title="' . esc_attr__('图片', 'aksrt') . '"><i class="fa fas fa-fw fa-image" aria-hidden="true"></i><span class="hide-sm">' . esc_html__('图片', 'aksrt') . '</span></a>';
|
||||
$upload_btn = $upload
|
||||
? '<button type="button" class="but hollow mr6 input-image-upload" data-toolbar-action="upload-image">' . esc_html__('上传', 'aksrt') . '</button>'
|
||||
: '';
|
||||
@@ -92,7 +92,7 @@ if (!function_exists('aksrt_get_input_expand_but')) :
|
||||
foreach ($phrases as $p) {
|
||||
$items .= '<a class="quick-reply-item" href="javascript:;" data-text="' . esc_attr((string) $p) . '">' . esc_html((string) $p) . '</a>';
|
||||
}
|
||||
$but = '<a class="but btn-input-expand input-quick mr6" href="javascript:;" data-toggle-class="open" data-target=".dropdown-quick" title="' . esc_attr__('快捷', 'aksrt') . '"><i class="fa fa-fw fa-bolt" aria-hidden="true"></i><span class="hide-sm">' . esc_html__('快捷', 'aksrt') . '</span></a>';
|
||||
$but = '<a class="but btn-input-expand input-quick mr6" href="javascript:;" data-toggle-class="open" data-target=".dropdown-quick" title="' . esc_attr__('快捷', 'aksrt') . '"><i class="fa fas fa-fw fa-bolt" aria-hidden="true"></i><span class="hide-sm">' . esc_html__('快捷', 'aksrt') . '</span></a>';
|
||||
$drop = '<div class="dropdown-quick dropdown-menu box-body scroll-y mini-scrollbar" style="max-height:220px;min-width:160px;">' . $items . '</div>';
|
||||
return '<span class="dropup relative input-expand-wrap input-expand-quick">' . $but . $drop . '</span>';
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ if (!function_exists('aksrt_get_comment_like_html')) :
|
||||
$is_liked ? '1' : '0',
|
||||
$comment_id,
|
||||
$is_liked ? 'true' : 'false',
|
||||
$is_liked ? 'fas' : 'far',
|
||||
$is_liked ? 'fa' : 'fa',
|
||||
$like_count > 0 ? '' : ' hidden',
|
||||
esc_html($count_attr)
|
||||
);
|
||||
@@ -51,7 +51,7 @@ if (!function_exists('aksrt_get_comments_user_name_html')) :
|
||||
|
||||
$topping = '';
|
||||
if ($is_pinned) {
|
||||
$topping = '<badge class="badge-topping badge-topping jb-blue mr6 flex0 aksrt-comment__badge aksrt-comment__badge--pinned" title="' . esc_attr__('置顶评论', 'aksrt') . '"><i class="fas fa-thumbtack" aria-hidden="true"></i></badge>';
|
||||
$topping = '<badge class="badge-topping badge-topping jb-blue mr6 flex0 aksrt-comment__badge aksrt-comment__badge--pinned" title="' . esc_attr__('置顶评论', 'aksrt') . '"><i class="fa fas fa-thumbtack" aria-hidden="true"></i></badge>';
|
||||
}
|
||||
|
||||
if ($user_id > 0) {
|
||||
@@ -71,7 +71,7 @@ if (!function_exists('aksrt_get_comments_user_name_html')) :
|
||||
$badges .= '<span class="badg c-green badg-sm flex0 ml3 aksrt-comment__badge">' . esc_html__('作者', 'aksrt') . '</span>';
|
||||
}
|
||||
if (function_exists('aksrt_is_blog_comment_hot') && aksrt_is_blog_comment_hot($comment)) {
|
||||
$badges .= '<span class="badg c-yellow badg-sm flex0 ml3 aksrt-comment__badge aksrt-comment__badge--hot"><i class="fas fa-fire" aria-hidden="true"></i> ' . esc_html__('神评', 'aksrt') . '</span>';
|
||||
$badges .= '<span class="badg c-yellow badg-sm flex0 ml3 aksrt-comment__badge aksrt-comment__badge--hot"><i class="fa fas fa-fire" aria-hidden="true"></i> ' . esc_html__('神评', 'aksrt') . '</span>';
|
||||
}
|
||||
|
||||
return '<name class="flex ac flex1">' . $topping . $name . $badges . '</name>';
|
||||
@@ -112,21 +112,21 @@ if (!function_exists('aksrt_get_comments_action_dropdown_html')) :
|
||||
|
||||
if (!empty($perms['can_pin']) && (int) $comment->comment_parent === 0) {
|
||||
$label = $is_pinned ? __('取消置顶', 'aksrt') : __('设置置顶', 'aksrt');
|
||||
$lists .= '<li><a href="javascript:;" class="comment-topping-link" data-comment-action="pin" data-pinned="' . ($is_pinned ? '1' : '0') . '"><i class="fas fa-thumbtack fa-fw mr10" aria-hidden="true"></i>' . esc_html($label) . '</a></li>';
|
||||
$lists .= '<li><a href="javascript:;" class="comment-topping-link" data-comment-action="pin" data-pinned="' . ($is_pinned ? '1' : '0') . '"><i class="fa fas fa-thumbtack fa-fw mr10" aria-hidden="true"></i>' . esc_html($label) . '</a></li>';
|
||||
}
|
||||
if (!empty($perms['can_edit'])) {
|
||||
$lists .= '<li><a href="javascript:;" class="comment-edit-link" data-comment-action="edit" data-commentid="' . (int) $comment->comment_ID . '" data-postid="' . (int) $comment->comment_post_ID . '"><i class="fa fa-edit fa-fw mr10" aria-hidden="true"></i>' . esc_html__('编辑', 'aksrt') . '</a></li>';
|
||||
$lists .= '<li><a href="javascript:;" class="comment-edit-link" data-comment-action="edit" data-commentid="' . (int) $comment->comment_ID . '" data-postid="' . (int) $comment->comment_post_ID . '"><i class="fa fas fa-edit fa-fw mr10" aria-hidden="true"></i>' . esc_html__('编辑', 'aksrt') . '</a></li>';
|
||||
}
|
||||
if (!empty($perms['can_moderate'])) {
|
||||
if ($is_pending) {
|
||||
$lists .= '<li><a href="javascript:;" class="comment-approve-link approve" data-comment-action="approve"><i class="fas fa-check fa-fw mr10" aria-hidden="true"></i><text>' . esc_html__('批准', 'aksrt') . '</text></a></li>';
|
||||
$lists .= '<li><a href="javascript:;" class="comment-approve-link approve" data-comment-action="approve"><i class="fa fas fa-check fa-fw mr10" aria-hidden="true"></i><text>' . esc_html__('批准', 'aksrt') . '</text></a></li>';
|
||||
} elseif (!$is_spam) {
|
||||
$lists .= '<li><a href="javascript:;" class="comment-approve-link unapprove" data-comment-action="hold"><i class="fas fa-eye-slash fa-fw mr10" aria-hidden="true"></i><text>' . esc_html__('驳回', 'aksrt') . '</text></a></li>';
|
||||
$lists .= '<li><a href="javascript:;" class="comment-approve-link unapprove" data-comment-action="hold"><i class="fa fas fa-eye-slash fa-fw mr10" aria-hidden="true"></i><text>' . esc_html__('驳回', 'aksrt') . '</text></a></li>';
|
||||
}
|
||||
$lists .= '<li><a href="javascript:;" class="comment-spam-link" data-comment-action="spam"><i class="fas fa-ban fa-fw mr10" aria-hidden="true"></i>' . esc_html__('垃圾', 'aksrt') . '</a></li>';
|
||||
$lists .= '<li><a href="javascript:;" class="comment-spam-link" data-comment-action="spam"><i class="fa fas fa-ban fa-fw mr10" aria-hidden="true"></i>' . esc_html__('垃圾', 'aksrt') . '</a></li>';
|
||||
}
|
||||
if (!empty($perms['can_delete'])) {
|
||||
$lists .= '<li><a href="javascript:;" class="comment-trash-link c-red" data-comment-action="delete" data-commentid="' . (int) $comment->comment_ID . '"><i class="fa fa-trash-o fa-fw mr10" aria-hidden="true"></i>' . esc_html__('删除', 'aksrt') . '</a></li>';
|
||||
$lists .= '<li><a href="javascript:;" class="comment-trash-link c-red" data-comment-action="delete" data-commentid="' . (int) $comment->comment_ID . '"><i class="fa fas fa-trash-alt fa-fw mr10" aria-hidden="true"></i>' . esc_html__('删除', 'aksrt') . '</a></li>';
|
||||
}
|
||||
|
||||
if ($lists === '') {
|
||||
@@ -134,7 +134,7 @@ if (!function_exists('aksrt_get_comments_action_dropdown_html')) :
|
||||
}
|
||||
|
||||
return '<span class="dropdown drop-fixed-sm padding-6 comment-action-dropdown">'
|
||||
. '<a href="javascript:;" class="muted-color padding-6" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" aria-label="' . esc_attr__('更多操作', 'aksrt') . '"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></a>'
|
||||
. '<a href="javascript:;" class="muted-color padding-6" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" aria-label="' . esc_attr__('更多操作', 'aksrt') . '"><i class="fa fas fa-ellipsis-h" aria-hidden="true"></i></a>'
|
||||
. '<ul class="dropdown-menu">' . $lists . '</ul>'
|
||||
. '</span>';
|
||||
}
|
||||
|
||||
@@ -12,12 +12,11 @@ if (!function_exists('aksrt_ajax_menu_search')) :
|
||||
* AJAX: HTML panel for navbar inline search (history + hot + posts).
|
||||
*/
|
||||
function aksrt_ajax_menu_search(): void {
|
||||
// Prefer public nonce; also accept no nonce for same-origin remote-box first paint like zibll.
|
||||
if (!empty($_REQUEST['nonce'])) {
|
||||
$nonce = sanitize_text_field(wp_unslash((string) $_REQUEST['nonce']));
|
||||
if (!wp_verify_nonce($nonce, 'aksrt_public_nonce')) {
|
||||
wp_die('0');
|
||||
}
|
||||
$nonce = isset($_REQUEST['nonce'])
|
||||
? sanitize_text_field(wp_unslash((string) $_REQUEST['nonce']))
|
||||
: '';
|
||||
if (!wp_verify_nonce($nonce, 'aksrt_public_nonce')) {
|
||||
wp_die('0');
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_get_search_box')) {
|
||||
@@ -56,26 +55,75 @@ if (!function_exists('aksrt_ajax_menu_search')) :
|
||||
}
|
||||
endif;
|
||||
|
||||
// Panel builder retained as thin alias for any external callers.
|
||||
if (!function_exists('aksrt_get_menu_search_panel_html')) :
|
||||
if (!function_exists('aksrt_ajax_search_box')) :
|
||||
/**
|
||||
* @return string Inner HTML (without dropdown wrapper).
|
||||
* AJAX: full Zibll search box loaded into the footer shell on first open.
|
||||
*/
|
||||
function aksrt_get_menu_search_panel_html(): string {
|
||||
if (!function_exists('aksrt_get_search_box')) {
|
||||
return '';
|
||||
function aksrt_ajax_search_box(): void {
|
||||
$nonce = isset($_REQUEST['nonce'])
|
||||
? sanitize_text_field(wp_unslash((string) $_REQUEST['nonce']))
|
||||
: '';
|
||||
if (!wp_verify_nonce($nonce, 'aksrt_public_nonce') || !function_exists('aksrt_get_search_box')) {
|
||||
wp_die('0');
|
||||
}
|
||||
return (string) aksrt_get_search_box([
|
||||
'show_form' => false,
|
||||
'show_keywords' => true,
|
||||
'show_history' => true,
|
||||
'show_posts' => true,
|
||||
|
||||
echo aksrt_get_search_box([ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
'show_form' => true,
|
||||
'show_keywords' => !class_exists('\\AKSRT\\Settings\\Settings') || \AKSRT\Settings\Settings::hot_search_enabled(),
|
||||
'show_history' => !class_exists('\\AKSRT\\Settings\\Settings') || \AKSRT\Settings\Settings::search_history_enabled(),
|
||||
'show_posts' => !class_exists('\\AKSRT\\Settings\\Settings') || \AKSRT\Settings\Settings::search_posts_enabled(),
|
||||
'show_type' => !class_exists('\\AKSRT\\Settings\\Settings') || (bool) \AKSRT\Settings\Settings::get_value('search_type', true),
|
||||
'show_input_cat' => !class_exists('\\AKSRT\\Settings\\Settings') || \AKSRT\Settings\Settings::search_cat_enabled(),
|
||||
]);
|
||||
wp_die();
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_footer_navbar_search')) :
|
||||
/**
|
||||
* Zibll footer search shell. The heavy search body is loaded once via remote-box.
|
||||
*/
|
||||
function aksrt_footer_navbar_search(): void {
|
||||
$show_on_404 = class_exists('\\AKSRT\\Settings\\Settings')
|
||||
? (bool) \AKSRT\Settings\Settings::get_value('404_search_s', true)
|
||||
: true;
|
||||
if (is_search() || (is_404() && $show_on_404)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$remote = aksrt_get_remote_box([
|
||||
'type' => 'load',
|
||||
'class' => '',
|
||||
'loader' => '<div class="search-input"><p><i class="placeholder s1 mr6"></i><i class="placeholder s1 mr6"></i><i class="placeholder s1 mr6"></i></p><p class="placeholder k2"></p><p class="placeholder t1"></p><p><i class="placeholder s1 mr6"></i><i class="placeholder s1 mr6"></i><i class="placeholder s1 mr6"></i><i class="placeholder s1 mr6"></i></p><p class="placeholder k1"></p><p class="placeholder t1"></p><p></p><p class="placeholder k1" style="height:80px;"></p></div>',
|
||||
'query' => [
|
||||
'action' => 'search_box',
|
||||
'nonce' => wp_create_nonce('aksrt_public_nonce'),
|
||||
],
|
||||
]);
|
||||
|
||||
echo '<div mini-touch="nav_search" touch-direction="top" class="main-search fixed-body main-bg box-body navbar-search nopw-sm">';
|
||||
echo '<div class="container">';
|
||||
echo '<div class="mb20 search-close-box"><button type="button" class="but cir" data-toggle-class data-target=".navbar-search" aria-label="'
|
||||
. esc_attr__('关闭搜索', 'aksrt') . '"><svg class="ic-close" aria-hidden="true"><use xlink:href="#icon-close"></use></svg></button></div>';
|
||||
echo $remote; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo '</div></div>';
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_ajax_zibll_current_user_ping')) :
|
||||
/** Satisfy the reference runtime's one-shot user-state refresh request. */
|
||||
function aksrt_ajax_zibll_current_user_ping(): void {
|
||||
wp_send_json_success([
|
||||
'logged_in' => is_user_logged_in(),
|
||||
'user_id' => get_current_user_id(),
|
||||
]);
|
||||
}
|
||||
endif;
|
||||
|
||||
add_action('wp_ajax_aksrt_menu_search', 'aksrt_ajax_menu_search');
|
||||
add_action('wp_ajax_nopriv_aksrt_menu_search', 'aksrt_ajax_menu_search');
|
||||
// Alias for zibll-compatible remote-box query action name used in markup.
|
||||
add_action('wp_ajax_menu_search', 'aksrt_ajax_menu_search');
|
||||
add_action('wp_ajax_nopriv_menu_search', 'aksrt_ajax_menu_search');
|
||||
add_action('wp_ajax_search_box', 'aksrt_ajax_search_box');
|
||||
add_action('wp_ajax_nopriv_search_box', 'aksrt_ajax_search_box');
|
||||
add_action('wp_ajax_get_current_user', 'aksrt_ajax_zibll_current_user_ping');
|
||||
add_action('wp_ajax_nopriv_get_current_user', 'aksrt_ajax_zibll_current_user_ping');
|
||||
add_action('wp_footer', 'aksrt_footer_navbar_search', 10);
|
||||
@@ -23,8 +23,7 @@ if (!function_exists('aksrt_nav_mobile_shell')) :
|
||||
|
||||
$touch_attr = '';
|
||||
if ($align !== 'top') {
|
||||
// mini-touch.js reads data-mini-touch; direction via data-touch-direction.
|
||||
$touch_attr = ' data-mini-touch="mobile-nav" data-touch-direction="' . esc_attr($align) . '"';
|
||||
$touch_attr = ' mini-touch="mobile-nav" touch-direction="' . esc_attr($align) . '"';
|
||||
}
|
||||
|
||||
echo '<div class="mobile-header">';
|
||||
@@ -41,9 +40,9 @@ if (!function_exists('aksrt_nav_mobile_shell')) :
|
||||
: '<span class="navbar-logo-text">' . esc_html($brand_name) . '</span>';
|
||||
|
||||
echo '<div class="flex jsb ac mb20">';
|
||||
echo '<div class="navbar-logo"><a href="' . esc_url(home_url('/')) . '">' . $logo_inner . '</a></div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo '<div class="navbar-logo">' . $logo_inner . '</div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo '<button type="button" data-toggle-class="mobile-navbar-show" data-target="body" class="close" aria-label="'
|
||||
. esc_attr__('关闭菜单', 'aksrt') . '"><i class="fas fa-times" aria-hidden="true"></i></button>';
|
||||
. esc_attr__('关闭菜单', 'aksrt') . '"><svg class="ic-close" aria-hidden="true"><use xlink:href="#icon-close"></use></svg></button>';
|
||||
echo '</div>';
|
||||
|
||||
aksrt_nav_mobile_content($ctx, $m_layout);
|
||||
@@ -72,13 +71,12 @@ if (!function_exists('aksrt_nav_mobile_content')) :
|
||||
if (in_array('m_menu', (array) ($ctx['theme_positions'] ?? []), true)) {
|
||||
$top_btns .= '<a href="javascript:;" class="toggle-theme toggle-radius" id="theme-toggle-mobile" title="'
|
||||
. esc_attr__('切换亮暗色', 'aksrt') . '">';
|
||||
$top_btns .= '<i class="fas fa-moon theme-icon-moon" aria-hidden="true"></i>';
|
||||
$top_btns .= '<i class="fas fa-sun theme-icon-sun" aria-hidden="true"></i>';
|
||||
$top_btns .= '<i class="fa fas fa-toggle-theme" aria-hidden="true"></i>';
|
||||
$top_btns .= '</a>';
|
||||
}
|
||||
if ($m_layout !== 'center' && !empty($ctx['search_enabled'])) {
|
||||
$top_btns .= '<a href="javascript:;" class="toggle-radius main-search-btn" data-toggle-class="show" data-target=".navbar-search" aria-label="'
|
||||
. esc_attr__('打开搜索', 'aksrt') . '"><i class="fas fa-search" aria-hidden="true"></i></a>';
|
||||
if ($m_layout !== 'center') {
|
||||
$top_btns .= '<a href="javascript:;" class="toggle-radius main-search-btn" aria-label="'
|
||||
. esc_attr__('打开搜索', 'aksrt') . '"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-search"></use></svg></a>';
|
||||
}
|
||||
if (function_exists('aksrt_get_translate_language_btn')) {
|
||||
$top_btns .= aksrt_get_translate_language_btn('pull-right');
|
||||
@@ -89,11 +87,7 @@ if (!function_exists('aksrt_nav_mobile_content')) :
|
||||
|
||||
$location = has_nav_menu('mobile') ? 'mobile' : 'primary';
|
||||
$walker = class_exists('\AKSRT\Frontend\NavWalker')
|
||||
? new \AKSRT\Frontend\NavWalker(
|
||||
function_exists('aksrt_get_menu_decoration_settings')
|
||||
? aksrt_get_menu_decoration_settings()
|
||||
: []
|
||||
)
|
||||
? new \AKSRT\Frontend\NavWalker()
|
||||
: null;
|
||||
|
||||
$args = [
|
||||
@@ -124,8 +118,6 @@ if (!function_exists('aksrt_nav_mobile_content')) :
|
||||
}
|
||||
|
||||
// User box at bottom of drawer.
|
||||
if (!empty($ctx['user_menu'])) {
|
||||
echo aksrt_header_user_box_html($ctx); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
echo aksrt_header_user_box_html($ctx); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
endif;
|
||||
@@ -17,11 +17,7 @@ if (!function_exists('aksrt_menu_items')) :
|
||||
*/
|
||||
function aksrt_menu_items(string $location = 'primary', bool $echo = true) {
|
||||
$walker = class_exists('\AKSRT\Frontend\NavWalker')
|
||||
? new \AKSRT\Frontend\NavWalker(
|
||||
function_exists('aksrt_get_menu_decoration_settings')
|
||||
? aksrt_get_menu_decoration_settings()
|
||||
: []
|
||||
)
|
||||
? new \AKSRT\Frontend\NavWalker()
|
||||
: null;
|
||||
|
||||
$args = [
|
||||
@@ -76,10 +72,10 @@ if (!function_exists('aksrt_navbar_header')) :
|
||||
. esc_attr__('打开菜单', 'aksrt') . '">';
|
||||
$button .= '<i class="em12 css-icon i-menu"><i></i></i></button>';
|
||||
|
||||
if (($ctx['mobile_layout'] ?? 'center') === 'center' && !empty($ctx['search_enabled'])) {
|
||||
$button .= '<button type="button" class="navbar-toggle main-search-btn nav-search-btn" data-toggle-class="show" data-target=".navbar-search" aria-label="'
|
||||
if (($ctx['mobile_layout'] ?? 'center') === 'center') {
|
||||
$button .= '<a href="javascript:;" class="navbar-toggle main-search-btn" aria-label="'
|
||||
. esc_attr__('打开搜索', 'aksrt') . '">';
|
||||
$button .= '<i class="fas fa-search" aria-hidden="true"></i></button>';
|
||||
$button .= '<svg class="icon" aria-hidden="true"><use xlink:href="#icon-search"></use></svg></a>';
|
||||
}
|
||||
|
||||
echo '<div class="navbar-header">';
|
||||
@@ -102,22 +98,26 @@ if (!function_exists('aksrt_get_menu_search')) :
|
||||
$placeholder = (string) ($ctx['search_placeholder'] ?? __('搜索内容', 'aksrt'));
|
||||
|
||||
// zibll: form + input + remote-box (action=menu_search).
|
||||
echo '<form method="get" class="navbar-form navbar-left hover-show" action="' . esc_url(home_url('/')) . '" role="search" data-aksrt-search-form="inline">';
|
||||
echo '<form method="get" class="navbar-form navbar-left hover-show" action="' . esc_url(home_url('/')) . '">';
|
||||
echo '<div class="form-group relative dropdown">';
|
||||
echo '<input type="text" class="form-control search-input focus-show" name="s" value="'
|
||||
. esc_attr(get_search_query()) . '" placeholder="' . esc_attr($placeholder) . '" autocomplete="off">';
|
||||
echo '<div class="abs-right muted-3-color"><button type="submit" class="null" aria-label="'
|
||||
. esc_attr__('搜索', 'aksrt') . '"><i class="fas fa-search" aria-hidden="true"></i></button></div>';
|
||||
. esc_attr__('搜索', 'aksrt') . '"><i class="fa fas fa-search" aria-hidden="true"></i></button></div>';
|
||||
if (function_exists('aksrt_get_remote_box')) {
|
||||
echo aksrt_get_remote_box([ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
'class' => '',
|
||||
'loader' => ' ',
|
||||
'query' => [
|
||||
'action' => 'menu_search',
|
||||
'nonce' => wp_create_nonce('aksrt_public_nonce'),
|
||||
],
|
||||
]);
|
||||
} else {
|
||||
$remote_url = add_query_arg(['action' => 'menu_search'], admin_url('admin-ajax.php'));
|
||||
$remote_url = add_query_arg([
|
||||
'action' => 'menu_search',
|
||||
'nonce' => wp_create_nonce('aksrt_public_nonce'),
|
||||
], admin_url('admin-ajax.php'));
|
||||
echo '<div class="lazyload" remote-box="' . esc_url($remote_url) . '" lazyload-action="ias">';
|
||||
echo '<i class="loading-spot"><i></i></i></div>';
|
||||
}
|
||||
@@ -137,11 +137,6 @@ if (!function_exists('aksrt_header_user_box_html')) :
|
||||
return $html;
|
||||
}
|
||||
|
||||
if (empty($ctx['user_menu'])) {
|
||||
$html = '';
|
||||
return $html;
|
||||
}
|
||||
|
||||
$user_id = (int) ($ctx['user_id'] ?? 0);
|
||||
$con = '';
|
||||
|
||||
@@ -186,7 +181,7 @@ if (!function_exists('aksrt_header_user_box_html')) :
|
||||
$msg_icon = '';
|
||||
if ($msg_url !== '') {
|
||||
$msg_icon = '<a class="abs-right" href="' . esc_url($msg_url) . '" title="' . esc_attr__('消息中心', 'aksrt') . '">';
|
||||
$msg_icon .= '<i class="fas fa-bell" aria-hidden="true"></i>';
|
||||
$msg_icon .= '<i class="fa fas fa-bell" aria-hidden="true"></i>';
|
||||
if ($unread > 0) {
|
||||
$msg_icon .= '<span class="aksrt-notification-badge">' . esc_html((string) min(99, $unread)) . '</span>';
|
||||
}
|
||||
@@ -195,44 +190,44 @@ if (!function_exists('aksrt_header_user_box_html')) :
|
||||
|
||||
$href = '<div class="flex jsa header-user-href">';
|
||||
$href .= '<a rel="nofollow" href="' . esc_url(function_exists('aksrt_get_user_center_url') ? aksrt_get_user_center_url() : home_url('/')) . '">';
|
||||
$href .= '<div class="badg mb6 toggle-radius c-blue"><i class="fas fa-user" aria-hidden="true"></i></div>';
|
||||
$href .= '<div class="badg mb6 toggle-radius c-blue"><i class="fa fas fa-user" aria-hidden="true"></i></div>';
|
||||
$href .= '<div class="c-blue">' . esc_html__('用户中心', 'aksrt') . '</div></a>';
|
||||
|
||||
$orders = (string) ($ctx['orders_url'] ?? '');
|
||||
if ($orders !== '') {
|
||||
$href .= '<a rel="nofollow" href="' . esc_url($orders) . '">';
|
||||
$href .= '<div class="badg mb6 toggle-radius c-purple"><i class="fas fa-shopping-bag" aria-hidden="true"></i></div>';
|
||||
$href .= '<div class="badg mb6 toggle-radius c-purple"><i class="fa fas fa-shopping-bag" aria-hidden="true"></i></div>';
|
||||
$href .= '<div class="c-purple">' . esc_html__('我的订单', 'aksrt') . '</div></a>';
|
||||
}
|
||||
|
||||
if (!empty($ctx['can_publish'])) {
|
||||
$all = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_all() : [];
|
||||
$pub_text = (string) ($all['header_user_newposts_text'] ?? '');
|
||||
$pub_text = (string) ($all['nav_user_newposts_btn_text'] ?? '');
|
||||
if ($pub_text === '') {
|
||||
$pub_text = __('发布内容', 'aksrt');
|
||||
}
|
||||
$pub_url = (string) $ctx['publish_url'];
|
||||
$href .= '<a rel="nofollow" href="' . esc_url($pub_url) . '">';
|
||||
$href .= '<div class="badg mb6 toggle-radius c-green"><i class="fas fa-pen" aria-hidden="true"></i></div>';
|
||||
$href .= '<div class="badg mb6 toggle-radius c-green"><i class="fa fas fa-edit" aria-hidden="true"></i></div>';
|
||||
$href .= '<div class="c-green">' . esc_html($pub_text) . '</div></a>';
|
||||
}
|
||||
|
||||
$href .= '<a href="javascript:;" data-toggle="modal" data-target="#modal_signout">';
|
||||
$href .= '<div class="badg mb6 toggle-radius c-red"><i class="fas fa-sign-out-alt" aria-hidden="true"></i></div>';
|
||||
$href .= '<div class="badg mb6 toggle-radius c-red"><i class="fa fas fa-sign-out-alt" aria-hidden="true"></i></div>';
|
||||
$href .= '<div class="c-red">' . esc_html__('退出登录', 'aksrt') . '</div></a>';
|
||||
$href .= '</div>';
|
||||
|
||||
if (is_super_admin()) {
|
||||
$href .= '<div class="flex jsa header-user-href">';
|
||||
$href .= '<a rel="nofollow" target="_blank" href="' . esc_url((string) $ctx['theme_settings_url']) . '">';
|
||||
$href .= '<div class="badg mb6 toggle-radius c-yellow"><i class="fas fa-sliders-h" aria-hidden="true"></i></div>';
|
||||
$href .= '<div class="badg mb6 toggle-radius c-yellow"><i class="fa fas fa-sliders-h" aria-hidden="true"></i></div>';
|
||||
$href .= '<div class="c-yellow">' . esc_html__('主题设置', 'aksrt') . '</div></a>';
|
||||
// zibll: 模块布局 → widgets.
|
||||
$href .= '<a rel="nofollow" target="_blank" href="' . esc_url(admin_url('widgets.php')) . '">';
|
||||
$href .= '<div class="badg mb6 toggle-radius c-yellow"><i class="fas fa-chart-pie" aria-hidden="true"></i></div>';
|
||||
$href .= '<div class="badg mb6 toggle-radius c-yellow"><i class="fa fas fa-chart-pie" aria-hidden="true"></i></div>';
|
||||
$href .= '<div class="c-yellow">' . esc_html__('模块布局', 'aksrt') . '</div></a>';
|
||||
$href .= '<a rel="nofollow" target="_blank" href="' . esc_url(admin_url()) . '">';
|
||||
$href .= '<div class="badg mb6 toggle-radius c-yellow"><i class="fas fa-cog" aria-hidden="true"></i></div>';
|
||||
$href .= '<div class="badg mb6 toggle-radius c-yellow"><i class="fa fas fa-cog" aria-hidden="true"></i></div>';
|
||||
$href .= '<div class="c-yellow">' . esc_html__('后台管理', 'aksrt') . '</div></a>';
|
||||
$href .= '</div>';
|
||||
}
|
||||
@@ -258,20 +253,20 @@ if (!function_exists('aksrt_header_user_box_html')) :
|
||||
$vs = \AKSRT\Settings\Settings::get_payment_vip_settings();
|
||||
if (!empty($vs['enabled'])) {
|
||||
$vip_guest = '<div><a class="em09 signin-loader but jb-red radius4 payvip-icon btn-block mt10" href="javascript:;">'
|
||||
. '<i class="fas fa-gem" aria-hidden="true"></i> '
|
||||
. '<i class="fa fas fa-gem" aria-hidden="true"></i> '
|
||||
. esc_html__('开通会员 尊享会员权益', 'aksrt') . '</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
$href = $vip_guest;
|
||||
$href .= '<div class="flex jsa header-user-href">';
|
||||
$href .= '<a href="javascript:;" class="signin-loader"><div class="badg mb6 toggle-radius c-blue"><i class="fas fa-sign-in-alt" aria-hidden="true"></i></div><div class="c-blue">'
|
||||
$href .= '<a href="javascript:;" class="signin-loader"><div class="badg mb6 toggle-radius c-blue"><i class="fa fas fa-sign-in-alt" aria-hidden="true"></i></div><div class="c-blue">'
|
||||
. esc_html__('登录', 'aksrt') . '</div></a>';
|
||||
if (get_option('users_can_register')) {
|
||||
$href .= '<a href="javascript:;" class="signup-loader"><div class="badg mb6 toggle-radius c-green"><i class="fas fa-user-plus" aria-hidden="true"></i></div><div class="c-green">'
|
||||
$href .= '<a href="javascript:;" class="signup-loader"><div class="badg mb6 toggle-radius c-green"><i class="fa fas fa-user-plus" aria-hidden="true"></i></div><div class="c-green">'
|
||||
. esc_html__('注册', 'aksrt') . '</div></a>';
|
||||
}
|
||||
$href .= '<a rel="nofollow" href="' . esc_url(wp_lostpassword_url(home_url('/'))) . '"><div class="badg mb6 toggle-radius c-purple"><i class="fas fa-key" aria-hidden="true"></i></div><div class="c-purple">'
|
||||
$href .= '<a rel="nofollow" href="' . esc_url(wp_lostpassword_url(home_url('/'))) . '"><div class="badg mb6 toggle-radius c-purple"><i class="fa fas fa-key" aria-hidden="true"></i></div><div class="c-purple">'
|
||||
. esc_html__('找回密码', 'aksrt') . '</div></a>';
|
||||
$href .= '</div>';
|
||||
|
||||
@@ -303,7 +298,10 @@ if (!function_exists('aksrt_menu_button')) :
|
||||
|
||||
// Publish + VIP (respect nav_pay_vip).
|
||||
if (function_exists('aksrt_render_header_menu_buttons')) {
|
||||
$button .= aksrt_render_header_menu_buttons();
|
||||
$action_buttons = aksrt_render_header_menu_buttons();
|
||||
if ($action_buttons !== '') {
|
||||
$button .= '<div class="navbar-form navbar-right navbar-but">' . $action_buttons . '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
// Theme toggle.
|
||||
@@ -311,8 +309,7 @@ if (!function_exists('aksrt_menu_button')) :
|
||||
if (in_array('pc_nav', (array) ($ctx['theme_positions'] ?? []), true)) {
|
||||
$radius_but .= '<a href="javascript:;" class="toggle-theme toggle-radius" id="theme-toggle-desktop" title="'
|
||||
. esc_attr__('切换亮暗色', 'aksrt') . '">';
|
||||
$radius_but .= '<i class="fas fa-moon theme-icon-moon" aria-hidden="true"></i>';
|
||||
$radius_but .= '<i class="fas fa-sun theme-icon-sun" aria-hidden="true"></i>';
|
||||
$radius_but .= '<i class="fa fas fa-toggle-theme" aria-hidden="true"></i>';
|
||||
$radius_but .= '</a>';
|
||||
}
|
||||
if (function_exists('aksrt_get_translate_language_btn')) {
|
||||
@@ -324,37 +321,29 @@ if (!function_exists('aksrt_menu_button')) :
|
||||
|
||||
// User + search.
|
||||
$sign_but = '';
|
||||
$user_sub = '';
|
||||
if (!empty($ctx['user_menu'])) {
|
||||
$user_sub = '<div class="padding-10">' . aksrt_header_user_box_html($ctx) . '</div>';
|
||||
if ('2' === $layout) {
|
||||
if ($user_id > 0) {
|
||||
$avatar = aksrt_get_avatar_html($user_id, 36, ['class' => 'avatar']);
|
||||
$sign_but = '<li><a href="javascript:;" class="navbar-avatar">' . $avatar . '</a><ul class="sub-menu">'
|
||||
. $user_sub . '</ul></li>';
|
||||
} else {
|
||||
$sign_but = '<li><a href="javascript:;" class="signin-loader">' . esc_html__('登录', 'aksrt') . '</a></li>';
|
||||
if (get_option('users_can_register')) {
|
||||
$sign_but .= '<li><a href="javascript:;" class="signup-loader">' . esc_html__('注册', 'aksrt') . '</a></li>';
|
||||
}
|
||||
}
|
||||
$user_sub = '<div class="padding-10">' . aksrt_header_user_box_html($ctx) . '</div>';
|
||||
if ('2' === $layout) {
|
||||
if ($user_id > 0) {
|
||||
$avatar = aksrt_get_avatar_html($user_id, 36, ['class' => 'avatar']);
|
||||
$sign_but = '<li><a href="javascript:;" class="navbar-avatar">' . $avatar . '</a><ul class="sub-menu">'
|
||||
. $user_sub . '</ul></li>';
|
||||
} else {
|
||||
$trigger = $user_id > 0
|
||||
? aksrt_get_avatar_html($user_id, 36)
|
||||
: '<i class="fas fa-user" aria-hidden="true"></i>';
|
||||
$cls = $user_id > 0 ? 'navbar-avatar' : 'btn signin-loader';
|
||||
$dot = ($user_id > 0 && (int) ($ctx['unread_count'] ?? 0) > 0)
|
||||
? '<span class="nav-user__dot" aria-hidden="true"></span>'
|
||||
: '';
|
||||
$sign_but = '<li class="relative"><a href="javascript:;" class="' . esc_attr($cls) . '">'
|
||||
. $trigger . $dot . '</a><ul class="sub-menu">' . $user_sub . '</ul></li>';
|
||||
$sign_but = '<li><a href="javascript:;" class="signin-loader">' . esc_html__('登录', 'aksrt') . '</a></li>';
|
||||
if (get_option('users_can_register')) {
|
||||
$sign_but .= '<li><a href="javascript:;" class="signup-loader">' . esc_html__('注册', 'aksrt') . '</a></li>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$cls = 'btn' . ($user_id > 0 ? '' : ' signin-loader');
|
||||
$sign_but = '<li><a href="javascript:;" class="' . esc_attr($cls) . '">'
|
||||
. '<svg class="icon" aria-hidden="true"><use xlink:href="#icon-user"></use></svg></a>'
|
||||
. '<ul class="sub-menu">' . $user_sub . '</ul></li>';
|
||||
}
|
||||
|
||||
$search_but = '';
|
||||
if ('2' !== $layout && !empty($ctx['search_enabled'])) {
|
||||
$search_but = '<li class="relative"><a href="javascript:;" class="btn nav-search-btn main-search-btn" data-toggle-class="show" data-target=".navbar-search" aria-label="'
|
||||
. esc_attr__('打开搜索', 'aksrt') . '"><i class="fas fa-search" aria-hidden="true"></i></a></li>';
|
||||
if ('2' !== $layout) {
|
||||
$search_but = '<li class="relative"><a href="javascript:;" class="btn nav-search-btn main-search-btn" aria-label="'
|
||||
. esc_attr__('打开搜索', 'aksrt') . '"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-search"></use></svg></a></li>';
|
||||
}
|
||||
|
||||
$right_but = '<div class="navbar-form navbar-right'
|
||||
@@ -364,7 +353,7 @@ if (!function_exists('aksrt_menu_button')) :
|
||||
|
||||
$fold = '<div class="navbar-form navbar-right hide show-nav-but" style="margin-right:-10px;">'
|
||||
. '<a data-toggle-class data-target=".nav.navbar-nav" href="javascript:;" class="but" aria-label="'
|
||||
. esc_attr__('展开菜单', 'aksrt') . '"><i class="fas fa-bars" aria-hidden="true"></i></a></div>';
|
||||
. esc_attr__('展开菜单', 'aksrt') . '"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-menu_2"></use></svg></a></div>';
|
||||
|
||||
$html = $fold;
|
||||
if ('3' === $layout) {
|
||||
|
||||
@@ -20,22 +20,21 @@ if (!function_exists('aksrt_get_header_nav_context')) :
|
||||
}
|
||||
|
||||
$settings = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_header_nav_settings()
|
||||
: [
|
||||
'fixed' => true,
|
||||
'search_enabled' => true,
|
||||
'user_menu' => true,
|
||||
'publish_btn' => true,
|
||||
'mobile_drawer' => true,
|
||||
'nav_style' => 'default',
|
||||
'max_width' => 1200,
|
||||
'scroll_down_hide' => true,
|
||||
'layout' => '1',
|
||||
'mobile_layout' => 'center',
|
||||
'mobile_align' => 'left',
|
||||
'nav_pay_vip' => true,
|
||||
'nav_user_pay_vip' => true,
|
||||
];
|
||||
? \AKSRT\Settings\Settings::get_all()
|
||||
: [];
|
||||
$layout = sanitize_key((string) ($settings['header_layout'] ?? '1'));
|
||||
if (!in_array($layout, ['1', '2', '3'], true)) {
|
||||
$layout = '1';
|
||||
}
|
||||
$mobile_layout = sanitize_key((string) ($settings['mobile_header_layout'] ?? 'center'));
|
||||
if (!in_array($mobile_layout, ['center', 'left'], true)) {
|
||||
$mobile_layout = 'center';
|
||||
}
|
||||
$mobile_align = sanitize_key((string) ($settings['mobile_navbar_align'] ?? 'left'));
|
||||
if (!in_array($mobile_align, ['top', 'left', 'right'], true)) {
|
||||
$mobile_align = 'left';
|
||||
}
|
||||
$nav_fixed = !isset($settings['nav_fixed']) || !empty($settings['nav_fixed']);
|
||||
|
||||
$site_name = get_bloginfo('name');
|
||||
$brand_name = function_exists('aksrt_get_site_logo_text') ? aksrt_get_site_logo_text() : $site_name;
|
||||
@@ -57,7 +56,7 @@ if (!function_exists('aksrt_get_header_nav_context')) :
|
||||
? \AKSRT\Settings\Settings::get_theme_mode_button_positions()
|
||||
: ['pc_nav', 'm_menu'];
|
||||
|
||||
$can_publish = !empty($settings['publish_btn']) && (
|
||||
$can_publish = (!isset($settings['nav_newposts']) || !empty($settings['nav_newposts'])) && (
|
||||
current_user_can('manage_options')
|
||||
|| (class_exists('\AKSRT\Core\FrontSubmit') && \AKSRT\Core\FrontSubmit::get_instance()->can_submit())
|
||||
);
|
||||
@@ -75,17 +74,13 @@ if (!function_exists('aksrt_get_header_nav_context')) :
|
||||
|
||||
$ctx = [
|
||||
'settings' => $settings,
|
||||
'layout' => (string) ($settings['layout'] ?? '1'),
|
||||
'mobile_layout' => (string) ($settings['mobile_layout'] ?? 'center'),
|
||||
'mobile_align' => (string) ($settings['mobile_align'] ?? 'left'),
|
||||
'fixed' => !empty($settings['fixed']),
|
||||
'scroll_down_hide' => !empty($settings['scroll_down_hide']) && !empty($settings['fixed']),
|
||||
'search_enabled' => !empty($settings['search_enabled']),
|
||||
'user_menu' => !empty($settings['user_menu']),
|
||||
'mobile_drawer' => !empty($settings['mobile_drawer']),
|
||||
'layout' => $layout,
|
||||
'mobile_layout' => $mobile_layout,
|
||||
'mobile_align' => $mobile_align,
|
||||
'fixed' => $nav_fixed,
|
||||
'scroll_down_hide' => (!isset($settings['nav_scroll_down_hide']) || !empty($settings['nav_scroll_down_hide'])) && $nav_fixed,
|
||||
'nav_pay_vip' => !isset($settings['nav_pay_vip']) || !empty($settings['nav_pay_vip']),
|
||||
'nav_user_pay_vip' => !isset($settings['nav_user_pay_vip']) || !empty($settings['nav_user_pay_vip']),
|
||||
'max_width' => (int) ($settings['max_width'] ?? 1200),
|
||||
'brand_name' => $brand_name,
|
||||
'logo_html' => $logo_html,
|
||||
'has_logo' => $logo_html !== '',
|
||||
@@ -148,35 +143,22 @@ if (!function_exists('aksrt_header')) :
|
||||
}
|
||||
|
||||
$nav_class = [
|
||||
'navbar',
|
||||
'navbar-top',
|
||||
$ctx['mobile_layout'],
|
||||
];
|
||||
$style_key = sanitize_key((string) ($ctx['settings']['nav_style'] ?? 'default'));
|
||||
if (in_array($style_key, ['transparent', 'blur'], true)) {
|
||||
$header_class[] = 'nav-style-' . $style_key;
|
||||
$nav_class[] = 'nav-style-' . $style_key;
|
||||
}
|
||||
|
||||
$nav_style = '';
|
||||
if ((int) $ctx['max_width'] > 0) {
|
||||
$nav_style = ' style="--nav-max-width:' . (int) $ctx['max_width'] . 'px"';
|
||||
}
|
||||
'navbar',
|
||||
'navbar-top',
|
||||
$ctx['mobile_layout'],
|
||||
];
|
||||
|
||||
echo '<header class="' . esc_attr(implode(' ', array_map('sanitize_html_class', $header_class))) . '">';
|
||||
echo '<nav class="' . esc_attr(implode(' ', array_map('sanitize_html_class', $nav_class))) . '"' . $nav_style . '>';
|
||||
echo '<nav class="' . esc_attr(implode(' ', array_map('sanitize_html_class', $nav_class))) . '">';
|
||||
echo '<div class="container-fluid container-header">';
|
||||
|
||||
aksrt_navbar_header($ctx);
|
||||
|
||||
// Do NOT use Bootstrap's `.collapse` here — BS5 hides `.collapse:not(.show)`
|
||||
// which would wipe the whole PC top bar (menu / CTA / user / search).
|
||||
// Zibll uses a plain `.navbar-collapse` flex row; mobile uses the drawer.
|
||||
echo '<div class="navbar-collapse">';
|
||||
echo '<div class="collapse navbar-collapse">';
|
||||
if ('3' !== $layout) {
|
||||
aksrt_menu_items('primary', true);
|
||||
}
|
||||
if ('2' === $layout && !empty($ctx['search_enabled'])) {
|
||||
if ('2' === $layout) {
|
||||
aksrt_get_menu_search($ctx);
|
||||
}
|
||||
aksrt_menu_button($ctx);
|
||||
@@ -187,17 +169,11 @@ $nav_style = '';
|
||||
}
|
||||
echo '</div></div></nav></header>';
|
||||
|
||||
if (!empty($ctx['mobile_drawer'])) {
|
||||
aksrt_nav_mobile_shell($ctx);
|
||||
}
|
||||
aksrt_nav_mobile_shell($ctx);
|
||||
|
||||
// Layout 1/3 search slide (zibll .navbar-search). Layout-2 uses inline menu_search.
|
||||
if (!empty($ctx['search_enabled'])) {
|
||||
$navbar_search = locate_template('templates/parts/navbar-search.php');
|
||||
if ($navbar_search) {
|
||||
include $navbar_search;
|
||||
}
|
||||
}
|
||||
if (!empty($ctx['show_slide']) && function_exists('aksrt_header_slide')) {
|
||||
aksrt_header_slide();
|
||||
}
|
||||
|
||||
if (function_exists('aksrt_render_signout_modal')) {
|
||||
aksrt_render_signout_modal();
|
||||
|
||||
@@ -365,19 +365,18 @@ if (!function_exists('aksrt_homepage_render_posts_grid')) {
|
||||
|
||||
if (!function_exists('aksrt_homepage_render_section')) {
|
||||
/**
|
||||
* Render a first-class homepage section (hero / banner).
|
||||
* Render the remaining first-class homepage banner section.
|
||||
*
|
||||
* These are fixed homepage sections, not a freeform module canvas bridge.
|
||||
*/
|
||||
function aksrt_homepage_render_section(string $type): void {
|
||||
$type = sanitize_key($type);
|
||||
if (!in_array($type, ['hero', 'banner'], true)) {
|
||||
if ($type !== 'banner') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Fixed homepage owns these sections directly.
|
||||
// Keep the existing hero/banner templates as section implementations,
|
||||
// but do not re-wrap them in a freeform module bridge.
|
||||
// Header slider is rendered by aksrt_header_slide(), never by this module path.
|
||||
get_template_part('templates/parts/home-modules/module', $type);
|
||||
}
|
||||
}
|
||||
@@ -1,37 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Homepage header component visibility and rendering.
|
||||
* Zibll header slider visibility and rendering.
|
||||
*
|
||||
* This is the only header-slider rendering path. It consumes the original
|
||||
* Zibll option IDs and the serialized page_config post meta contract.
|
||||
*
|
||||
* @package AKSRT
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if (!function_exists('aksrt_header_components_page_type_keys')) {
|
||||
/**
|
||||
* Allowed page-type keys for header multi-function (zibll CFS_Module::page_type).
|
||||
*
|
||||
* @return list<string>
|
||||
*/
|
||||
function aksrt_header_components_page_type_keys(): array {
|
||||
return [
|
||||
'home',
|
||||
'category',
|
||||
'tag',
|
||||
'author',
|
||||
'single',
|
||||
'search',
|
||||
'page',
|
||||
];
|
||||
if (!function_exists('aksrt_header_slider_device_is_visible')) {
|
||||
/** @param mixed $value */
|
||||
function aksrt_header_slider_device_is_visible($value): bool {
|
||||
$devices = array_map('sanitize_key', (array) $value);
|
||||
return wp_is_mobile()
|
||||
? in_array('m_s', $devices, true)
|
||||
: in_array('pc_s', $devices, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_header_slide_excluded_page_templates')) {
|
||||
/**
|
||||
* Page templates excluded from the generic "page" type (zibll parity).
|
||||
*
|
||||
* @return list<string>
|
||||
*/
|
||||
/** @return list<string> */
|
||||
function aksrt_header_slide_excluded_page_templates(): array {
|
||||
return [
|
||||
'templates/pages/page-sign.php',
|
||||
@@ -42,62 +32,64 @@ if (!function_exists('aksrt_header_slide_excluded_page_templates')) {
|
||||
'templates/pages/page-verify-email.php',
|
||||
'templates/pages/page-download.php',
|
||||
'templates/pages/page-download-file.php',
|
||||
'templates/pages/page-forums.php',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_header_slide_match_page_type')) {
|
||||
/**
|
||||
* Whether the current main query matches a header-slider page-type key.
|
||||
*
|
||||
* Mirrors zibll zib_header_slide_is_show() matching rules.
|
||||
*/
|
||||
function aksrt_header_slide_match_page_type(string $type): bool {
|
||||
global $wp_query;
|
||||
if (!function_exists('aksrt_get_page_header_slider_config')) {
|
||||
/** @return array<string,mixed> */
|
||||
function aksrt_get_page_header_slider_config(): array {
|
||||
if (!is_page()) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$config = get_post_meta(get_queried_object_id(), 'page_config', true);
|
||||
return is_array($config) && !empty($config['header_slider_show']) ? $config : [];
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_header_slide_matches_query')) {
|
||||
function aksrt_header_slide_matches_query(string $type): bool {
|
||||
$type = sanitize_key($type);
|
||||
if ($type === '' || !($wp_query instanceof WP_Query)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$raw_post_type = $wp_query->get('post_type');
|
||||
if (is_array($raw_post_type)) {
|
||||
$post_type = (string) reset($raw_post_type);
|
||||
} else {
|
||||
$post_type = (string) $raw_post_type;
|
||||
}
|
||||
|
||||
// Generic WP_Query is_* flags (home/category/tag/author/single/search/page).
|
||||
$query_flag = 'is_' . $type;
|
||||
if (empty($wp_query->{$query_flag})) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($type === 'single') {
|
||||
// Only ordinary posts; CPTs use dedicated keys.
|
||||
return $post_type === '' || $post_type === 'post';
|
||||
}
|
||||
|
||||
if ($type === 'page') {
|
||||
foreach (aksrt_header_slide_excluded_page_templates() as $template) {
|
||||
if (is_page_template($template)) {
|
||||
switch ($type) {
|
||||
case 'home':
|
||||
return is_home() || is_front_page();
|
||||
case 'category':
|
||||
return is_category();
|
||||
case 'tag':
|
||||
return is_tag();
|
||||
case 'author':
|
||||
return is_author();
|
||||
case 'single':
|
||||
return is_singular('post');
|
||||
case 'search':
|
||||
return is_search();
|
||||
case 'topics':
|
||||
return is_tax('topics');
|
||||
case 'forum_home':
|
||||
return is_page_template('templates/pages/page-forums.php');
|
||||
case 'forum_plate':
|
||||
return is_singular('plate') || is_post_type_archive('plate');
|
||||
case 'forum_post':
|
||||
return is_singular('forum_post');
|
||||
case 'page':
|
||||
if (!is_page()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
foreach (aksrt_header_slide_excluded_page_templates() as $template) {
|
||||
if (is_page_template($template)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_header_slide_is_show')) {
|
||||
/**
|
||||
* Whether the header multi-function slider should render (zibll header-slider contract).
|
||||
*
|
||||
* Master switch: non-empty header_components_show_on + current page-type match.
|
||||
* Device rule: header_components_device_visibility (only_pc / only_sm).
|
||||
*/
|
||||
function aksrt_header_slide_is_show(): bool {
|
||||
global $wp_query;
|
||||
|
||||
@@ -105,40 +97,27 @@ if (!function_exists('aksrt_header_slide_is_show')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Not on paginated views (zibll: query_vars['paged'] non-empty).
|
||||
$paged = (int) $wp_query->get('paged');
|
||||
if ($paged > 1) {
|
||||
return false;
|
||||
}
|
||||
if (function_exists('aksrt_homepage_get_current_page') && aksrt_homepage_get_current_page() > 1) {
|
||||
if ((int) $wp_query->get('paged') > 1 || (int) $wp_query->get('page') > 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$settings = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_header_components_settings()
|
||||
$page_config = aksrt_get_page_header_slider_config();
|
||||
if ($page_config) {
|
||||
$show_type = sanitize_key((string) ($page_config['header_slider_show_type'] ?? ''));
|
||||
return !($show_type === 'only_pc' && wp_is_mobile())
|
||||
&& !($show_type === 'only_sm' && !wp_is_mobile());
|
||||
}
|
||||
|
||||
$settings = class_exists('\\AKSRT\\Settings\\Settings')
|
||||
? \AKSRT\Settings\Settings::get_header_slider_settings()
|
||||
: [];
|
||||
$show_on = isset($settings['show_on_pages']) ? (array) $settings['show_on_pages'] : [];
|
||||
$allowed = array_values(array_intersect(
|
||||
array_map('sanitize_key', $show_on),
|
||||
aksrt_header_components_page_type_keys()
|
||||
));
|
||||
|
||||
// Empty selection = feature off (zibll header_slider_show).
|
||||
if ($allowed === []) {
|
||||
$show_type = sanitize_key((string) ($settings['show_type'] ?? ''));
|
||||
if (($show_type === 'only_pc' && wp_is_mobile()) || ($show_type === 'only_sm' && !wp_is_mobile())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Device visibility (zibll header_slider_show_type).
|
||||
$show_type = (string) ($settings['show_type'] ?? '');
|
||||
if ($show_type === 'only_pc' && wp_is_mobile()) {
|
||||
return false;
|
||||
}
|
||||
if ($show_type === 'only_sm' && !wp_is_mobile()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($allowed as $type) {
|
||||
if (aksrt_header_slide_match_page_type($type)) {
|
||||
foreach ((array) ($settings['show_on_pages'] ?? []) as $type) {
|
||||
if (aksrt_header_slide_matches_query((string) $type)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -147,16 +126,314 @@ if (!function_exists('aksrt_header_slide_is_show')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_get_header_slider_args')) {
|
||||
/** @return array<string,mixed> */
|
||||
function aksrt_get_header_slider_args(): array {
|
||||
$page_config = aksrt_get_page_header_slider_config();
|
||||
if ($page_config) {
|
||||
return [
|
||||
'header_slider' => (array) ($page_config['header_slider'] ?? []),
|
||||
'header_slider_option' => (array) ($page_config['header_slider_option'] ?? []),
|
||||
'header_slider_show_type' => (string) ($page_config['header_slider_show_type'] ?? ''),
|
||||
'header_slider_nav_color' => (string) ($page_config['header_slider_nav_color'] ?? ''),
|
||||
'header_slider_search_s' => (array) ($page_config['header_slider_search_s'] ?? []),
|
||||
'header_slider_search_option' => (array) ($page_config['header_slider_search_option'] ?? []),
|
||||
'header_slider_card_s' => (array) ($page_config['header_slider_card_s'] ?? []),
|
||||
'header_slider_card_option' => (array) ($page_config['header_slider_card_option'] ?? []),
|
||||
];
|
||||
}
|
||||
|
||||
$settings = class_exists('\\AKSRT\\Settings\\Settings')
|
||||
? \AKSRT\Settings\Settings::get_header_slider_settings()
|
||||
: [];
|
||||
return [
|
||||
'header_slider' => (array) ($settings['slides'] ?? []),
|
||||
'header_slider_option' => (array) ($settings['slider_config'] ?? []),
|
||||
'header_slider_show_type' => (string) ($settings['show_type'] ?? ''),
|
||||
'header_slider_nav_color' => (string) ($settings['nav_color'] ?? ''),
|
||||
'header_slider_search_s' => (array) ($settings['search_show'] ?? []),
|
||||
'header_slider_search_option' => (array) ($settings['search_config'] ?? []),
|
||||
'header_slider_card_s' => (array) ($settings['card_show'] ?? []),
|
||||
'header_slider_card_option' => (array) ($settings['card_config'] ?? []),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_header_slider_allowed_html')) {
|
||||
/** @return array<string,array<string,bool>> */
|
||||
function aksrt_header_slider_allowed_html(): array {
|
||||
return [
|
||||
'a' => ['href' => true, 'target' => true, 'rel' => true, 'class' => true],
|
||||
'b' => ['class' => true],
|
||||
'badge' => ['class' => true],
|
||||
'br' => [],
|
||||
'div' => ['class' => true],
|
||||
'em' => ['class' => true],
|
||||
'i' => ['class' => true, 'aria-hidden' => true],
|
||||
'small' => ['class' => true],
|
||||
'span' => ['class' => true],
|
||||
'strong' => ['class' => true],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_get_header_slider_markup')) {
|
||||
/** @param array<string,mixed> $options */
|
||||
function aksrt_get_header_slider_markup(array $options): string {
|
||||
$options = wp_parse_args($options, [
|
||||
'class' => 'slide-index slide-header',
|
||||
'direction' => 'horizontal',
|
||||
'pagination' => true,
|
||||
'pagination_type' => '',
|
||||
'effect' => 'slide',
|
||||
'button' => true,
|
||||
'loop' => true,
|
||||
'scale_height' => false,
|
||||
'blur_bg' => false,
|
||||
'gradient_bg' => false,
|
||||
'scale' => 40,
|
||||
'auto_height' => false,
|
||||
'm_height' => 280,
|
||||
'pc_height' => 550,
|
||||
'autoplay' => true,
|
||||
'interval' => 6,
|
||||
'speed' => 0,
|
||||
'spacebetween' => 0,
|
||||
'slides' => [],
|
||||
]);
|
||||
if (empty($options['slides'][0])) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$is_mobile = wp_is_mobile();
|
||||
$slides_html = '';
|
||||
$slide_count = 0;
|
||||
$allow = aksrt_header_slider_allowed_html();
|
||||
$site_suffix = ' - ' . get_bloginfo('name');
|
||||
|
||||
foreach ((array) $options['slides'] as $slide) {
|
||||
if (!is_array($slide)) {
|
||||
continue;
|
||||
}
|
||||
$hide = sanitize_key((string) ($slide['hide'] ?? ''));
|
||||
if ((!$is_mobile && $hide === 'pc') || ($is_mobile && $hide === 'm')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$background = esc_url((string) ($slide['background'] ?? ''));
|
||||
$background_video = esc_url((string) ($slide['background_video'] ?? ''));
|
||||
$video = esc_url((string) ($slide['video'] ?? ''));
|
||||
$text = is_array($slide['text'] ?? null) ? $slide['text'] : [];
|
||||
$link = is_array($slide['link'] ?? null) ? $slide['link'] : [];
|
||||
$title = (string) ($text['title'] ?? '');
|
||||
$alt = trim(wp_strip_all_tags($title));
|
||||
$alt = $alt !== '' ? $alt . $site_suffix : __('幻灯片', 'aksrt') . $site_suffix;
|
||||
$slide_class = trim((string) ($slide['class'] ?? ''));
|
||||
$background_html = '';
|
||||
|
||||
if ($background_video !== '' && !$is_mobile) {
|
||||
$slide_class .= ' slide-background-video';
|
||||
$background_html = '<video autoplay loop muted playsinline class="fit-cover radius8" src="' . esc_url($background_video) . '"'
|
||||
. ($background !== '' ? ' poster="' . esc_url($background) . '"' : '') . '></video><div class="absolute"></div>';
|
||||
} elseif ($video !== '') {
|
||||
$slide_class .= ' slide-dplayer';
|
||||
$background_html = '<video controls playsinline preload="metadata" class="fit-cover radius8" src="' . esc_url($video) . '"'
|
||||
. ($background !== '' ? ' poster="' . esc_url($background) . '"' : '') . '></video>';
|
||||
if ($background !== '') {
|
||||
$background_html .= '<div class="absolute dplayer-poster"><img class="no-imgbox radius8" src="' . esc_url($background) . '" alt="' . esc_attr($alt) . '"><div class="absolute flex jc play-icon"><span class="toggle-radius"><i class="fa fas fa-play" aria-hidden="true"></i></span></div></div>';
|
||||
}
|
||||
} elseif ($background !== '') {
|
||||
$background_html = '<img class="radius8" src="' . esc_url($background) . '" alt="' . esc_attr($alt) . '">';
|
||||
}
|
||||
|
||||
if ($background_html === '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$blur_html = '';
|
||||
if (!empty($options['blur_bg']) && $background !== '') {
|
||||
$blur_html = '<div class="slide-blur-bg"><img class="no-imgbox" src="' . esc_url($background) . '" alt="' . esc_attr($alt) . '"></div>';
|
||||
}
|
||||
|
||||
$layers_html = '';
|
||||
foreach ((array) ($slide['image_layer'] ?? []) as $layer) {
|
||||
if (!is_array($layer) || empty($layer['image'])) {
|
||||
continue;
|
||||
}
|
||||
$layer_class = 'absolute';
|
||||
if (!empty($layer['free_size'])) {
|
||||
$align = in_array(($layer['align'] ?? ''), ['left', 'center', 'right'], true) ? $layer['align'] : 'center';
|
||||
$layer_class .= ' slide-layer text-' . $align;
|
||||
}
|
||||
$layer_attrs = '';
|
||||
$parallax = (int) ($layer['parallax'] ?? 0);
|
||||
if ($parallax !== 0) {
|
||||
$layer_attrs .= ' data-swiper-parallax="' . esc_attr((string) $parallax) . '%"';
|
||||
$opacity = max(1, min(100, (int) ($layer['parallax_opacity'] ?? 100)));
|
||||
if ($opacity !== 100) {
|
||||
$layer_attrs .= ' data-swiper-parallax-opacity="' . esc_attr((string) ($opacity / 100)) . '"';
|
||||
}
|
||||
}
|
||||
$scale = max(1, min(200, (int) ($layer['parallax_scale'] ?? 100)));
|
||||
if ($scale !== 100) {
|
||||
$layer_attrs .= ' data-swiper-parallax-scale="' . esc_attr((string) ($scale / 100)) . '"';
|
||||
}
|
||||
$layers_html .= '<div class="' . esc_attr($layer_class) . '"' . $layer_attrs . '><img class="radius8" src="' . esc_url((string) $layer['image']) . '" alt="' . esc_attr($alt) . '"></div>';
|
||||
}
|
||||
|
||||
$text_html = '';
|
||||
if ($title !== '') {
|
||||
$align = sanitize_html_class((string) ($text['text_align'] ?? 'left-bottom'));
|
||||
$text_style = '--text-size-pc:' . max(12, min(50, (int) ($text['text_size_pc'] ?? 30))) . 'px;'
|
||||
. '--text-size-m:' . max(12, min(50, (int) ($text['text_size_m'] ?? 20))) . 'px;';
|
||||
$text_html = '<div class="abs-center slide-text ' . esc_attr($align) . '" style="' . esc_attr($text_style) . '"><div class="slide-title">'
|
||||
. wp_kses($title, $allow) . '</div>';
|
||||
if (!empty($text['desc'])) {
|
||||
$text_html .= '<div class="slide-desc">' . wp_kses((string) $text['desc'], $allow) . '</div>';
|
||||
}
|
||||
$text_html .= '</div>';
|
||||
$parallax = (int) ($text['parallax'] ?? 0);
|
||||
if ($parallax !== 0) {
|
||||
$text_html = '<div class="absolute" data-swiper-parallax="' . esc_attr((string) $parallax) . '">' . $text_html . '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
$slide_attrs = '';
|
||||
if (!empty($options['gradient_bg'])) {
|
||||
$slide_class .= ' gradient-bg';
|
||||
$slide_attrs .= ' data-opacity="0.2"';
|
||||
}
|
||||
$url = esc_url((string) ($link['url'] ?? ''));
|
||||
$target = !empty($link['target']) ? ' target="_blank" rel="noopener noreferrer"' : '';
|
||||
$slides_html .= '<div class="swiper-slide ' . esc_attr(trim($slide_class)) . '"' . $slide_attrs . '>' . $blur_html;
|
||||
$slides_html .= $url !== '' ? '<a href="' . esc_url($url) . '"' . $target . '>' : '<span>';
|
||||
$slides_html .= $background_html . $layers_html . $text_html;
|
||||
$slides_html .= $url !== '' ? '</a>' : '</span>';
|
||||
$slides_html .= '</div>';
|
||||
$slide_count++;
|
||||
}
|
||||
|
||||
if ($slide_count === 0) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$class = trim((string) $options['class']);
|
||||
$class .= !empty($options['blur_bg']) ? ' blur-background' : '';
|
||||
$class .= !empty($options['gradient_bg']) ? ' gradient-background' : '';
|
||||
$class .= $slide_count === 1 ? ' swiper-container-initialized' : '';
|
||||
|
||||
$attrs = ' data-direction="' . esc_attr((string) $options['direction']) . '" data-effect="' . esc_attr((string) $options['effect']) . '"';
|
||||
$attrs .= !empty($options['loop']) ? ' data-loop="true"' : '';
|
||||
$attrs .= !empty($options['autoplay']) ? ' data-autoplay="1" data-interval="' . esc_attr((string) ((int) $options['interval'] < 999 ? (int) $options['interval'] * 1000 : (int) $options['interval'])) . '"' : '';
|
||||
$attrs .= (int) $options['speed'] > 299 ? ' data-speed="' . esc_attr((string) (int) $options['speed']) . '"' : '';
|
||||
$attrs .= isset($options['spacebetween']) ? ' data-spaceBetween="' . esc_attr((string) (int) $options['spacebetween']) . '"' : '';
|
||||
if (!empty($options['pagination_type']) && !empty($options['pagination']) && $slide_count > 1) {
|
||||
$attrs .= ' data-pagination-type="' . esc_attr((string) $options['pagination_type']) . '"';
|
||||
}
|
||||
|
||||
if (!empty($options['scale_height']) && $options['direction'] !== 'vertical') {
|
||||
$class .= ' scale-height';
|
||||
$style = '--scale-height :' . max(10, min(300, (int) $options['scale'])) . '%';
|
||||
} elseif (!empty($options['auto_height']) && $options['direction'] !== 'vertical') {
|
||||
$attrs .= ' auto-height="true"';
|
||||
$style = '--max-height :' . max(120, (int) ($options['max_height'] ?? 500)) . 'px;--min-height :' . max(100, (int) ($options['min_height'] ?? 180)) . 'px;';
|
||||
} else {
|
||||
$style = '--m-height :' . max(100, (int) $options['m_height']) . 'px;--pc-height :' . max(120, (int) $options['pc_height']) . 'px;';
|
||||
}
|
||||
|
||||
$controls = '';
|
||||
if ($slide_count > 1 && !empty($options['button'])) {
|
||||
$controls .= '<div class="swiper-button-prev"></div><div class="swiper-button-next"></div>';
|
||||
}
|
||||
if ($slide_count > 1 && !empty($options['pagination'])) {
|
||||
$pagination_class = !empty($options['pagination_type'])
|
||||
? ' scroll-x no-scrollbar pagination-type-' . sanitize_html_class((string) $options['pagination_type'])
|
||||
: '';
|
||||
$controls .= '<div class="swiper-pagination kaoyou' . esc_attr($pagination_class) . '"></div>';
|
||||
}
|
||||
|
||||
return '<div class="relative zib-slider"><div class="new-swiper ' . esc_attr(trim($class)) . '"' . $attrs . ' style="' . esc_attr($style) . '"><div class="swiper-wrapper">'
|
||||
. $slides_html . '</div>' . $controls . '</div></div>';
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_header_slide')) {
|
||||
/**
|
||||
* Render header slider after the site header (outside main).
|
||||
*/
|
||||
function aksrt_header_slide(): void {
|
||||
if (!aksrt_header_slide_is_show()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Reuse existing hero partial as the slider implementation.
|
||||
get_template_part('templates/parts/home-modules/module', 'hero');
|
||||
$args = aksrt_get_header_slider_args();
|
||||
$slides = (array) ($args['header_slider'] ?? []);
|
||||
$options = (array) ($args['header_slider_option'] ?? []);
|
||||
if (empty($slides[0])) {
|
||||
return;
|
||||
}
|
||||
$options['slides'] = $slides;
|
||||
$options['class'] = 'slide-index slide-header';
|
||||
|
||||
$search_html = '';
|
||||
if (aksrt_header_slider_device_is_visible($args['header_slider_search_s'] ?? [])) {
|
||||
$search_options = wp_parse_args((array) ($args['header_slider_search_option'] ?? []), [
|
||||
'class' => '', 'show_keywords' => false, 'show_history' => false,
|
||||
'show_posts' => false, 'show_input_cat' => false, 'more_cats' => [],
|
||||
'in_cat' => '', 'show_type' => false, 'in_type' => 'post', 'in_user' => '',
|
||||
'before_html' => '', 'after_html' => '',
|
||||
]);
|
||||
if (wp_is_mobile()) {
|
||||
$search_options['show_keywords'] = false;
|
||||
}
|
||||
$before = $search_options['before_html'] !== '' ? '<div class="header-slider-search-more text-center before">' . wp_kses((string) $search_options['before_html'], aksrt_header_slider_allowed_html()) . '</div>' : '';
|
||||
$after = $search_options['after_html'] !== '' ? '<div class="header-slider-search-more after">' . wp_kses((string) $search_options['after_html'], aksrt_header_slider_allowed_html()) . '</div>' : '';
|
||||
unset($search_options['before_html'], $search_options['after_html']);
|
||||
$box = function_exists('aksrt_get_search_box') ? (string) aksrt_get_search_box($search_options) : '';
|
||||
$search_html = '<div class="header-slider-search abs-center">' . $before . $box . $after . '</div>';
|
||||
}
|
||||
|
||||
$cards_html = '';
|
||||
$card_count = 0;
|
||||
if (aksrt_header_slider_device_is_visible($args['header_slider_card_s'] ?? [])) {
|
||||
$card_options = wp_parse_args((array) ($args['header_slider_card_option'] ?? []), [
|
||||
'show_widget_bg' => false, 'icon_radius4' => false, 'cards' => [],
|
||||
]);
|
||||
$items = '';
|
||||
foreach ((array) $card_options['cards'] as $card) {
|
||||
if (!is_array($card) || (empty($card['icon']) && empty($card['customize_icon']))) {
|
||||
continue;
|
||||
}
|
||||
$card['class'] = !empty($card_options['show_widget_bg']) ? 'padding-10' : 'zib-widget';
|
||||
$card['icon_class'] = trim((string) ($card['icon_class'] ?? '') . (!empty($card_options['icon_radius4']) ? ' radius4' : ''));
|
||||
$inner = function_exists('aksrt_icon_cover_card') ? aksrt_icon_cover_card($card) : '';
|
||||
if ($inner === '') {
|
||||
continue;
|
||||
}
|
||||
$items .= !empty($card_options['show_widget_bg']) ? '<div class="relative-h">' : '<div class="flex1">';
|
||||
$items .= $inner . '</div>';
|
||||
$card_count++;
|
||||
}
|
||||
if ($items !== '') {
|
||||
$cards_html = '<div class="header-slider-card container">'
|
||||
. (!empty($card_options['show_widget_bg']) ? '<div class="zib-widget padding-10">' : '<div class="">')
|
||||
. '<div class="flex jse flex-row gutters-5 flex-col-sm-2">' . $items . '</div></div></div>';
|
||||
}
|
||||
}
|
||||
|
||||
$nav_color = sanitize_hex_color((string) ($args['header_slider_nav_color'] ?? ''));
|
||||
if ($nav_color && $nav_color !== '#ffffff') {
|
||||
echo '<style>body.nav-fixed:not(.body-scroll):not(.mobile-navbar-show) .header.show-slide{--header-color:' . esc_html($nav_color) . ';}</style>';
|
||||
}
|
||||
|
||||
$settings = class_exists('\\AKSRT\\Settings\\Settings') ? \AKSRT\Settings\Settings::get_header_slider_settings() : [];
|
||||
$filter_blur = aksrt_header_slider_device_is_visible($settings['filter_blur'] ?? []);
|
||||
$slider_html = aksrt_get_header_slider_markup($options);
|
||||
if ($slider_html === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
echo '<div class="header-slider-container relative mb20 card-' . (int) $card_count . ($filter_blur ? ' filter-blur' : '') . '">';
|
||||
echo $slider_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo $search_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo $cards_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* Menu decoration helpers — aksrt_menu_options meta only (zibll zib_menu_pz).
|
||||
* Menu decoration helpers — Zibll's zib_menu_options contract.
|
||||
*
|
||||
* @package AKSRT
|
||||
*/
|
||||
@@ -8,30 +8,7 @@
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
/**
|
||||
* Global decoration switches (SPA). Per-item data is always from meta.
|
||||
*
|
||||
* @return array<string,mixed>
|
||||
*/
|
||||
function aksrt_get_menu_decoration_settings(): array {
|
||||
static $cache = null;
|
||||
if ($cache !== null) {
|
||||
return $cache;
|
||||
}
|
||||
|
||||
$all = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_all()
|
||||
: [];
|
||||
|
||||
$cache = [
|
||||
'icon_enabled' => !isset($all['menu_icon_enabled']) || !empty($all['menu_icon_enabled']),
|
||||
'badge_enabled' => !isset($all['menu_badge_enabled']) || !empty($all['menu_badge_enabled']),
|
||||
];
|
||||
|
||||
return $cache;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read one menu item option from post meta aksrt_menu_options.
|
||||
* Read one menu item option from post meta zib_menu_options.
|
||||
*
|
||||
* @param int $id Menu item ID.
|
||||
* @param string $key Option key.
|
||||
@@ -41,7 +18,7 @@ function aksrt_get_menu_decoration_settings(): array {
|
||||
function aksrt_menu_pz(int $id, string $key = '', $default = '') {
|
||||
static $options = [];
|
||||
if (!isset($options[$id])) {
|
||||
$raw = get_post_meta($id, 'aksrt_menu_options', true);
|
||||
$raw = get_post_meta($id, 'zib_menu_options', true);
|
||||
$options[$id] = is_array($raw) ? $raw : [];
|
||||
}
|
||||
if ($key === '') {
|
||||
@@ -68,18 +45,18 @@ function aksrt_get_menu_item_decoration($menu_item): array {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $icon_class FA5 / icon class.
|
||||
* @param string $icon_class FA5 icon class.
|
||||
* @param bool $enabled Global switch.
|
||||
*/
|
||||
function aksrt_render_menu_icon(string $icon_class, bool $enabled = true): string {
|
||||
if (!$enabled || $icon_class === '') {
|
||||
return '';
|
||||
}
|
||||
// Allow bare "fa-home" → "fas fa-home".
|
||||
// Zibll uses the Font Awesome 5 `fa` prefix.
|
||||
if (strpos($icon_class, 'fa') === false) {
|
||||
$icon_class = 'fas fa-' . ltrim($icon_class, '-');
|
||||
$icon_class = 'fa fas fa-' . ltrim($icon_class, '-');
|
||||
} elseif (strpos($icon_class, 'fa-') === 0 && strpos($icon_class, ' ') === false) {
|
||||
$icon_class = 'fas ' . $icon_class;
|
||||
$icon_class = 'fa ' . $icon_class;
|
||||
}
|
||||
return '<i class="' . esc_attr($icon_class) . ' mr3 menu-item-icon" aria-hidden="true"></i>';
|
||||
}
|
||||
|
||||
@@ -125,23 +125,23 @@ if (!function_exists('aksrt_renderer_thumb')) {
|
||||
$content .= '<div class="video-thumb-box" video-url="' . esc_url((string) $data['video_url']) . '" data-volume="' . ($muted ? 'none' : '100') . '" data-post-thumb-video>';
|
||||
$content .= '<div class="img-thumb"><img' . $default_attr . aksrt_get_lazy_attr('lazy_posts_thumb', (string) $data['primary'], 'fit-cover radius8') . ' alt="' . esc_attr((string) $data['title']) . '"></div>';
|
||||
$content .= '<div class="video-thumb"><div class="dplayer dplayer-thumb"><video playsinline loop preload="none"' . ($muted ? ' muted' : '') . ' data-src="' . esc_url((string) $data['video_url']) . '"></video></div></div></div>';
|
||||
$format_icon = '<i class="fa fa-play-circle em12 mt6 c-white opacity8" aria-hidden="true"></i>';
|
||||
$format_icon = '<i class="fa fas fa-play-circle em12 mt6 c-white opacity8" aria-hidden="true"></i>';
|
||||
} elseif ($has_slides) {
|
||||
$content .= '<div class="relative zib-slider"><div class="new-swiper item-thumbnail' . ($is_contain ? ' gradient-background' : '') . '" data-loop="true" data-effect="slide" data-autoplay="1" data-post-thumb-slider><div class="swiper-wrapper">';
|
||||
foreach ((array) $data['slides'] as $image) {
|
||||
$content .= '<div class="swiper-slide' . ($is_contain ? ' gradient-bg' : '') . '"' . ($is_contain ? ' data-opacity="0.2"' : '') . '><a' . $target . ' href="' . esc_url((string) $data['permalink']) . '"><img' . aksrt_get_lazy_attr('lazy_posts_thumb', (string) $image, 'radius8') . ' alt="' . esc_attr((string) $data['title']) . '"></a></div>';
|
||||
}
|
||||
$content .= '</div><div class="swiper-pagination kaoyou"></div></div></div>';
|
||||
$format_icon = '<badge class="b-black opacity8 mt6"><i class="fa fa-image mr3" aria-hidden="true"></i>' . count((array) $data['slides']) . '</badge>';
|
||||
$format_icon = '<badge class="b-black opacity8 mt6"><i class="fa fas fa-image mr3" aria-hidden="true"></i>' . count((array) $data['slides']) . '</badge>';
|
||||
} else {
|
||||
$content .= '<a' . $target . ' href="' . esc_url((string) $data['permalink']) . '"><img' . $default_attr . aksrt_get_lazy_attr('lazy_posts_thumb', (string) $data['primary'], 'fit-cover radius8') . ' alt="' . esc_attr((string) $data['title']) . '"></a>';
|
||||
$format = get_post_format((int) $data['post_id']);
|
||||
if ((string) $data['video_url'] !== '') {
|
||||
$format_icon = '<i class="fa fa-play-circle em12 mt6 c-white opacity8" aria-hidden="true"></i>';
|
||||
$format_icon = '<i class="fa fas fa-play-circle em12 mt6 c-white opacity8" aria-hidden="true"></i>';
|
||||
} elseif (in_array($format, ['image', 'gallery'], true) && (int) $data['gallery_count'] > 0) {
|
||||
$format_icon = '<badge class="b-black opacity8 mr6 mt6"><i class="fa fa-image mr3" aria-hidden="true"></i>' . (int) $data['gallery_count'] . '</badge>';
|
||||
$format_icon = '<badge class="b-black opacity8 mr6 mt6"><i class="fa fas fa-image mr3" aria-hidden="true"></i>' . (int) $data['gallery_count'] . '</badge>';
|
||||
} elseif ($format === 'video') {
|
||||
$format_icon = '<i class="fa fa-play-circle em12 mr6 mt6 c-white opacity8" aria-hidden="true"></i>';
|
||||
$format_icon = '<i class="fa fas fa-play-circle em12 mr6 mt6 c-white opacity8" aria-hidden="true"></i>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ if (!function_exists('aksrt_renderer_mult_thumb')) {
|
||||
foreach (array_slice((array) $data['gallery'], 0, 4) as $index => $image) {
|
||||
$badge = '';
|
||||
if ($index === 3 && (int) ($data['gallery_count'] ?? 0) > 4) {
|
||||
$badge = '<div class="abs-center right-top"><badge class="b-black mr6 mt6 em09"><i class="fa fa-image mr3" aria-hidden="true"></i>+' . ((int) $data['gallery_count'] - 4) . '</badge></div>';
|
||||
$badge = '<div class="abs-center right-top"><badge class="b-black mr6 mt6 em09"><i class="fa fas fa-image mr3" aria-hidden="true"></i>+' . ((int) $data['gallery_count'] - 4) . '</badge></div>';
|
||||
}
|
||||
$html .= '<span>' . $badge . '<img' . aksrt_get_lazy_attr('lazy_posts_thumb', (string) $image, 'fit-cover radius8') . ' alt=""></span>';
|
||||
}
|
||||
@@ -199,13 +199,13 @@ if (!function_exists('aksrt_renderer_pay_badge')) {
|
||||
if (!function_exists('aksrt_renderer_vip_icon')) {
|
||||
function aksrt_renderer_vip_icon(int $level): string {
|
||||
if (!class_exists('\AKSRT\Settings\Settings')) {
|
||||
return '<i class="fas fa-crown mr3" aria-hidden="true"></i>';
|
||||
return '<i class="fa fas fa-certificate mr3" aria-hidden="true"></i>';
|
||||
}
|
||||
$settings = \AKSRT\Settings\Settings::get_payment_vip_settings();
|
||||
$url = esc_url((string) ($settings['levels'][$level]['img_icon'] ?? ''));
|
||||
return $url !== ''
|
||||
? '<img class="mr3" src="' . $url . '" alt="" aria-hidden="true">'
|
||||
: '<i class="fas fa-crown mr3" aria-hidden="true"></i>';
|
||||
: '<i class="fa fas fa-certificate mr3" aria-hidden="true"></i>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ if (!function_exists('aksrt_renderer_badges')) {
|
||||
if (empty($cfg['is_category']) && in_array('cat', $types, true)) {
|
||||
$colors = ['c-blue', 'c-yellow', 'c-green', 'c-purple', 'c-red'];
|
||||
foreach (array_slice((array) $data['categories'], 0, 3) as $index => $category) {
|
||||
$items[] = '<a class="but ' . esc_attr($colors[$index % count($colors)]) . '" title="' . esc_attr__('查看更多分类文章', 'aksrt') . '" href="' . esc_url(get_category_link($category->term_id)) . '"><i class="fa fa-folder-open-o" aria-hidden="true"></i>' . esc_html($category->name) . '</a>';
|
||||
$items[] = '<a class="but ' . esc_attr($colors[$index % count($colors)]) . '" title="' . esc_attr__('查看更多分类文章', 'aksrt') . '" href="' . esc_url(get_category_link($category->term_id)) . '"><i class="fa fas fa-folder-open" aria-hidden="true"></i>' . esc_html($category->name) . '</a>';
|
||||
}
|
||||
}
|
||||
if (empty($cfg['is_tag']) && in_array('tag', $types, true)) {
|
||||
|
||||
@@ -9,28 +9,104 @@
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if (!function_exists('aksrt_save_history_search')) :
|
||||
/** Store the Zibll history_search cookie (newest first, maximum thirty). */
|
||||
function aksrt_save_history_search(string $search): void {
|
||||
$search = trim(wp_strip_all_tags($search));
|
||||
$search_text = aksrt_get_search_keywords_text($search);
|
||||
if ($search_text === '' || mb_strlen($search_text) >= 30 || headers_sent()) {
|
||||
return;
|
||||
}
|
||||
$history = aksrt_get_search_history_keywords();
|
||||
$history = array_values(array_filter($history, static function (string $item) use ($search_text): bool {
|
||||
return aksrt_get_search_keywords_text($item) !== $search_text;
|
||||
}));
|
||||
array_unshift($history, $search);
|
||||
$history = array_slice($history, 0, 30);
|
||||
setcookie('history_search', wp_json_encode($history), [
|
||||
'expires' => time() + MONTH_IN_SECONDS,
|
||||
'path' => COOKIEPATH ?: '/',
|
||||
'domain' => COOKIE_DOMAIN,
|
||||
'secure' => is_ssl(),
|
||||
'httponly' => false,
|
||||
'samesite' => 'Lax',
|
||||
]);
|
||||
$_COOKIE['history_search'] = wp_json_encode($history);
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_get_main_search')) :
|
||||
/** Zibll main-search defaults backed only by the reference option IDs. */
|
||||
function aksrt_get_main_search(array $args = [], bool $echo = false) {
|
||||
$settings = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_all() : [];
|
||||
$search_cat = !array_key_exists('search_cat', $settings) || !empty($settings['search_cat']);
|
||||
$search_type = !array_key_exists('search_type', $settings) || !empty($settings['search_type']);
|
||||
$defaults = [
|
||||
'class' => '',
|
||||
'show_keywords' => !array_key_exists('search_popular_key', $settings) || !empty($settings['search_popular_key']),
|
||||
'show_history' => !array_key_exists('search_history', $settings) || !empty($settings['search_history']),
|
||||
'show_posts' => !array_key_exists('search_posts', $settings) || !empty($settings['search_posts']),
|
||||
'show_input_cat' => $search_cat,
|
||||
'more_cats' => $search_cat ? (array) ($settings['search_more_cat_obj'] ?? []) : [],
|
||||
'in_cat' => $search_cat ? ($settings['search_cat_in'] ?? '') : '',
|
||||
'show_type' => $search_type,
|
||||
'in_type' => $search_type ? sanitize_key((string) ($settings['search_type_in'] ?? 'post')) : '',
|
||||
'in_user' => '',
|
||||
];
|
||||
return aksrt_get_search_box(wp_parse_args($args, $defaults), $echo);
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_get_search_history_keywords')) :
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
function aksrt_get_search_history_keywords(): array {
|
||||
$hist = [];
|
||||
if (is_user_logged_in()) {
|
||||
$saved = get_user_meta(get_current_user_id(), 'aksrt_search_history', true);
|
||||
if (is_array($saved)) {
|
||||
foreach (array_slice($saved, 0, 10) as $item) {
|
||||
if (is_array($item) && !empty($item['keyword'])) {
|
||||
$hist[] = (string) $item['keyword'];
|
||||
} elseif (is_string($item) && $item !== '') {
|
||||
$hist[] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
$raw = isset($_COOKIE['history_search'])
|
||||
? wp_unslash((string) $_COOKIE['history_search'])
|
||||
: '';
|
||||
$decoded = $raw !== '' ? json_decode(stripslashes($raw), true) : [];
|
||||
if (!is_array($decoded)) {
|
||||
return [];
|
||||
}
|
||||
$hist = array_map(
|
||||
static fn($item): string => sanitize_text_field((string) $item),
|
||||
array_slice($decoded, 0, 30)
|
||||
);
|
||||
return array_values(array_unique(array_filter(array_map('trim', $hist))));
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_get_search_keywords_text')) :
|
||||
function aksrt_get_search_keywords_text(string $search): string {
|
||||
$search = str_replace('&type', '&type', $search);
|
||||
$index = strpos($search, '&type=');
|
||||
return trim($index === false ? $search : substr($search, 0, $index));
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_update_search_keywords')) :
|
||||
function aksrt_update_search_keywords(string $search): void {
|
||||
$search = trim(wp_strip_all_tags($search));
|
||||
$text = aksrt_get_search_keywords_text($search);
|
||||
if (mb_strlen($text) < 2 || mb_strlen($text) > 8) {
|
||||
return;
|
||||
}
|
||||
if (class_exists('\AKSRT\Settings\Settings') && !\AKSRT\Settings\Settings::hot_search_enabled()) {
|
||||
return;
|
||||
}
|
||||
$keywords = get_option('search_keywords', []);
|
||||
$keywords = is_array($keywords) ? $keywords : [];
|
||||
$limit = class_exists('\AKSRT\Settings\Settings')
|
||||
? max(10, min(50, (int) \AKSRT\Settings\Settings::get_value('search_popular_key_num', 20)))
|
||||
: 20;
|
||||
$keywords = array_slice($keywords, 0, $limit + 10, true);
|
||||
$keywords[$search] = isset($keywords[$search]) ? (int) $keywords[$search] + 1 : 1;
|
||||
arsort($keywords, SORT_NUMERIC);
|
||||
update_option('search_keywords', $keywords, false);
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_get_search_keywords_but')) :
|
||||
/**
|
||||
* Render keyword chip links.
|
||||
@@ -48,9 +124,14 @@ if (!function_exists('aksrt_get_search_keywords_but')) :
|
||||
if ($kw === '') {
|
||||
continue;
|
||||
}
|
||||
$text = aksrt_get_search_keywords_text($kw);
|
||||
$query = ['s' => $text];
|
||||
if (preg_match('/&type=([a-z0-9_-]+)/i', $kw, $match)) {
|
||||
$query['type'] = sanitize_key($match[1]);
|
||||
}
|
||||
$out .= '<a class="search_keywords muted-2-color but em09 mr6 mb6" data-search-keyword="' . esc_attr($kw) . '" href="'
|
||||
. esc_url(home_url('/?s=' . rawurlencode($kw))) . '">'
|
||||
. esc_html($kw) . '</a> ';
|
||||
. esc_url(add_query_arg($query, home_url('/'))) . '">'
|
||||
. esc_html($text) . '</a> ';
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
@@ -178,12 +259,12 @@ if (!function_exists('aksrt_get_search_box')) :
|
||||
$input_html .= '<div class="scale-placeholder' . ($s !== '' ? ' is-focus' : '') . '" default="'
|
||||
. $args['placeholder'] . '">' . $args['placeholder'] . '</div>';
|
||||
$input_html .= '<div class="abs-right muted-color"><button type="submit" tabindex="2" class="null" aria-label="'
|
||||
. esc_attr__('搜索', 'aksrt') . '"><i class="fas fa-search" aria-hidden="true"></i></button></div>';
|
||||
. esc_attr__('搜索', 'aksrt') . '"><i class="fa fas fa-search" aria-hidden="true"></i></button></div>';
|
||||
$input_html .= '</div>';
|
||||
|
||||
$input_html .= '<input type="hidden" name="aksrt_search_type" value="' . esc_attr($in_type) . '">';
|
||||
$input_html .= '<input type="hidden" name="type" value="' . esc_attr($in_type) . '">';
|
||||
if ($cat_html !== '' || (string) $args['in_cat'] !== '') {
|
||||
$input_html .= '<input type="hidden" name="aksrt_category" value="'
|
||||
$input_html .= '<input type="hidden" name="trem" value="'
|
||||
. esc_attr((string) ($args['in_cat'] !== '' ? $args['in_cat'] : ($state['category_id'] ?? 0))) . '">';
|
||||
}
|
||||
if ((string) $args['in_user'] !== '') {
|
||||
@@ -196,7 +277,7 @@ if (!function_exists('aksrt_get_search_box')) :
|
||||
}
|
||||
|
||||
$form_html = '<form method="get" class="padding-10 search-form" action="'
|
||||
. esc_url(home_url('/')) . '" role="search" data-aksrt-search-form="box">'
|
||||
. esc_url(home_url('/')) . '">'
|
||||
. $type_html
|
||||
. '<div class="line-form">' . $cat_html . $input_html . '</div>'
|
||||
. '</form>';
|
||||
@@ -233,19 +314,14 @@ if (!function_exists('aksrt_get_search_box')) :
|
||||
}
|
||||
if ($show_h) {
|
||||
$hist = aksrt_get_search_history_keywords();
|
||||
// Empty shell still rendered so client localStorage can fill it.
|
||||
$keyword_link = aksrt_get_search_keywords_but($hist, 'history');
|
||||
$history_html = '<div class="search-keywords history-search" data-aksrt-menu-history="1">';
|
||||
$history_html .= '<p class="muted-color"><span>' . esc_html__('历史搜索', 'aksrt') . '</span>';
|
||||
$history_html .= '<a class="pull-right trash-history-search muted-3-color" href="javascript:;" data-aksrt-clear-menu-history="1" aria-label="'
|
||||
. esc_attr__('清空历史', 'aksrt') . '"><i class="fas fa-trash-alt em12" aria-hidden="true"></i></a></p>';
|
||||
$history_html .= '<div class="history-search-list">';
|
||||
if ($keyword_link !== '') {
|
||||
$history_html .= $keyword_link;
|
||||
} else {
|
||||
$history_html .= '<span class="muted-3-color em09" data-empty="1">' . esc_html__('暂无历史', 'aksrt') . '</span>';
|
||||
$history_html = '<div class="search-keywords history-search">';
|
||||
$history_html .= '<p class="muted-color"><span>' . esc_html__('历史搜索', 'aksrt') . '</span>';
|
||||
$history_html .= '<a class="pull-right trash-history-search muted-3-color" href="javascript:;" aria-label="'
|
||||
. esc_attr__('清空历史', 'aksrt') . '"><i class="fa fas fa-trash-alt em12" aria-hidden="true"></i></a></p>';
|
||||
$history_html .= '<div>' . $keyword_link . '</div></div>';
|
||||
}
|
||||
$history_html .= '</div></div>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,12 +345,9 @@ if (!function_exists('aksrt_get_search_box')) :
|
||||
}
|
||||
}
|
||||
|
||||
// Live suggestions mount (AKSRT extension; does not break zibll classes).
|
||||
$suggest = '<div class="aksrt-menu-search-suggest mt10" data-aksrt-menu-suggest="1" hidden></div>';
|
||||
|
||||
$class = $args['class'] ? ' ' . sanitize_html_class((string) $args['class']) : '';
|
||||
$html = '<div class="search-input' . esc_attr($class) . '">'
|
||||
. $form_html . $keywords_html . $history_html . $posts_html . $suggest
|
||||
. $form_html . $keywords_html . $history_html . $posts_html
|
||||
. '</div>';
|
||||
|
||||
if ($echo) {
|
||||
|
||||
@@ -67,7 +67,7 @@ if (!function_exists('aksrt_get_search_posts')) :
|
||||
: (string) $views;
|
||||
$time_ago = human_time_diff(get_the_time('U', $post_id), current_time('timestamp'));
|
||||
$info = '<item>' . esc_html(sprintf(/* translators: %s: relative time */ __('%s前', 'aksrt'), $time_ago))
|
||||
. '</item><item class="pull-right"><i class="fas fa-eye" aria-hidden="true"></i> '
|
||||
. '</item><item class="pull-right"><i class="fa fas fa-eye" aria-hidden="true"></i> '
|
||||
. esc_html((string) $views_txt) . '</item>';
|
||||
|
||||
$lists .= '<div class="swiper-slide em09 mr10" style="width:160px;">';
|
||||
|
||||
@@ -30,7 +30,7 @@ endif;
|
||||
|
||||
if (!function_exists('aksrt_get_slider_config')):
|
||||
/**
|
||||
* Get the global slider config for Hero/Banner rendering.
|
||||
* Get the global slider config for content-stream Banner rendering.
|
||||
* Falls back to sensible defaults when no config is saved.
|
||||
*
|
||||
* @return array<string,mixed>
|
||||
@@ -49,16 +49,14 @@ endif;
|
||||
|
||||
if (!function_exists('aksrt_get_banners')):
|
||||
/**
|
||||
* 获取已启用的 Hero 幻灯片列表(供首页 Hero 轮播使用)
|
||||
* 数据由后台 "内容配置 → Hero 轮播" 管理
|
||||
* 获取已启用的首页内容流 Banner。
|
||||
*
|
||||
* @param int $limit 最大数量
|
||||
* @return array
|
||||
*/
|
||||
function aksrt_get_banners($limit = 8, $kind = 'hero') {
|
||||
$kind = in_array($kind, array('hero', 'banner'), true) ? $kind : 'hero';
|
||||
function aksrt_get_banners($limit = 8) {
|
||||
$limit = max(1, min(20, (int) $limit));
|
||||
$cache_key = 'aksrt_banners_' . $kind . '_' . $limit;
|
||||
$cache_key = 'aksrt_banners_' . $limit;
|
||||
$cached = wp_cache_get($cache_key, 'aksrt');
|
||||
if (is_array($cached)) {
|
||||
return $cached;
|
||||
@@ -71,24 +69,12 @@ function aksrt_get_banners($limit = 8, $kind = 'hero') {
|
||||
'orderby' => 'menu_order',
|
||||
'order' => 'ASC',
|
||||
'no_found_rows' => true,
|
||||
'meta_query' => 'hero' === $kind
|
||||
? array(
|
||||
'relation' => 'OR',
|
||||
array(
|
||||
'key' => '_aksrt_kind',
|
||||
'value' => 'hero',
|
||||
),
|
||||
array(
|
||||
'key' => '_aksrt_kind',
|
||||
'compare' => 'NOT EXISTS',
|
||||
),
|
||||
)
|
||||
: array(
|
||||
array(
|
||||
'key' => '_aksrt_kind',
|
||||
'value' => 'banner',
|
||||
),
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => '_aksrt_kind',
|
||||
'value' => 'banner',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$query = new WP_Query($args);
|
||||
@@ -114,9 +100,7 @@ function aksrt_get_banners($limit = 8, $kind = 'hero') {
|
||||
'link_target' => get_post_meta($id, '_link_target', true) ?: '_self',
|
||||
'text_align' => get_post_meta($id, '_text_align', true) ?: 'left',
|
||||
'device_visibility' => get_post_meta($id, '_device_visibility', true) ?: 'all',
|
||||
'kind' => get_post_meta($id, '_aksrt_kind', true) ?: 'hero',
|
||||
'show_text' => get_post_meta($id, '_show_text', true) !== '0',
|
||||
// show_meta: legacy field, read for backward compat but not consumed by frontend
|
||||
'show_meta' => get_post_meta($id, '_show_meta', true) === '1',
|
||||
'text_size_pc' => get_post_meta($id, '_text_size_pc', true) ?: '',
|
||||
'text_size_m' => get_post_meta($id, '_text_size_m', true) ?: '',
|
||||
@@ -132,108 +116,6 @@ function aksrt_get_banners($limit = 8, $kind = 'hero') {
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_render_slider_markup')):
|
||||
/**
|
||||
* Render a shared slider block for Hero and Banner sections.
|
||||
* Uses Swiper.js when available, falls back to native JS.
|
||||
*
|
||||
* @param array $slides Slider items.
|
||||
* @param array $args Render options.
|
||||
*/
|
||||
function aksrt_render_slider_markup(array $slides, array $args = array()) {
|
||||
if (empty($slides)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$args = array_merge(
|
||||
array(
|
||||
'section_class' => 'hero hero--slider hero--with-overlay-nav',
|
||||
'section_id' => '',
|
||||
'section_label' => __('轮播', 'aksrt'),
|
||||
'content_class' => 'hero__content hero__content--slide',
|
||||
'with_search' => false,
|
||||
'search_id' => 'hero-search',
|
||||
'search_class' => 'hero-search hero-search--floating hero-search--pill',
|
||||
'search_placeholder' => aksrt_get_search_placeholder(),
|
||||
'show_meta' => false,
|
||||
),
|
||||
$args
|
||||
);
|
||||
|
||||
$slide_count = count($slides);
|
||||
$section_id_attr = $args['section_id'] ? ' id="' . esc_attr($args['section_id']) . '"' : '';
|
||||
|
||||
// Swiper config JSON
|
||||
$swiper_config = array(
|
||||
'effect' => 'fade',
|
||||
'loop' => $slide_count > 1,
|
||||
'speed' => 600,
|
||||
'autoplay' => $slide_count > 1 ? array('delay' => 5000, 'disableOnInteraction' => false) : false,
|
||||
'pagination' => array('type' => 'progressbar'),
|
||||
'keyboard' => array('enabled' => true),
|
||||
'a11y' => array('prevSlideMessage' => __('上一张', 'aksrt'), 'nextSlideMessage' => __('下一张', 'aksrt')),
|
||||
);
|
||||
?>
|
||||
<section class="<?php echo esc_attr($args['section_class']); ?>"<?php echo $section_id_attr; ?> aria-label="<?php echo esc_attr($args['section_label']); ?>">
|
||||
<div class="swiper hero-swiper" data-swiper-config="<?php echo esc_attr(json_encode($swiper_config)); ?>">
|
||||
<div class="swiper-wrapper">
|
||||
<?php foreach ($slides as $index => $slide) : ?>
|
||||
<?php
|
||||
$show_text = ! isset($slide['show_text']) || $slide['show_text'];
|
||||
$show_meta_flag = $args['show_meta'] && (! isset($slide['show_meta']) || $slide['show_meta']);
|
||||
$has_title = ! empty($slide['title']);
|
||||
$has_subtitle = ! empty($slide['subtitle']);
|
||||
?>
|
||||
<div class="swiper-slide"<?php if (! empty($slide['link'])) : ?> data-link="<?php echo esc_url($slide['link']); ?>"<?php endif; ?>>
|
||||
<div class="hero__slide-bg">
|
||||
<?php if (! empty($slide['image'])) : ?>
|
||||
<img<?php echo aksrt_get_lazy_attr('lazy_sider', (string) $slide['image'], 'fit-cover', aksrt_get_lazy_thumb('lg')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
alt="<?php echo esc_attr($slide['title'] ?: get_bloginfo('name')); ?>"
|
||||
decoding="async"
|
||||
>
|
||||
<?php else : ?>
|
||||
<div class="hero__slide-bg-fallback"></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="hero__slide-overlay"></div>
|
||||
<?php if ($show_text && ($has_title || $has_subtitle)) : ?>
|
||||
<div class="<?php echo esc_attr($args['content_class']); ?>">
|
||||
<?php if ($has_title) : ?>
|
||||
<h1 class="hero__title"><?php echo esc_html($slide['title']); ?></h1>
|
||||
<?php endif; ?>
|
||||
<?php if ($has_subtitle) : ?>
|
||||
<p class="hero__subtitle"><?php echo esc_html($slide['subtitle']); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<?php if ($slide_count > 1) : ?>
|
||||
<div class="hero__controls">
|
||||
<div class="swiper-pagination hero__pagination"></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if ($args['with_search']) : ?>
|
||||
<div class="<?php echo esc_attr($args['search_class']); ?>">
|
||||
<span class="hero-search__icon" aria-hidden="true">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>
|
||||
</span>
|
||||
<form role="search" method="get" action="<?php echo esc_url(home_url('/')); ?>">
|
||||
<input type="hidden" name="aksrt_search_type" value="<?php echo esc_attr(aksrt_get_search_form_type()); ?>">
|
||||
<label class="screen-reader-text" for="<?php echo esc_attr($args['search_id']); ?>"><?php esc_html_e('搜索', 'aksrt'); ?></label>
|
||||
<input type="search" id="<?php echo esc_attr($args['search_id']); ?>" name="s" placeholder="<?php echo esc_attr($args['search_placeholder']); ?>">
|
||||
</form>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
<?php
|
||||
}
|
||||
endif;
|
||||
|
||||
// ============================================================
|
||||
// 模板标签:图标覆盖卡片(顶部多功能组件叠加层)
|
||||
// 完全模仿 zibll 的 zib_icon_cover_card
|
||||
@@ -246,7 +128,7 @@ if (!function_exists('aksrt_render_icon_cover_card')):
|
||||
* 结构:左侧圆形/方形图标 + 右侧标题和描述
|
||||
*
|
||||
* @param array $card 卡片配置
|
||||
* - icon: string Font Awesome 类名 (如 'fas fa-magic')
|
||||
* - icon: string Font Awesome 类名 (如 'fa fas fa-magic')
|
||||
* - custom_icon: string 自定义 SVG/HTML 图标(优先于 icon)
|
||||
* - icon_class: string 图标颜色类 (c-yellow, c-blue, c-green, c-red, c-orange, c-cyan, c-pink, jb-cyan, jb-green, jb-orange)
|
||||
* - icon_shape: string 图标形状 'circle' | 'square'
|
||||
@@ -262,7 +144,7 @@ function aksrt_render_icon_cover_card(array $card): string {
|
||||
return aksrt_icon_cover_card($card);
|
||||
}
|
||||
|
||||
$icon = $card['icon'] ?? 'fas fa-star';
|
||||
$icon = $card['icon'] ?? 'fa fas fa-star';
|
||||
$custom_icon = $card['custom_icon'] ?? ($card['customize_icon'] ?? '');
|
||||
$icon_class = trim((string) ($card['icon_class'] ?? 'c-blue'));
|
||||
if (($card['icon_shape'] ?? '') === 'square' && !str_contains($icon_class, 'radius4')) {
|
||||
|
||||
@@ -387,10 +387,8 @@ function aksrt_flush_banner_cache($post_id = 0) {
|
||||
return;
|
||||
}
|
||||
// Group flush is not available on all object caches; delete common keys.
|
||||
foreach (array('hero', 'banner') as $kind) {
|
||||
for ($n = 1; $n <= 20; $n++) {
|
||||
wp_cache_delete('aksrt_banners_' . $kind . '_' . $n, 'aksrt');
|
||||
}
|
||||
for ($n = 1; $n <= 20; $n++) {
|
||||
wp_cache_delete('aksrt_banners_' . $n, 'aksrt');
|
||||
}
|
||||
}
|
||||
add_action('save_post_aksrt_banner', 'aksrt_flush_banner_cache');
|
||||
@@ -450,7 +448,7 @@ if (!function_exists('aksrt_render_footer_tabbar_single_extend')) :
|
||||
data-post-id="<?php echo esc_attr((string) $post_id); ?>"
|
||||
data-initial-active="<?php echo $is_liked ? '1' : '0'; ?>"
|
||||
aria-label="<?php esc_attr_e('点赞', 'aksrt'); ?>">
|
||||
<i class="<?php echo $is_liked ? 'fas' : 'far'; ?> fa-heart" aria-hidden="true"></i>
|
||||
<i class="<?php echo $is_liked ? 'fa' : 'fa'; ?> fa-heart" aria-hidden="true"></i>
|
||||
<?php if ($show_text) : ?><span data-stat-count="likes" data-base-count="<?php echo esc_attr((string) $like_count); ?>"><?php echo esc_html((string) $like_count); ?></span><?php endif; ?>
|
||||
</button>
|
||||
<?php
|
||||
@@ -464,7 +462,7 @@ if (!function_exists('aksrt_render_footer_tabbar_single_extend')) :
|
||||
data-post-id="<?php echo esc_attr((string) $post_id); ?>"
|
||||
data-initial-active="<?php echo $is_favorited ? '1' : '0'; ?>"
|
||||
aria-label="<?php esc_attr_e('收藏', 'aksrt'); ?>">
|
||||
<i class="<?php echo $is_favorited ? 'fas' : 'far'; ?> fa-star" aria-hidden="true"></i>
|
||||
<i class="<?php echo $is_favorited ? 'fa' : 'fa'; ?> fa-star" aria-hidden="true"></i>
|
||||
<?php if ($show_text) : ?><span data-stat-count="favorites" data-base-count="<?php echo esc_attr((string) $favorite_count); ?>"><?php echo esc_html((string) $favorite_count); ?></span><?php endif; ?>
|
||||
</button>
|
||||
<?php
|
||||
@@ -484,7 +482,7 @@ if (!function_exists('aksrt_render_footer_tabbar_single_extend')) :
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
aria-label="<?php esc_attr_e('分享', 'aksrt'); ?>">
|
||||
<i class="fas fa-share-alt" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-share-alt" aria-hidden="true"></i>
|
||||
<?php if ($show_text) : ?><span><?php esc_html_e('分享', 'aksrt'); ?></span><?php endif; ?>
|
||||
</button>
|
||||
<button type="button"
|
||||
@@ -495,7 +493,7 @@ if (!function_exists('aksrt_render_footer_tabbar_single_extend')) :
|
||||
data-share-url="<?php echo esc_url((string) $share_url); ?>"
|
||||
<?php if ($share_image !== '') : ?>data-share-image="<?php echo esc_url((string) $share_image); ?>"<?php endif; ?>
|
||||
aria-label="<?php esc_attr_e('海报', 'aksrt'); ?>">
|
||||
<i class="fas fa-image" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-image" aria-hidden="true"></i>
|
||||
<?php if ($show_text) : ?><span><?php esc_html_e('海报', 'aksrt'); ?></span><?php endif; ?>
|
||||
</button>
|
||||
<?php
|
||||
@@ -515,7 +513,7 @@ if (!function_exists('aksrt_render_footer_tabbar_single_extend')) :
|
||||
class="tabbar-item single-action-tabbar"
|
||||
data-type="comment"
|
||||
aria-label="<?php esc_attr_e('评论', 'aksrt'); ?>">
|
||||
<i class="far fa-comment" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-comment" aria-hidden="true"></i>
|
||||
<?php if ($show_text) : ?><span><?php echo esc_html((string) $comment_count); ?></span><?php endif; ?>
|
||||
</a>
|
||||
<?php
|
||||
|
||||
@@ -34,20 +34,10 @@ function aksrt_get_search_hot_keywords(): array {
|
||||
if (!\AKSRT\Settings\Settings::hot_search_enabled()) {
|
||||
return [];
|
||||
}
|
||||
$keywords = \AKSRT\Settings\Settings::hot_search_keywords();
|
||||
// 置顶词前置
|
||||
$sticky = \AKSRT\Settings\Settings::search_popular_sticky();
|
||||
if (!empty($sticky)) {
|
||||
$keywords = array_values(array_unique(array_merge($sticky, $keywords)));
|
||||
}
|
||||
return $keywords;
|
||||
return \AKSRT\Settings\Settings::hot_search_keywords();
|
||||
}
|
||||
|
||||
if (!aksrt_get_setting('hot_search_enabled', true)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$raw = aksrt_get_setting('hot_search_keywords', '');
|
||||
$raw = aksrt_get_setting('search_popular_sticky', '');
|
||||
$items = is_array($raw) ? $raw : (preg_split('/[\r\n,]+/', (string) $raw) ?: []);
|
||||
$items = array_map(static function ($keyword): string {
|
||||
return trim(sanitize_text_field((string) $keyword));
|
||||
@@ -124,23 +114,7 @@ function aksrt_search_history_enabled(): bool {
|
||||
return \AKSRT\Settings\Settings::search_history_enabled();
|
||||
}
|
||||
|
||||
return !empty(aksrt_get_setting('search_history_enabled', true));
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_search_suggestions_enabled')):
|
||||
/**
|
||||
* 是否启用搜索建议
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function aksrt_search_suggestions_enabled(): bool {
|
||||
if (class_exists('\AKSRT\Settings\Settings')) {
|
||||
return \AKSRT\Settings\Settings::search_suggestions_enabled();
|
||||
}
|
||||
|
||||
return aksrt_get_setting('search_type', 'default') === 'ajax'
|
||||
&& !empty(aksrt_get_setting('search_suggestions_enabled', false));
|
||||
return !empty(aksrt_get_setting('search_history', true));
|
||||
}
|
||||
endif;
|
||||
|
||||
@@ -162,9 +136,9 @@ function aksrt_get_search_form_type(): string {
|
||||
$allowed_types = ['post'];
|
||||
}
|
||||
|
||||
$type = sanitize_key((string) get_query_var('aksrt_search_type'));
|
||||
if ($type === '' && isset($_GET['aksrt_search_type'])) {
|
||||
$type = sanitize_key((string) wp_unslash($_GET['aksrt_search_type']));
|
||||
$type = sanitize_key((string) get_query_var('type'));
|
||||
if ($type === '' && isset($_GET['type'])) {
|
||||
$type = sanitize_key((string) wp_unslash($_GET['type']));
|
||||
}
|
||||
|
||||
if (in_array($type, $allowed_types, true)) {
|
||||
@@ -184,8 +158,7 @@ if (!function_exists('aksrt_get_search_type_options')):
|
||||
function aksrt_get_search_type_options(): array {
|
||||
$label_map = [
|
||||
'post' => __('文章', 'aksrt'),
|
||||
'category' => __('分类', 'aksrt'),
|
||||
'tag' => __('标签', 'aksrt'),
|
||||
'user' => __('用户', 'aksrt'),
|
||||
];
|
||||
|
||||
if (!class_exists('\AKSRT\Settings\Settings')) {
|
||||
@@ -255,14 +228,21 @@ if (!function_exists('aksrt_get_search_categories')):
|
||||
* @return WP_Term[]
|
||||
*/
|
||||
function aksrt_get_search_categories(): array {
|
||||
$categories = get_categories([
|
||||
$include = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::search_more_cat_obj() : [];
|
||||
$args = [
|
||||
'taxonomy' => 'category',
|
||||
'hide_empty' => true,
|
||||
'number' => 0,
|
||||
'orderby' => 'name',
|
||||
'order' => 'ASC',
|
||||
'fields' => 'all',
|
||||
]);
|
||||
];
|
||||
if ($include) {
|
||||
$args['include'] = $include;
|
||||
$args['orderby'] = 'include';
|
||||
$args['hide_empty'] = false;
|
||||
}
|
||||
$categories = get_categories($args);
|
||||
|
||||
if (!is_array($categories)) {
|
||||
return [];
|
||||
@@ -284,7 +264,7 @@ function aksrt_get_search_form_state(): array {
|
||||
$types = function_exists('aksrt_get_search_type_options') ? aksrt_get_search_type_options() : ['post' => __('文章', 'aksrt')];
|
||||
$type = function_exists('aksrt_get_search_form_type') ? aksrt_get_search_form_type() : 'post';
|
||||
$default_category = function_exists('aksrt_get_search_default_category_id') ? aksrt_get_search_default_category_id() : 0;
|
||||
$current_category = isset($_GET['aksrt_category']) ? absint(wp_unslash($_GET['aksrt_category'])) : $default_category;
|
||||
$current_category = isset($_GET['trem']) ? absint(wp_unslash($_GET['trem'])) : $default_category;
|
||||
$category_enabled = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::search_cat_enabled() : false;
|
||||
$categories = $category_enabled ? aksrt_get_search_categories() : [];
|
||||
|
||||
@@ -298,6 +278,149 @@ function aksrt_get_search_form_state(): array {
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_get_search_facets_data')):
|
||||
/**
|
||||
* Resolve the configured Zibll search facets to ordered term data.
|
||||
*
|
||||
* @return array<string,array<int,array{id:int,name:string,taxonomy:string}>>
|
||||
*/
|
||||
function aksrt_get_search_facets_data(): array {
|
||||
$raw = class_exists('\\AKSRT\\Settings\\Settings')
|
||||
? \AKSRT\Settings\Settings::get_value('search_facets', [])
|
||||
: [];
|
||||
if (!is_array($raw) || $raw === []) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$allowed = ['category', 'topics', 'post_tag'];
|
||||
$data = [];
|
||||
foreach ($raw as $taxonomy => $ids) {
|
||||
$taxonomy = sanitize_key((string) $taxonomy);
|
||||
if (!in_array($taxonomy, $allowed, true) || !taxonomy_exists($taxonomy)) {
|
||||
continue;
|
||||
}
|
||||
if (!is_array($ids)) {
|
||||
$ids = preg_split('/[,,\s]+/', (string) $ids) ?: [];
|
||||
}
|
||||
$ids = array_values(array_filter(array_unique(array_map('absint', $ids))));
|
||||
if ($ids === []) {
|
||||
continue;
|
||||
}
|
||||
$terms = get_terms([
|
||||
'taxonomy' => $taxonomy,
|
||||
'include' => $ids,
|
||||
'orderby' => 'include',
|
||||
'hide_empty' => false,
|
||||
]);
|
||||
if (is_wp_error($terms)) {
|
||||
continue;
|
||||
}
|
||||
foreach ($terms as $term) {
|
||||
if (!$term instanceof WP_Term) {
|
||||
continue;
|
||||
}
|
||||
$data[$taxonomy][] = [
|
||||
'id' => (int) $term->term_id,
|
||||
'name' => wp_html_excerpt($term->name, 15, '...'),
|
||||
'taxonomy' => $term->taxonomy,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return apply_filters('aksrt_search_facets_data', $data);
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_get_search_filter_url')):
|
||||
/** Build a search filter URL while preserving the reference request contract. */
|
||||
function aksrt_get_search_filter_url(array $changes): string {
|
||||
$params = [
|
||||
's' => get_search_query(),
|
||||
'type' => function_exists('aksrt_get_search_form_type') ? aksrt_get_search_form_type() : 'post',
|
||||
'trem' => isset($_REQUEST['trem']) ? absint(wp_unslash($_REQUEST['trem'])) : 0,
|
||||
'user' => isset($_REQUEST['user']) ? absint(wp_unslash($_REQUEST['user'])) : 0,
|
||||
'orderby' => isset($_REQUEST['orderby']) ? sanitize_key(wp_unslash($_REQUEST['orderby'])) : '',
|
||||
];
|
||||
foreach ($changes as $key => $value) {
|
||||
$params[sanitize_key((string) $key)] = $value;
|
||||
}
|
||||
$params = array_filter($params, static fn($value): bool => $value !== '' && $value !== 0 && $value !== null);
|
||||
return add_query_arg($params, home_url('/'));
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_get_search_orderby_lists')):
|
||||
/** Render the Zibll search ordering row. */
|
||||
function aksrt_get_search_orderby_lists(string $type): string {
|
||||
$options = [
|
||||
'post' => [
|
||||
'date' => __('最新', 'aksrt'),
|
||||
'views' => __('热门', 'aksrt'),
|
||||
'like' => __('点赞', 'aksrt'),
|
||||
'comment_count' => __('评论', 'aksrt'),
|
||||
'favorite' => __('收藏', 'aksrt'),
|
||||
'sales_volume' => __('销量', 'aksrt'),
|
||||
],
|
||||
'user' => [
|
||||
'name' => __('昵称', 'aksrt'),
|
||||
'registered' => __('注册时间', 'aksrt'),
|
||||
],
|
||||
];
|
||||
$options = apply_filters('aksrt_search_orderby_options', $options);
|
||||
if (empty($options[$type]) || !is_array($options[$type])) {
|
||||
return '';
|
||||
}
|
||||
$current = isset($_REQUEST['orderby']) ? sanitize_key(wp_unslash($_REQUEST['orderby'])) : '';
|
||||
$items = '';
|
||||
foreach ($options[$type] as $key => $label) {
|
||||
$key = sanitize_key((string) $key);
|
||||
if ($current === $key) {
|
||||
$items .= '<span class="focus-color">' . esc_html((string) $label) . '</span>';
|
||||
} else {
|
||||
$items .= '<a rel="nofollow" ajax-replace="true" class="muted-color ajax-next" href="'
|
||||
. esc_url(aksrt_get_search_filter_url(['orderby' => $key])) . '">' . esc_html((string) $label) . '</a>';
|
||||
}
|
||||
}
|
||||
return $items === '' ? '' : '<div class="flex ac mini-scrollbar scroll-x search-filter-item search-filter-orderby"><span class="opacity5">'
|
||||
. esc_html__('排序', 'aksrt') . '</span>' . $items . '</div>';
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_get_search_tab_nav_filter')):
|
||||
/** Render search facets and ordering with the reference DOM contract. */
|
||||
function aksrt_get_search_tab_nav_filter(string $type): string {
|
||||
$filters = '';
|
||||
if ($type === 'post') {
|
||||
$labels = [
|
||||
'category' => __('分类', 'aksrt'),
|
||||
'topics' => __('专题', 'aksrt'),
|
||||
'post_tag' => __('标签', 'aksrt'),
|
||||
];
|
||||
$current = isset($_REQUEST['trem']) ? absint(wp_unslash($_REQUEST['trem'])) : 0;
|
||||
foreach (aksrt_get_search_facets_data() as $taxonomy => $terms) {
|
||||
$items = '';
|
||||
foreach ($terms as $term) {
|
||||
if ($current === (int) $term['id']) {
|
||||
$items .= '<span class="focus-color">' . esc_html($term['name']) . '</span>';
|
||||
} else {
|
||||
$items .= '<a rel="nofollow" ajax-replace="true" route="true" class="muted-color ajax-next" href="'
|
||||
. esc_url(aksrt_get_search_filter_url(['trem' => (int) $term['id']])) . '">' . esc_html($term['name']) . '</a>';
|
||||
}
|
||||
}
|
||||
if ($items !== '') {
|
||||
$taxonomy_object = get_taxonomy($taxonomy);
|
||||
$label = $taxonomy_object && !empty($taxonomy_object->labels->singular_name)
|
||||
? $taxonomy_object->labels->singular_name
|
||||
: ($labels[$taxonomy] ?? $taxonomy);
|
||||
$filters .= '<div class="flex ac mini-scrollbar scroll-x search-filter-item search-filter-terms"><span class="opacity5">'
|
||||
. esc_html($label) . '</span>' . $items . '</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
return $filters . aksrt_get_search_orderby_lists($type);
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_build_search_url')):
|
||||
/**
|
||||
* 构建搜索跳转 URL
|
||||
@@ -434,7 +557,7 @@ if (!function_exists('aksrt_render_comment_pagination')) {
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<div class="aksrt-loading-indicator" aria-hidden="true">
|
||||
<i class="fas fa-spinner fa-spin"></i>
|
||||
<i class="fa fas fa-spinner fa-spin"></i>
|
||||
<span><?php esc_html_e('加载中…', 'aksrt'); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -32,11 +32,11 @@ $currency = (string) ($currency_name ?? __('积分', 'aksrt'));
|
||||
<div class="uc-asset-card uc-asset-card--points">
|
||||
<div class="uc-asset-card__head flex jsb ac">
|
||||
<div class="uc-asset-card__title">
|
||||
<i class="fas fa-coins em12 mr6" aria-hidden="true"></i><?php echo esc_html($currency); ?>
|
||||
<i class="fa fas fa-money-bill em12 mr6" aria-hidden="true"></i><?php echo esc_html($currency); ?>
|
||||
</div>
|
||||
<span class="uc-asset-card__head-action muted-color px12" data-aksrt-signin>
|
||||
<button type="button" class="uc-asset-card__signin muted-color px12" data-signin-btn disabled>
|
||||
<?php esc_html_e('签到领积分', 'aksrt'); ?><i class="fa fa-angle-right em12 ml3" aria-hidden="true"></i>
|
||||
<?php esc_html_e('签到领积分', 'aksrt'); ?><i class="fa fas fa-angle-right em12 ml3" aria-hidden="true"></i>
|
||||
</button>
|
||||
<span class="uc-asset-card__signin-status" data-signin-status></span>
|
||||
</span>
|
||||
@@ -54,7 +54,7 @@ $currency = (string) ($currency_name ?? __('积分', 'aksrt'));
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="uc-asset-card__link muted-2-color em09" data-aksrt-asset-tab="points_free"><?php esc_html_e('做任务赚积分', 'aksrt'); ?><i class="fa fa-angle-right em12 ml3" aria-hidden="true"></i></button>
|
||||
<button type="button" class="uc-asset-card__link muted-2-color em09" data-aksrt-asset-tab="points_free"><?php esc_html_e('做任务赚积分', 'aksrt'); ?><i class="fa fas fa-angle-right em12 ml3" aria-hidden="true"></i></button>
|
||||
</div>
|
||||
|
||||
<?php if ($points_exchange_on) :
|
||||
@@ -65,8 +65,8 @@ $currency = (string) ($currency_name ?? __('积分', 'aksrt'));
|
||||
<div class="uc-modal" id="aksrt-points-exchange-modal" hidden data-aksrt-points-exchange-modal>
|
||||
<div class="uc-modal__overlay" data-aksrt-points-exchange-close></div>
|
||||
<div class="uc-modal__dialog" role="dialog" aria-modal="true">
|
||||
<button type="button" class="uc-modal__close" data-aksrt-points-exchange-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><i class="fas fa-times" aria-hidden="true"></i></button>
|
||||
<h3 class="uc-modal__title"><i class="fas fa-coins mr6" aria-hidden="true"></i><?php esc_html_e('购买积分', 'aksrt'); ?></h3>
|
||||
<button type="button" class="uc-modal__close" data-aksrt-points-exchange-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><i class="fa fas fa-times" aria-hidden="true"></i></button>
|
||||
<h3 class="uc-modal__title"><i class="fa fas fa-money-bill mr6" aria-hidden="true"></i><?php esc_html_e('购买积分', 'aksrt'); ?></h3>
|
||||
<?php if (!empty($points_exchange['desc'])) : ?>
|
||||
<div class="uc-modal__desc muted-box em09"><?php echo esc_html((string) $points_exchange['desc']); ?></div>
|
||||
<?php endif; ?>
|
||||
@@ -84,7 +84,7 @@ $currency = (string) ($currency_name ?? __('积分', 'aksrt'));
|
||||
<?php if (!empty($card_pass_credits['enabled'])) : ?>
|
||||
<div class="uc-card-pass" data-aksrt-card-pass="credits">
|
||||
<div class="uc-card-pass__title">
|
||||
<i class="fas fa-ticket-alt" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-ticket-alt" aria-hidden="true"></i>
|
||||
<span><?php esc_html_e('卡密兑换积分', 'aksrt'); ?></span>
|
||||
</div>
|
||||
<?php if (!empty($card_pass_credits['desc'])) : ?>
|
||||
|
||||
@@ -95,7 +95,7 @@ $pane = isset($points_tasks_pane) ? sanitize_key((string) $points_tasks_pane)
|
||||
<div class="flex jsb ac mb10">
|
||||
<div class="font-bold"><?php esc_html_e('每日免费积分明细', 'aksrt'); ?></div>
|
||||
<button type="button" class="muted-2-color" data-aksrt-asset-tab="points_free">
|
||||
<?php esc_html_e('返回任务', 'aksrt'); ?><i class="fa fa-angle-right ml6 em12" aria-hidden="true"></i>
|
||||
<?php esc_html_e('返回任务', 'aksrt'); ?><i class="fa fas fa-angle-right ml6 em12" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
<?php if ($detail) : ?>
|
||||
@@ -139,7 +139,7 @@ $pane = isset($points_tasks_pane) ? sanitize_key((string) $points_tasks_pane)
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="muted-2-color shrink0" data-aksrt-asset-tab="points_date">
|
||||
<?php esc_html_e('每日详情', 'aksrt'); ?><i class="fa fa-angle-right ml6 em12" aria-hidden="true"></i>
|
||||
<?php esc_html_e('每日详情', 'aksrt'); ?><i class="fa fas fa-angle-right ml6 em12" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -174,17 +174,17 @@ $pane = isset($points_tasks_pane) ? sanitize_key((string) $points_tasks_pane)
|
||||
</div>
|
||||
<div class="uc-points-tasks__meta shrink0 text-right">
|
||||
<div class="focus-color em14">
|
||||
<i class="fas fa-coins mr6 em09" aria-hidden="true"></i>+ <?php echo esc_html((string) (int) $task['points']); ?>
|
||||
<i class="fa fas fa-money-bill mr6 em09" aria-hidden="true"></i>+ <?php echo esc_html((string) (int) $task['points']); ?>
|
||||
</div>
|
||||
<?php if ($done) : ?>
|
||||
<span class="uc-points-tasks__action muted-color em09 mt6"><?php esc_html_e('今日已完成', 'aksrt'); ?></span>
|
||||
<?php elseif (($action['type'] ?? 'none') === 'signin') : ?>
|
||||
<button type="button" class="uc-points-tasks__action muted-color em09 mt6" data-aksrt-signin-goto>
|
||||
<?php echo esc_html((string) $action['label']); ?><i class="fa fa-angle-right em12 ml3" aria-hidden="true"></i>
|
||||
<?php echo esc_html((string) $action['label']); ?><i class="fa fas fa-angle-right em12 ml3" aria-hidden="true"></i>
|
||||
</button>
|
||||
<?php elseif (($action['type'] ?? 'none') === 'link' && !empty($action['href'])) : ?>
|
||||
<a class="uc-points-tasks__action muted-color em09 mt6" href="<?php echo esc_url((string) $action['href']); ?>">
|
||||
<?php echo esc_html((string) $action['label']); ?><i class="fa fa-angle-right em12 ml3" aria-hidden="true"></i>
|
||||
<?php echo esc_html((string) $action['label']); ?><i class="fa fas fa-angle-right em12 ml3" aria-hidden="true"></i>
|
||||
</a>
|
||||
<?php elseif (($action['type'] ?? 'none') === 'none' && !empty($action['label'])) : ?>
|
||||
<span class="uc-points-tasks__action muted-color em09 mt6"><?php echo esc_html((string) $action['label']); ?></span>
|
||||
|
||||
@@ -33,7 +33,7 @@ if (class_exists('\AKSRT\Credits\Signin')) {
|
||||
?>
|
||||
<div class="uc-signin-calendar" style="margin-bottom:16px;">
|
||||
<h4 class="uc-signin-calendar__title">
|
||||
<i class="fas fa-calendar-alt" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-calendar" aria-hidden="true"></i>
|
||||
<?php esc_html_e('最近 30 天签到', 'aksrt'); ?>
|
||||
</h4>
|
||||
<div data-aksrt-signin-calendar='<?php echo esc_attr(wp_json_encode(array_values($signin_dates))); ?>'></div>
|
||||
|
||||
@@ -12,7 +12,7 @@ defined('ABSPATH') || exit;
|
||||
<div class="uc-transactions">
|
||||
<div class="uc-transactions__header">
|
||||
<h3 class="uc-transactions__title">
|
||||
<i class="fas fa-list-ul" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-list-ul" aria-hidden="true"></i>
|
||||
<?php echo esc_html(sprintf(__('%s明细', 'aksrt'), $currency_name)); ?>
|
||||
</h3>
|
||||
</div>
|
||||
@@ -32,7 +32,7 @@ defined('ABSPATH') || exit;
|
||||
?>
|
||||
<div class="uc-transactions__item">
|
||||
<div class="uc-transactions__icon <?php echo esc_attr($delta_class); ?>">
|
||||
<i class="fas fa-<?php echo $delta >= 0 ? 'arrow-up' : 'arrow-down'; ?>" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-<?php echo $delta >= 0 ? 'arrow-up' : 'arrow-down'; ?>" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="uc-transactions__info">
|
||||
<div class="uc-transactions__reason">
|
||||
@@ -68,7 +68,7 @@ defined('ABSPATH') || exit;
|
||||
<?php else : ?>
|
||||
<div class="uc-transactions__empty">
|
||||
<div class="uc-transactions__empty-icon">
|
||||
<i class="fas fa-receipt" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-file-alt" aria-hidden="true"></i>
|
||||
</div>
|
||||
<p><?php echo esc_html(sprintf(__('还没有任何%s流水', 'aksrt'), $currency_name)); ?></p>
|
||||
</div>
|
||||
|
||||
@@ -53,7 +53,7 @@ if ($vip_level >= 1 && !empty($vip_settings['levels'][$vip_level]['name'])) {
|
||||
$level_icon_url = esc_url((string) ($vip_settings['levels'][$vip_level]['img_icon'] ?? ''));
|
||||
$level_icon = $level_icon_url !== ''
|
||||
? '<img' . aksrt_get_lazy_attr('lazy_other', $level_icon_url, 'aksrt-vip-level-icon') . ' alt="" decoding="async">'
|
||||
: '<i class="fas fa-crown" aria-hidden="true"></i>';
|
||||
: '<i class="fa fas fa-certificate" aria-hidden="true"></i>';
|
||||
if (class_exists('\AKSRT\Settings\Settings')) {
|
||||
$paid_display = \AKSRT\Settings\Settings::get_paid_content_settings();
|
||||
$cash_symbol = (string) ($paid_display['display']['currency_symbol'] ?? '¥');
|
||||
@@ -94,9 +94,9 @@ if (class_exists('\AKSRT\Payment\ChargeCard')) {
|
||||
</div>
|
||||
</div>
|
||||
<div class="uc-vip-card__benefits">
|
||||
<span class="uc-vip-card__benefit"><i class="fas fa-download" aria-hidden="true"></i> <?php esc_html_e('免费下载', 'aksrt'); ?></span>
|
||||
<span class="uc-vip-card__benefit"><i class="fas fa-crown" aria-hidden="true"></i> <?php esc_html_e('专属身份', 'aksrt'); ?></span>
|
||||
<span class="uc-vip-card__benefit"><i class="fas fa-tag" aria-hidden="true"></i> <?php esc_html_e('会员价优惠', 'aksrt'); ?></span>
|
||||
<span class="uc-vip-card__benefit"><i class="fa fas fa-download" aria-hidden="true"></i> <?php esc_html_e('免费下载', 'aksrt'); ?></span>
|
||||
<span class="uc-vip-card__benefit"><i class="fa fas fa-certificate" aria-hidden="true"></i> <?php esc_html_e('专属身份', 'aksrt'); ?></span>
|
||||
<span class="uc-vip-card__benefit"><i class="fa fas fa-tag" aria-hidden="true"></i> <?php esc_html_e('会员价优惠', 'aksrt'); ?></span>
|
||||
</div>
|
||||
<?php if (!empty($vip_settings['desc'])) : ?>
|
||||
<p class="uc-vip-card__desc"><?php echo esc_html((string) $vip_settings['desc']); ?></p>
|
||||
@@ -107,7 +107,7 @@ if (class_exists('\AKSRT\Payment\ChargeCard')) {
|
||||
<?php if (!empty($packages)) : ?>
|
||||
<div class="uc-vip-shop" data-aksrt-vip-shop>
|
||||
<div class="uc-vip-shop__title">
|
||||
<i class="fas fa-gem" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-gem" aria-hidden="true"></i>
|
||||
<span><?php echo esc_html($shop_title); ?></span>
|
||||
</div>
|
||||
|
||||
@@ -203,7 +203,7 @@ if (class_exists('\AKSRT\Payment\ChargeCard')) {
|
||||
<?php if (!empty($points_exchange['enabled']) && $points_pkgs !== []) : ?>
|
||||
<div class="uc-vip-shop uc-vip-shop--points" data-aksrt-vip-points>
|
||||
<div class="uc-vip-shop__title">
|
||||
<i class="fas fa-coins" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-money-bill" aria-hidden="true"></i>
|
||||
<span><?php esc_html_e('积分兑换会员', 'aksrt'); ?></span>
|
||||
</div>
|
||||
<div class="uc-vip-shop__balance">
|
||||
@@ -251,7 +251,7 @@ if (class_exists('\AKSRT\Payment\ChargeCard')) {
|
||||
<?php if (!empty($card_pass_vip['enabled'])) : ?>
|
||||
<div class="uc-card-pass" data-aksrt-card-pass="vip">
|
||||
<div class="uc-card-pass__title">
|
||||
<i class="fas fa-ticket-alt" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-ticket-alt" aria-hidden="true"></i>
|
||||
<span><?php esc_html_e('卡密兑换会员', 'aksrt'); ?></span>
|
||||
</div>
|
||||
<?php if (!empty($card_pass_vip['desc'])) : ?>
|
||||
|
||||
@@ -64,12 +64,12 @@ $mark = (string) ($charge_view['currency_mark'] ?? '元');
|
||||
<div class="uc-asset-card uc-asset-card--wallet">
|
||||
<div class="uc-asset-card__head flex jsb ac">
|
||||
<div class="uc-asset-card__title">
|
||||
<i class="fas fa-wallet em12 mr6" aria-hidden="true"></i><?php esc_html_e('余额', 'aksrt'); ?>
|
||||
<i class="fa fas fa-money-bill em12 mr6" aria-hidden="true"></i><?php esc_html_e('余额', 'aksrt'); ?>
|
||||
</div>
|
||||
<?php if ($withdraw_on) : ?>
|
||||
<button type="button" class="uc-asset-card__head-action muted-color px12" data-aksrt-withdraw-history-open>
|
||||
<?php esc_html_e('提现记录', 'aksrt'); ?>
|
||||
<i class="fa fa-angle-right em12 ml3" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-angle-right em12 ml3" aria-hidden="true"></i>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -98,7 +98,7 @@ $mark = (string) ($charge_view['currency_mark'] ?? '元');
|
||||
<?php if (!empty($card_pass_balance['enabled'])) : ?>
|
||||
<div class="uc-card-pass" data-aksrt-card-pass="balance">
|
||||
<div class="uc-card-pass__title">
|
||||
<i class="fas fa-ticket-alt" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-ticket-alt" aria-hidden="true"></i>
|
||||
<span><?php esc_html_e('卡密兑换余额', 'aksrt'); ?></span>
|
||||
</div>
|
||||
<?php if (!empty($card_pass_balance['desc'])) : ?>
|
||||
@@ -119,8 +119,8 @@ $mark = (string) ($charge_view['currency_mark'] ?? '元');
|
||||
<div class="uc-modal" id="aksrt-charge-modal" hidden data-aksrt-charge-modal>
|
||||
<div class="uc-modal__overlay" data-aksrt-charge-close></div>
|
||||
<div class="uc-modal__dialog" role="dialog" aria-modal="true" aria-labelledby="aksrt-charge-title">
|
||||
<button type="button" class="uc-modal__close" data-aksrt-charge-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><i class="fas fa-times" aria-hidden="true"></i></button>
|
||||
<h3 id="aksrt-charge-title" class="uc-modal__title"><i class="fas fa-wallet mr6" aria-hidden="true"></i><?php esc_html_e('余额充值', 'aksrt'); ?></h3>
|
||||
<button type="button" class="uc-modal__close" data-aksrt-charge-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><i class="fa fas fa-times" aria-hidden="true"></i></button>
|
||||
<h3 id="aksrt-charge-title" class="uc-modal__title"><i class="fa fas fa-money-bill mr6" aria-hidden="true"></i><?php esc_html_e('余额充值', 'aksrt'); ?></h3>
|
||||
<?php if (!empty($charge_view['desc'])) : ?>
|
||||
<div class="uc-modal__desc muted-box em09"><?php echo esc_html((string) $charge_view['desc']); ?></div>
|
||||
<?php endif; ?>
|
||||
@@ -189,8 +189,8 @@ endif; ?>
|
||||
<div class="uc-modal" id="aksrt-withdraw-history-modal" hidden data-aksrt-withdraw-history-modal>
|
||||
<div class="uc-modal__overlay" data-aksrt-withdraw-history-close></div>
|
||||
<div class="uc-modal__dialog" role="dialog" aria-modal="true">
|
||||
<button type="button" class="uc-modal__close" data-aksrt-withdraw-history-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><i class="fas fa-times" aria-hidden="true"></i></button>
|
||||
<h3 class="uc-modal__title"><i class="fas fa-file-invoice-dollar mr6" aria-hidden="true"></i><?php esc_html_e('提现记录', 'aksrt'); ?></h3>
|
||||
<button type="button" class="uc-modal__close" data-aksrt-withdraw-history-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><i class="fa fas fa-times" aria-hidden="true"></i></button>
|
||||
<h3 class="uc-modal__title"><i class="fa fas fa-file-alt mr6" aria-hidden="true"></i><?php esc_html_e('提现记录', 'aksrt'); ?></h3>
|
||||
<div class="uc-withdraw-history">
|
||||
<?php if (!empty($withdraw_history)) : ?>
|
||||
<?php foreach ($withdraw_history as $wd) :
|
||||
@@ -227,7 +227,7 @@ endif; ?>
|
||||
<div class="uc-transactions uc-transactions--wallet">
|
||||
<div class="uc-transactions__header">
|
||||
<h3 class="uc-transactions__title">
|
||||
<i class="fas fa-list-ul" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-list-ul" aria-hidden="true"></i>
|
||||
<?php esc_html_e('余额记录', 'aksrt'); ?>
|
||||
</h3>
|
||||
</div>
|
||||
@@ -246,7 +246,7 @@ endif; ?>
|
||||
?>
|
||||
<div class="uc-transactions__item">
|
||||
<div class="uc-transactions__icon <?php echo esc_attr($delta_class); ?>">
|
||||
<i class="fas fa-<?php echo $delta >= 0 ? 'arrow-up' : 'arrow-down'; ?>" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-<?php echo $delta >= 0 ? 'arrow-up' : 'arrow-down'; ?>" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="uc-transactions__info">
|
||||
<div class="uc-transactions__reason">
|
||||
@@ -279,7 +279,7 @@ endif; ?>
|
||||
?>
|
||||
<?php else : ?>
|
||||
<div class="uc-transactions__empty">
|
||||
<div class="uc-transactions__empty-icon"><i class="fas fa-wallet" aria-hidden="true"></i></div>
|
||||
<div class="uc-transactions__empty-icon"><i class="fa fas fa-money-bill" aria-hidden="true"></i></div>
|
||||
<p><?php esc_html_e('还没有任何余额流水', 'aksrt'); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -10,10 +10,10 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
|
||||
<div class="aksrt-modal__box">
|
||||
<div class="aksrt-modal__header">
|
||||
<div class="aksrt-modal__title-wrap">
|
||||
<span class="aksrt-modal__icon"><i class="fas fa-lock" aria-hidden="true"></i></span>
|
||||
<span class="aksrt-modal__icon"><i class="fa fas fa-lock" aria-hidden="true"></i></span>
|
||||
<h4><?php esc_html_e( '修改密码', 'aksrt' ); ?></h4>
|
||||
</div>
|
||||
<button type="button" class="aksrt-modal__close" data-close-modal title="<?php esc_attr_e( '关闭', 'aksrt' ); ?>"><i class="fas fa-times" aria-hidden="true"></i></button>
|
||||
<button type="button" class="aksrt-modal__close" data-close-modal title="<?php esc_attr_e( '关闭', 'aksrt' ); ?>"><i class="fa fas fa-times" aria-hidden="true"></i></button>
|
||||
</div>
|
||||
<form id="pwd-form" autocomplete="off" novalidate>
|
||||
<div class="modal-field">
|
||||
@@ -59,10 +59,10 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
|
||||
<div class="aksrt-modal__box">
|
||||
<div class="aksrt-modal__header">
|
||||
<div class="aksrt-modal__title-wrap">
|
||||
<span class="aksrt-modal__icon"><i class="far fa-envelope" aria-hidden="true"></i></span>
|
||||
<span class="aksrt-modal__icon"><i class="fa fas fa-envelope" aria-hidden="true"></i></span>
|
||||
<h4><?php esc_html_e( '更改邮箱', 'aksrt' ); ?></h4>
|
||||
</div>
|
||||
<button type="button" class="aksrt-modal__close" data-close-modal title="<?php esc_attr_e( '关闭', 'aksrt' ); ?>"><i class="fas fa-times" aria-hidden="true"></i></button>
|
||||
<button type="button" class="aksrt-modal__close" data-close-modal title="<?php esc_attr_e( '关闭', 'aksrt' ); ?>"><i class="fa fas fa-times" aria-hidden="true"></i></button>
|
||||
</div>
|
||||
<form id="email-form" autocomplete="off" novalidate>
|
||||
<div class="modal-field">
|
||||
|
||||
@@ -45,7 +45,7 @@ $config = [
|
||||
<div class="aksrt-user-auth-panel uc-auth-panel" data-identity-root data-identity-config="<?php echo esc_attr(wp_json_encode($config)); ?>">
|
||||
<?php if ($status === 'verified') : ?>
|
||||
<div class="uc-auth-card uc-auth-card--verified">
|
||||
<span class="uc-auth-card__art"><i class="fas fa-check-circle" aria-hidden="true"></i></span>
|
||||
<span class="uc-auth-card__art"><i class="fa fas fa-check-circle" aria-hidden="true"></i></span>
|
||||
<div class="uc-auth-card__content">
|
||||
<small><?php esc_html_e('已通过云端实人认证', 'aksrt'); ?></small>
|
||||
<h2><?php echo esc_html((string) ($info['name'] ?? __('官方认证', 'aksrt'))); ?></h2>
|
||||
@@ -55,7 +55,7 @@ $config = [
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="uc-auth-card">
|
||||
<span class="uc-auth-card__art"><i class="fas fa-id-badge" aria-hidden="true"></i></span>
|
||||
<span class="uc-auth-card__art"><i class="fa fas fa-id-badge" aria-hidden="true"></i></span>
|
||||
<div class="uc-auth-card__content">
|
||||
<small><?php esc_html_e('身份权益', 'aksrt'); ?></small>
|
||||
<h2><?php esc_html_e('官方认证', 'aksrt'); ?></h2>
|
||||
@@ -74,13 +74,13 @@ $config = [
|
||||
<template data-auth-modal-template>
|
||||
<div class="uc-auth-modal__dialog" role="dialog" aria-modal="true" aria-labelledby="uc-auth-modal-title">
|
||||
<div class="aksrt-modal__header uc-auth-modal__header">
|
||||
<div><span><i class="fas fa-id-badge" aria-hidden="true"></i></span><strong id="uc-auth-modal-title"><?php esc_html_e('身份认证', 'aksrt'); ?></strong></div>
|
||||
<button type="button" class="aksrt-modal__close" data-aksrt-modal-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><i class="fas fa-times" aria-hidden="true"></i></button>
|
||||
<div><span><i class="fa fas fa-id-badge" aria-hidden="true"></i></span><strong id="uc-auth-modal-title"><?php esc_html_e('身份认证', 'aksrt'); ?></strong></div>
|
||||
<button type="button" class="aksrt-modal__close" data-aksrt-modal-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><i class="fa fas fa-times" aria-hidden="true"></i></button>
|
||||
</div>
|
||||
<div class="aksrt-modal__body uc-auth-modal__body">
|
||||
<div data-auth-status <?php echo !$locks_application ? 'hidden' : ''; ?>>
|
||||
<div class="uc-auth-pending">
|
||||
<span><i class="fas fa-shield-alt" aria-hidden="true"></i></span>
|
||||
<span><i class="fa fas fa-shield-alt" aria-hidden="true"></i></span>
|
||||
<h3 data-auth-stage><?php echo esc_html($stage ?: __('准备认证', 'aksrt')); ?></h3>
|
||||
<p data-auth-status-message><?php esc_html_e('认证结果以服务端向云服务商主动查询为准。', 'aksrt'); ?></p>
|
||||
</div>
|
||||
|
||||
@@ -85,7 +85,7 @@ $currency_labels = [
|
||||
</div>
|
||||
<?php if (!$items) : ?>
|
||||
<div class="creator-income__empty">
|
||||
<i class="fas fa-chart-line" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-chart-line" aria-hidden="true"></i>
|
||||
<p><?php esc_html_e('暂无收益明细', 'aksrt'); ?></p>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
|
||||
@@ -91,7 +91,7 @@ if ($show_wallet || $show_credits) :
|
||||
?>
|
||||
<div class="uc-transactions__item">
|
||||
<div class="uc-transactions__icon <?php echo esc_attr($delta_class); ?>">
|
||||
<i class="fas fa-<?php echo $delta >= 0 ? 'arrow-up' : 'arrow-down'; ?>" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-<?php echo $delta >= 0 ? 'arrow-up' : 'arrow-down'; ?>" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="uc-transactions__info">
|
||||
<div class="uc-transactions__reason">
|
||||
|
||||
@@ -50,7 +50,7 @@ $messages_enabled = !empty($messages_url);
|
||||
<div class="uc-follow-management__actions">
|
||||
<a class="btn-ghost btn-sm" href="<?php echo esc_url($home_url); ?>"><?php esc_html_e('主页', 'aksrt'); ?></a>
|
||||
<?php if ($messages_enabled) : ?><a class="btn-ghost btn-sm" href="<?php echo esc_url($message_url); ?>"><?php esc_html_e('私信', 'aksrt'); ?></a><?php endif; ?>
|
||||
<?php if ($active_list === 'following') : ?><button type="button" class="btn-outline btn-sm is-following" data-aksrt-follow="<?php echo esc_attr((string) $member_id); ?>"><i class="fas fa-heart" aria-hidden="true"></i><span><?php esc_html_e('已关注', 'aksrt'); ?></span></button><?php endif; ?>
|
||||
<?php if ($active_list === 'following') : ?><button type="button" class="btn-outline btn-sm is-following" data-aksrt-follow="<?php echo esc_attr((string) $member_id); ?>"><i class="fa fas fa-heart" aria-hidden="true"></i><span><?php esc_html_e('已关注', 'aksrt'); ?></span></button><?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
@@ -16,12 +16,12 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
|
||||
<div class="uc-header__cover-mask"></div>
|
||||
<div class="aksrt-cover-menu" 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="fas fa-ellipsis-h" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-ellipsis-h" aria-hidden="true"></i>
|
||||
</button>
|
||||
<div class="aksrt-cover-menu__panel" role="menu" hidden>
|
||||
<a role="menuitem" href="<?php echo esc_url(aksrt_get_user_home_url()); ?>"><i class="fas fa-home" aria-hidden="true"></i><?php esc_html_e('我的主页', 'aksrt'); ?></a>
|
||||
<a role="menuitem" href="<?php echo esc_url(aksrt_get_user_home_url()); ?>"><i class="fa fas fa-home" aria-hidden="true"></i><?php esc_html_e('我的主页', 'aksrt'); ?></a>
|
||||
<?php if ($allow_bg_upload) : ?>
|
||||
<button type="button" role="menuitem" id="aksrt-upload-bg-btn"><i class="fas fa-image" aria-hidden="true"></i><span><?php esc_html_e('修改背景图', 'aksrt'); ?></span></button>
|
||||
<button type="button" role="menuitem" id="aksrt-upload-bg-btn"><i class="fa fas fa-image" aria-hidden="true"></i><span><?php esc_html_e('修改背景图', 'aksrt'); ?></span></button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -32,7 +32,7 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
|
||||
<?php echo aksrt_get_avatar_html($user_id, 120, ['id' => 'aksrt-user-avatar-image', 'alt' => $target_user->display_name, 'loading' => 'eager']); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php if ($show_avatar_edit) : ?>
|
||||
<button type="button" id="aksrt-upload-avatar-btn" class="uc-header__avatar-upload" title="<?php esc_attr_e('更换头像', 'aksrt'); ?>" aria-label="<?php esc_attr_e('更换头像', 'aksrt'); ?>">
|
||||
<i class="fas fa-camera" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-camera" aria-hidden="true"></i>
|
||||
<span><?php esc_html_e('更换头像', 'aksrt'); ?></span>
|
||||
</button>
|
||||
<input type="file" id="aksrt-avatar-file-input" accept="image/jpeg,image/png,image/webp,image/gif" hidden>
|
||||
@@ -50,11 +50,11 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
|
||||
<?php echo aksrt_render_user_medal_entry((int) $user_id, 'user-center', true); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php endif; ?>
|
||||
<span class="uc-header__meta-item" title="<?php esc_attr_e('用户名', 'aksrt'); ?>">
|
||||
<i class="fas fa-user" aria-hidden="true"></i> <?php echo esc_html($target_user->user_login); ?>
|
||||
<i class="fa fas fa-user" aria-hidden="true"></i> <?php echo esc_html($target_user->user_login); ?>
|
||||
</span>
|
||||
<?php if ($target_user->user_email) : ?>
|
||||
<span class="uc-header__meta-item" title="<?php esc_attr_e('邮箱', 'aksrt'); ?>">
|
||||
<i class="fas fa-envelope" aria-hidden="true"></i> <?php echo esc_html($target_user->user_email); ?>
|
||||
<i class="fa fas fa-envelope" aria-hidden="true"></i> <?php echo esc_html($target_user->user_email); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
@@ -71,7 +71,7 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
|
||||
<div class="uc-header__actions">
|
||||
<?php if (!empty($messages_url)) : ?>
|
||||
<a href="<?php echo esc_url($messages_url); ?>" class="btn-ghost btn-sm">
|
||||
<i class="fas fa-bell" aria-hidden="true"></i> <?php esc_html_e('消息通知', 'aksrt'); ?>
|
||||
<i class="fa fas fa-bell" aria-hidden="true"></i> <?php esc_html_e('消息通知', 'aksrt'); ?>
|
||||
<?php if ($notification_unread_count > 0) : ?>
|
||||
<span class="uc-header__action-badge"><?php echo esc_html((string) $notification_unread_count); ?></span>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -88,7 +88,7 @@ $day_max = \AKSRT\User\Level::day_max();
|
||||
if ($value <= 0 && !in_array($key, ['checkin', 'shop_gift'], true)) continue;
|
||||
?>
|
||||
<div class="uc-level-methods__item">
|
||||
<span><i class="fas fa-bolt" aria-hidden="true"></i></span>
|
||||
<span><i class="fa fas fa-bolt" aria-hidden="true"></i></span>
|
||||
<div><strong><?php echo esc_html($labels[$key] ?? $key); ?></strong><small><?php echo in_array($key, ['checkin', 'shop_gift'], true) ? esc_html__('按活动或商品配置发放', 'aksrt') : esc_html__('完成后自动计入经验', 'aksrt'); ?></small></div>
|
||||
<b><?php echo $value > 0 ? '+' . esc_html((string) $value) : esc_html__('动态', 'aksrt'); ?></b>
|
||||
</div>
|
||||
@@ -106,7 +106,7 @@ $day_max = \AKSRT\User\Level::day_max();
|
||||
$value = max(0, (int) ($row['value'] ?? 0));
|
||||
?>
|
||||
<div class="uc-level-ledger__row">
|
||||
<span class="uc-level-ledger__icon"><i class="fas fa-chart-line" aria-hidden="true"></i></span>
|
||||
<span class="uc-level-ledger__icon"><i class="fa fas fa-chart-line" aria-hidden="true"></i></span>
|
||||
<div><strong><?php echo esc_html($labels[$key] ?? $key); ?></strong><time><?php echo esc_html((string) ($row['time'] ?? '')); ?></time><small><?php printf(esc_html__('累计:%d', 'aksrt'), max(0, (int) ($row['integral'] ?? 0))); ?></small></div>
|
||||
<b>+<?php echo esc_html((string) $value); ?></b>
|
||||
</div>
|
||||
|
||||
@@ -64,7 +64,7 @@ $tabs = [
|
||||
<div class="uc-orders-panel__title-wrap">
|
||||
<p class="aksrt-orders-page__eyebrow"><?php esc_html_e('我的购买', 'aksrt'); ?></p>
|
||||
<div class="uc-orders-panel__title font-bold em12">
|
||||
<i class="fas fa-receipt uc-orders-panel__title-icon" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-file-alt uc-orders-panel__title-icon" aria-hidden="true"></i>
|
||||
<?php esc_html_e('我的订单', 'aksrt'); ?>
|
||||
</div>
|
||||
<p class="muted-2-color em09 mt3"><?php esc_html_e('管理已购内容、会员与账户权益。', 'aksrt'); ?></p>
|
||||
@@ -81,10 +81,10 @@ $tabs = [
|
||||
<?php if ($status !== 'all') : ?><input type="hidden" name="order_status" value="<?php echo esc_attr($status); ?>"><?php endif; ?>
|
||||
<?php if ($type !== '') : ?><input type="hidden" name="order_type" value="<?php echo esc_attr($type); ?>"><?php endif; ?>
|
||||
<label class="screen-reader-text" for="aksrt-order-number"><?php esc_html_e('按订单号查找', 'aksrt'); ?></label>
|
||||
<i class="fas fa-search" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-search" aria-hidden="true"></i>
|
||||
<input id="aksrt-order-number" name="order_number" value="<?php echo esc_attr($order_number); ?>" maxlength="32" placeholder="<?php esc_attr_e('输入订单号开头快速查找', 'aksrt'); ?>">
|
||||
<button class="btn-primary" type="submit"><?php esc_html_e('查找', 'aksrt'); ?></button>
|
||||
<button class="aksrt-orders-page__filter-toggle" type="button" data-aksrt-orders-filter-toggle aria-expanded="false" aria-controls="aksrt-orders-filter-panel"><i class="fas fa-sliders-h" aria-hidden="true"></i> <?php esc_html_e('筛选', 'aksrt'); ?></button>
|
||||
<button class="aksrt-orders-page__filter-toggle" type="button" data-aksrt-orders-filter-toggle aria-expanded="false" aria-controls="aksrt-orders-filter-panel"><i class="fa fas fa-sliders-h" aria-hidden="true"></i> <?php esc_html_e('筛选', 'aksrt'); ?></button>
|
||||
</form>
|
||||
|
||||
<div id="aksrt-orders-filter-panel" class="aksrt-orders-page__filter-panel" data-aksrt-orders-filter-panel hidden>
|
||||
@@ -118,7 +118,7 @@ $tabs = [
|
||||
<article class="aksrt-orders-page__card" data-aksrt-order-card="<?php echo esc_attr($number); ?>" data-order-status="<?php echo esc_attr((string) ($order['status_group'] ?? '')); ?>">
|
||||
<div class="aksrt-orders-page__card-rail"><span><?php echo esc_html((string) ($order['product_type_label'] ?? '')); ?></span><time><?php echo esc_html((string) ($order['created_at'] ?? '')); ?></time><span class="aksrt-orders-page__card-status is-<?php echo esc_attr((string) ($order['status_group'] ?? '')); ?>"><?php echo esc_html((string) ($order['status_label'] ?? '')); ?></span></div>
|
||||
<div class="aksrt-orders-page__card-main">
|
||||
<?php if (!empty($order['image'])) : ?><img class="aksrt-orders-page__card-img" src="<?php echo esc_url((string) $order['image']); ?>" alt=""><?php else : ?><div class="aksrt-orders-page__card-art" aria-hidden="true"><i class="fas fa-book-open"></i></div><?php endif; ?>
|
||||
<?php if (!empty($order['image'])) : ?><img class="aksrt-orders-page__card-img" src="<?php echo esc_url((string) $order['image']); ?>" alt=""><?php else : ?><div class="aksrt-orders-page__card-art" aria-hidden="true"><i class="fa fas fa-book"></i></div><?php endif; ?>
|
||||
<div class="aksrt-orders-page__card-copy"><h3><?php echo esc_html((string) ($order['product_name'] ?? __('订单', 'aksrt'))); ?></h3><p><?php printf(esc_html__('订单号 %s', 'aksrt'), esc_html($number)); ?></p></div>
|
||||
<div class="aksrt-orders-page__card-value"><strong><?php echo $amount; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong><span><?php esc_html_e('实付', 'aksrt'); ?></span></div>
|
||||
</div>
|
||||
@@ -134,7 +134,7 @@ $tabs = [
|
||||
</div>
|
||||
<?php if ($total_pages > 1) : ?><nav class="aksrt-orders-page__pagination" aria-label="<?php esc_attr_e('订单分页', 'aksrt'); ?>"><?php for ($index = 1; $index <= $total_pages; $index++) : ?><a class="aksrt-orders-page__page-chip<?php echo $index === $page ? ' is-active' : ''; ?>" href="<?php echo esc_url($orders_url(['order_page' => $index])); ?>"><?php echo esc_html((string) $index); ?></a><?php endfor; ?></nav><?php endif; ?>
|
||||
<?php else : ?>
|
||||
<div class="aksrt-orders-page__empty"><i class="fas fa-receipt" aria-hidden="true"></i><h3><?php echo esc_html($order_number !== '' || $type !== '' || $status !== 'all' ? __('没有匹配的订单', 'aksrt') : __('还没有购买记录', 'aksrt')); ?></h3><p><?php echo esc_html($order_number !== '' || $type !== '' || $status !== 'all' ? __('换个条件试试,或清除当前筛选。', 'aksrt') : __('购买内容或开通权益后,订单会出现在这里。', 'aksrt')); ?></p><?php if ($order_number !== '' || $type !== '' || $status !== 'all') : ?><a class="btn-outline" href="<?php echo esc_url($orders_url(['order_status' => null, 'order_type' => null, 'order_number' => null, 'order_page' => null])); ?>"><?php esc_html_e('清除条件', 'aksrt'); ?></a><?php endif; ?></div>
|
||||
<div class="aksrt-orders-page__empty"><i class="fa fas fa-file-alt" aria-hidden="true"></i><h3><?php echo esc_html($order_number !== '' || $type !== '' || $status !== 'all' ? __('没有匹配的订单', 'aksrt') : __('还没有购买记录', 'aksrt')); ?></h3><p><?php echo esc_html($order_number !== '' || $type !== '' || $status !== 'all' ? __('换个条件试试,或清除当前筛选。', 'aksrt') : __('购买内容或开通权益后,订单会出现在这里。', 'aksrt')); ?></p><?php if ($order_number !== '' || $type !== '' || $status !== 'all') : ?><a class="btn-outline" href="<?php echo esc_url($orders_url(['order_status' => null, 'order_type' => null, 'order_number' => null, 'order_page' => null])); ?>"><?php esc_html_e('清除条件', 'aksrt'); ?></a><?php endif; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
@@ -151,7 +151,7 @@ $status_labels = [
|
||||
$source_user = !empty($item['source_user_id']) ? get_userdata((int) $item['source_user_id']) : null;
|
||||
$source_name = $source_user instanceof WP_User ? $source_user->display_name : __('推广用户', 'aksrt');
|
||||
?>
|
||||
<article class="uc-commission-row"><span class="uc-commission-row__icon"><i class="fas fa-receipt" aria-hidden="true"></i></span><div class="uc-commission-row__main"><strong><?php echo esc_html($source_name); ?></strong><span><?php printf(esc_html__('订单 %s', 'aksrt'), esc_html((string) ($item['order_number'] ?? '-'))); ?></span><time><?php echo esc_html((string) ($item['created_at'] ?? '')); ?></time></div><div class="uc-commission-row__value"><strong><?php echo esc_html($format_amount((float) ($item['original_amount'] ?? 0) + (float) ($item['adjustment_total'] ?? 0))); ?></strong><span class="is-<?php echo esc_attr($status); ?>"><?php echo esc_html($status_labels[$status] ?? $status); ?></span></div></article>
|
||||
<article class="uc-commission-row"><span class="uc-commission-row__icon"><i class="fa fas fa-file-alt" aria-hidden="true"></i></span><div class="uc-commission-row__main"><strong><?php echo esc_html($source_name); ?></strong><span><?php printf(esc_html__('订单 %s', 'aksrt'), esc_html((string) ($item['order_number'] ?? '-'))); ?></span><time><?php echo esc_html((string) ($item['created_at'] ?? '')); ?></time></div><div class="uc-commission-row__value"><strong><?php echo esc_html($format_amount((float) ($item['original_amount'] ?? 0) + (float) ($item['adjustment_total'] ?? 0))); ?></strong><span class="is-<?php echo esc_attr($status); ?>"><?php echo esc_html($status_labels[$status] ?? $status); ?></span></div></article>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php if ($commission_total_pages > 1) : ?><nav class="uc-reward-pagination" aria-label="<?php esc_attr_e('佣金明细分页', 'aksrt'); ?>"><?php for ($i = 1; $i <= $commission_total_pages; $i++) : ?><a class="<?php echo $i === $commission_page ? 'is-active' : ''; ?>" href="<?php echo esc_url($reward_url('orders', ['commission_page' => $i])); ?>"><?php echo esc_html((string) $i); ?></a><?php endfor; ?></nav><?php endif; ?>
|
||||
|
||||
@@ -17,5 +17,5 @@ require __DIR__ . '/sidebar-creator.php';
|
||||
require __DIR__ . '/sidebar-nav.php';
|
||||
?>
|
||||
<button type="button" class="uc-sidebar__drawer-trigger" id="uc-drawer-trigger" aria-label="<?php esc_attr_e('打开导航', 'aksrt'); ?>">
|
||||
<i class="fas fa-th-large" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-th-large" aria-hidden="true"></i>
|
||||
</button>
|
||||
@@ -47,7 +47,7 @@ foreach ((array) ($oauth_data['available'] ?? []) as $binding) {
|
||||
?>
|
||||
<div class="settings-section">
|
||||
<div class="settings-section__header">
|
||||
<span class="settings-icon"><i class="fas fa-link" aria-hidden="true"></i></span>
|
||||
<span class="settings-icon"><i class="fa fas fa-link" aria-hidden="true"></i></span>
|
||||
<h3 class="widget-title settings-section__title"><?php esc_html_e('社交账号绑定', 'aksrt'); ?></h3>
|
||||
</div>
|
||||
|
||||
@@ -60,7 +60,7 @@ foreach ((array) ($oauth_data['available'] ?? []) as $binding) {
|
||||
<span class="binding-item__icon"><?php echo $binding['icon']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
<span class="binding-item__meta">
|
||||
<span class="binding-status">
|
||||
<i class="fas fa-check-circle badge__icon" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-check-circle badge__icon" aria-hidden="true"></i>
|
||||
<?php esc_html_e('已绑定', 'aksrt'); ?>
|
||||
</span>
|
||||
<span class="binding-item__name"><?php echo esc_html($binding['name']); ?></span>
|
||||
|
||||
@@ -9,13 +9,13 @@ defined('ABSPATH') || exit;
|
||||
?>
|
||||
<div class="settings-section">
|
||||
<div class="settings-section__header">
|
||||
<span class="settings-icon"><i class="fas fa-lock" aria-hidden="true"></i></span>
|
||||
<span class="settings-icon"><i class="fa fas fa-lock" aria-hidden="true"></i></span>
|
||||
<h3 class="widget-title settings-section__title"><?php esc_html_e('安全设置', 'aksrt'); ?></h3>
|
||||
</div>
|
||||
<div class="security-actions">
|
||||
<div class="security-action-item">
|
||||
<div class="security-action-info">
|
||||
<span class="security-action-icon"><i class="fas fa-lock" aria-hidden="true"></i></span>
|
||||
<span class="security-action-icon"><i class="fa fas fa-lock" aria-hidden="true"></i></span>
|
||||
<div class="security-action-text">
|
||||
<span class="security-action-title"><?php esc_html_e('修改密码', 'aksrt'); ?></span>
|
||||
<span class="security-action-desc"><?php esc_html_e('通过邮箱验证码验证后可更改登录密码', 'aksrt'); ?></span>
|
||||
@@ -27,7 +27,7 @@ defined('ABSPATH') || exit;
|
||||
</div>
|
||||
<div class="security-action-item">
|
||||
<div class="security-action-info">
|
||||
<span class="security-action-icon"><i class="far fa-envelope" aria-hidden="true"></i></span>
|
||||
<span class="security-action-icon"><i class="fa fas fa-envelope" aria-hidden="true"></i></span>
|
||||
<div class="security-action-text">
|
||||
<span class="security-action-title"><?php esc_html_e('更改邮箱', 'aksrt'); ?></span>
|
||||
<span class="security-action-desc"><?php esc_html_e('更新用于接收通知和找回密码的邮箱地址', 'aksrt'); ?></span>
|
||||
@@ -38,7 +38,7 @@ defined('ABSPATH') || exit;
|
||||
</button>
|
||||
<div class="security-action-item">
|
||||
<div class="security-action-info">
|
||||
<span class="security-action-icon"><i class="fas fa-mobile-alt" aria-hidden="true"></i></span>
|
||||
<span class="security-action-icon"><i class="fa fas fa-mobile-alt" aria-hidden="true"></i></span>
|
||||
<div class="security-action-text">
|
||||
<span class="security-action-title"><?php esc_html_e('绑定手机', 'aksrt'); ?></span>
|
||||
<span class="security-action-desc"><?php esc_html_e('绑定手机号后可使用短信验证码登录', 'aksrt'); ?></span>
|
||||
|
||||
@@ -20,19 +20,19 @@ $points = (float) ($credit_balance ?? 0);
|
||||
<div class="uc-sidebar__pair uc-sidebar__pair--assets">
|
||||
<?php if ($show_wallet) : ?>
|
||||
<a class="uc-summary-card uc-summary-card--wallet" href="<?php echo esc_url($assets_url); ?>" data-tab="credits">
|
||||
<span class="uc-summary-card__head"><?php esc_html_e('账户余额', 'aksrt'); ?><i class="fas fa-angle-right" aria-hidden="true"></i></span>
|
||||
<span class="uc-summary-card__head"><?php esc_html_e('账户余额', 'aksrt'); ?><i class="fa fas fa-angle-right" aria-hidden="true"></i></span>
|
||||
<span class="uc-summary-card__body">
|
||||
<strong><?php echo esc_html(class_exists('\AKSRT\Credits\Balance') ? \AKSRT\Credits\Balance::format($wallet) : number_format_i18n($wallet, 2)); ?></strong>
|
||||
<i class="fas fa-wallet" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-money-bill" aria-hidden="true"></i>
|
||||
</span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($show_credits) : ?>
|
||||
<a class="uc-summary-card uc-summary-card--points" href="<?php echo esc_url($assets_url); ?>" data-tab="credits">
|
||||
<span class="uc-summary-card__head"><?php echo esc_html((string) ($currency_name ?? __('积分', 'aksrt'))); ?><i class="fas fa-angle-right" aria-hidden="true"></i></span>
|
||||
<span class="uc-summary-card__head"><?php echo esc_html((string) ($currency_name ?? __('积分', 'aksrt'))); ?><i class="fa fas fa-angle-right" aria-hidden="true"></i></span>
|
||||
<span class="uc-summary-card__body">
|
||||
<strong><?php echo esc_html(function_exists('aksrt_format_credits') ? aksrt_format_credits((int) $points) : number_format_i18n((int) $points)); ?></strong>
|
||||
<i class="fas fa-coins" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-money-bill" aria-hidden="true"></i>
|
||||
</span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -17,16 +17,16 @@ if ($creation_url === '' && $revenue_url === '') {
|
||||
<div class="uc-sidebar__pair uc-sidebar__pair--centers">
|
||||
<?php if ($creation_url !== '') : ?>
|
||||
<a class="uc-center-card uc-center-card--creation" href="<?php echo esc_url($creation_url); ?>" data-tab="creator">
|
||||
<span class="uc-center-card__icon"><i class="fas fa-feather-alt" aria-hidden="true"></i></span>
|
||||
<span class="uc-center-card__icon"><i class="fa fas fa-pen" aria-hidden="true"></i></span>
|
||||
<span><strong><?php esc_html_e('创作收益', 'aksrt'); ?></strong><small><?php esc_html_e('作者收益明细', 'aksrt'); ?></small></span>
|
||||
<i class="fas fa-angle-right" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-angle-right" aria-hidden="true"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($revenue_url !== '') : ?>
|
||||
<a class="uc-center-card uc-center-card--revenue" href="<?php echo esc_url($revenue_url); ?>" data-tab="revenue">
|
||||
<span class="uc-center-card__icon"><i class="fas fa-chart-line" aria-hidden="true"></i></span>
|
||||
<span class="uc-center-card__icon"><i class="fa fas fa-chart-line" aria-hidden="true"></i></span>
|
||||
<span><strong><?php esc_html_e('推广收益', 'aksrt'); ?></strong><small><?php esc_html_e('推广佣金明细', 'aksrt'); ?></small></span>
|
||||
<i class="fas fa-angle-right" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-angle-right" aria-hidden="true"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -66,7 +66,7 @@ $render_grid = static function (array $items): void {
|
||||
<?php foreach ($items as $item) : ?>
|
||||
<a class="uc-service-grid__item uc-service-grid__item--<?php echo esc_attr((string) $item['tone']); ?><?php echo !empty($item['tab']) && ($active_tab ?? '') === $item['tab'] ? ' is-active' : ''; ?>" href="<?php echo esc_url((string) $item['url']); ?>"<?php if (!empty($item['tab'])) : ?> data-tab="<?php echo esc_attr((string) $item['tab']); ?>"<?php endif; ?>>
|
||||
<span class="uc-service-grid__icon">
|
||||
<i class="fas fa-<?php echo esc_attr((string) $item['icon']); ?>" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-<?php echo esc_attr((string) $item['icon']); ?>" aria-hidden="true"></i>
|
||||
<?php if (!empty($item['count'])) : ?><small><?php echo esc_html((string) $item['count']); ?></small><?php endif; ?>
|
||||
</span>
|
||||
<span><?php echo esc_html((string) $item['label']); ?></span>
|
||||
|
||||
@@ -49,7 +49,7 @@ $sidebar_level = $vip_level > 0 ? $vip_level : $expired_level;
|
||||
$sidebar_icon_url = esc_url((string) ($vip_levels[$sidebar_level]['img_icon'] ?? ''));
|
||||
$sidebar_icon = $sidebar_icon_url !== ''
|
||||
? '<img' . aksrt_get_lazy_attr('lazy_other', $sidebar_icon_url, 'aksrt-vip-level-icon') . ' alt="" decoding="async">'
|
||||
: '<i class="fas fa-crown" aria-hidden="true"></i>';
|
||||
: '<i class="fa fas fa-certificate" aria-hidden="true"></i>';
|
||||
?>
|
||||
<a class="uc-sidebar-vip" href="<?php echo esc_url($vip_url); ?>" data-tab="vip">
|
||||
<span class="uc-sidebar-vip__icon"><?php echo $sidebar_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
@@ -57,5 +57,5 @@ $sidebar_icon = $sidebar_icon_url !== ''
|
||||
<strong><?php echo esc_html($title); ?></strong>
|
||||
<small><?php echo esc_html($status); ?></small>
|
||||
</span>
|
||||
<i class="fas fa-angle-right uc-sidebar-vip__arrow" aria-hidden="true"></i>
|
||||
<i class="fa fas fa-angle-right uc-sidebar-vip__arrow" aria-hidden="true"></i>
|
||||
</a>
|
||||
@@ -17,7 +17,7 @@ $points_transfer_fee = max(0, min(50, (int) ($transfer_all_settings['points_serv
|
||||
<div class="uc-modal" id="aksrt-transfer-modal" hidden data-aksrt-transfer-modal>
|
||||
<div class="uc-modal__overlay" data-aksrt-transfer-close></div>
|
||||
<div class="uc-modal__dialog" role="dialog" aria-modal="true">
|
||||
<button type="button" class="uc-modal__close" data-aksrt-transfer-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><i class="fas fa-times" aria-hidden="true"></i></button>
|
||||
<button type="button" class="uc-modal__close" data-aksrt-transfer-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><i class="fa fas fa-times" aria-hidden="true"></i></button>
|
||||
<h3 class="uc-modal__title" data-aksrt-transfer-title><?php esc_html_e('余额转账', 'aksrt'); ?></h3>
|
||||
<form data-aksrt-transfer-form>
|
||||
<input type="hidden" name="type" value="balance" data-aksrt-transfer-type>
|
||||
|
||||
@@ -93,7 +93,7 @@ if ($level > 0) {
|
||||
$status_icon_url = esc_url((string) ($levels[$vip_level_number]['img_icon'] ?? ''));
|
||||
$status_icon = $status_icon_url !== ''
|
||||
? '<img' . aksrt_get_lazy_attr('lazy_other', $status_icon_url, 'aksrt-vip-level-icon') . ' alt="" decoding="async">'
|
||||
: '<i class="fas fa-crown"></i>';
|
||||
: '<i class="fa fas fa-certificate"></i>';
|
||||
$status_html = '<div class="uc-vip-status" role="status">'
|
||||
. '<div class="uc-vip-status__heading">'
|
||||
. '<h2 class="uc-vip-status__label">' . esc_html__('我的会员', 'aksrt') . '</h2>'
|
||||
@@ -104,7 +104,7 @@ $status_html = '<div class="uc-vip-status" role="status">'
|
||||
. '<span class="uc-vip-status__level">' . esc_html($vip_level_name) . '</span>'
|
||||
. '</div>'
|
||||
. '<div class="uc-vip-status__desc">' . esc_html($vip_description) . '</div>'
|
||||
. '<div class="uc-vip-status__expiry"><i class="fas fa-clock" aria-hidden="true"></i><span>' . esc_html($vip_expiry_text) . '</span></div>'
|
||||
. '<div class="uc-vip-status__expiry"><i class="fa fas fa-clock" aria-hidden="true"></i><span>' . esc_html($vip_expiry_text) . '</span></div>'
|
||||
. '</div>';
|
||||
|
||||
// Level cards.
|
||||
@@ -125,7 +125,7 @@ foreach ([1, 2] as $lv) {
|
||||
$lv_icon_url = esc_url((string) ($levels[$lv]['img_icon'] ?? ''));
|
||||
$lv_icon = $lv_icon_url !== ''
|
||||
? '<img' . aksrt_get_lazy_attr('lazy_other', $lv_icon_url, 'aksrt-vip-level-icon') . ' alt="" decoding="async">'
|
||||
: '<i class="fas fa-crown" aria-hidden="true"></i>';
|
||||
: '<i class="fa fas fa-certificate" aria-hidden="true"></i>';
|
||||
if (str_starts_with($btn_type, 'renew_')) {
|
||||
$renew_lv = (int) substr($btn_type, 6);
|
||||
if ($lv === $renew_lv) {
|
||||
@@ -159,7 +159,7 @@ foreach ([1, 2] as $lv) {
|
||||
$cards .= $equity;
|
||||
$cards .= '<a class="padding-lg but jb-vip' . $lv . ' radius pay-vip uc-vip-cta" href="javascript:;" vip-level="' . (int) $vip_attr . '">'
|
||||
. '<span>' . esc_html($cta) . '</span>'
|
||||
. ' <i class="fas fa-chevron-circle-right" aria-hidden="true"></i></a>';
|
||||
. ' <i class="fa fas fa-chevron-circle-right" aria-hidden="true"></i></a>';
|
||||
$cards .= '</div></div>';
|
||||
}
|
||||
|
||||
@@ -168,19 +168,19 @@ $points_html = '';
|
||||
$points_pkgs = is_array($points_exchange['packages'] ?? null) ? $points_exchange['packages'] : [];
|
||||
if (!empty($points_exchange['enabled']) && $points_pkgs !== []) {
|
||||
$points_html = '<div class="uc-vip-points-link" data-aksrt-vip-points-modal>'
|
||||
. '<div class="uc-vip-points-link__icon" aria-hidden="true"><i class="fas fa-coins"></i></div>'
|
||||
. '<div class="uc-vip-points-link__icon" aria-hidden="true"><i class="fa fas fa-money-bill"></i></div>'
|
||||
. '<div class="uc-vip-points-link__body">'
|
||||
. '<strong>' . esc_html__('积分兑换会员', 'aksrt') . '</strong>'
|
||||
. '<span>' . sprintf(esc_html__('当前有 %1$s %2$s,可兑换专属会员权益', 'aksrt'), esc_html((string) $user_points), esc_html($currency_name)) . '</span>'
|
||||
. '</div>'
|
||||
. '<button type="button" class="uc-vip-points-link__action" data-aksrt-vip-points-open>'
|
||||
. esc_html__('立即兑换', 'aksrt')
|
||||
. ' <i class="fas fa-chevron-right" aria-hidden="true"></i></button></div>';
|
||||
. ' <i class="fa fas fa-chevron-right" aria-hidden="true"></i></button></div>';
|
||||
}
|
||||
?>
|
||||
<div class="uc-vip-tab" data-aksrt-vip-tab>
|
||||
<div class="uc-vip-summary" data-aksrt-vip-summary data-vip-state="<?php echo esc_attr($vip_state); ?>" data-vip-level="<?php echo (int) $vip_level_number; ?>" data-vip-permanent="<?php echo $vip_is_permanent ? 'true' : 'false'; ?>">
|
||||
<div class="uc-vip-summary__watermark" aria-hidden="true"><i class="fas fa-crown"></i></div>
|
||||
<div class="uc-vip-summary__watermark" aria-hidden="true"><i class="fa fas fa-certificate"></i></div>
|
||||
<?php echo $status_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ if (!$withdraw_channels) {
|
||||
<div class="uc-modal" id="aksrt-withdraw-modal" hidden data-aksrt-withdraw-modal>
|
||||
<div class="uc-modal__overlay" data-aksrt-withdraw-close></div>
|
||||
<div class="uc-modal__dialog" role="dialog" aria-modal="true">
|
||||
<button type="button" class="uc-modal__close" data-aksrt-withdraw-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><i class="fas fa-times" aria-hidden="true"></i></button>
|
||||
<button type="button" class="uc-modal__close" data-aksrt-withdraw-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><i class="fa fas fa-times" aria-hidden="true"></i></button>
|
||||
<h3 class="uc-modal__title"><?php esc_html_e('余额提现', 'aksrt'); ?></h3>
|
||||
<form data-aksrt-withdraw-form>
|
||||
<label class="muted-color em09"><?php esc_html_e('提现金额', 'aksrt'); ?></label>
|
||||
|
||||
Reference in new issue
Block a user