Merge pull request 'fix(identity): align vip icons and sidebar cards' (#425) from worktree-vip-default-icons-and-speed-removal into main

Reviewed-on: CYL/wordpress-theme-aksrt#425
This commit is contained in:
2026-08-11 18:54:55 +08:00
6 changed files with 51 additions and 43 deletions
+7
View File
@@ -210,6 +210,13 @@ main.container,
gap: 4px;
}
.aksrt-author-hero__name-inner {
display: inline-flex;
align-items: center;
gap: 4px;
min-width: 0;
}
/* ========== 通用空状态 ========== */
.no-results {
padding: 48px 20px;
+26
View File
@@ -633,6 +633,32 @@ body.aksrt-user-center .uc-content,
gap: 8px;
}
.uc-sidebar__section--stats,
.uc-sidebar__pair--assets .uc-summary-card,
.uc-sidebar__pair--centers .uc-center-card {
text-align: center;
}
.uc-sidebar__pair--assets .uc-summary-card__head,
.uc-sidebar__pair--assets .uc-summary-card__body {
justify-content: center;
}
.uc-sidebar__pair--centers .uc-center-card {
grid-template-columns: 1fr;
justify-items: center;
gap: 7px;
}
.uc-sidebar__pair--centers .uc-center-card > span {
text-align: center;
}
.uc-sidebar__pair--centers .uc-center-card > i {
display: none;
}
.uc-summary-card,
.uc-center-card {
min-width: 0;
+8 -3
View File
@@ -54,6 +54,11 @@ if (!function_exists('aksrt_render_user_identity_chips')) {
}
}
$signals = aksrt_get_user_identity_signals($user_id);
// Keep the public identity order stable: certification, worn badge, level.
usort($signals, static function (array $left, array $right): int {
$priority = ['verify' => 0, 'badge' => 1, 'level' => 2];
return ($priority[(string) ($left['type'] ?? '')] ?? 3) <=> ($priority[(string) ($right['type'] ?? '')] ?? 3);
});
// Comments stay compact; author/card can show more.
$limit = $context === 'comment' ? 3 : 6;
$n = 0;
@@ -116,7 +121,7 @@ if (!function_exists('aksrt_get_user_name')) {
'id' => 0,
'class' => 'flex ac flex1',
'name_class' => '',
'vip' => false,
'vip' => true,
'medal' => true,
'auth' => true,
'level' => true,
@@ -148,7 +153,7 @@ if (!function_exists('aksrt_get_user_name')) {
$vip_html = (string) aksrt_render_vip_badge($user_id, 'sm');
}
$name_class = trim('display-name text-ellipsis ' . (string) $args['name_class']);
$name_link = '<a class="' . esc_attr($name_class) . '" href="' . esc_url($home) . '">' . $vip_html . esc_html($display) . '</a>';
$name_link = '<a class="' . esc_attr($name_class) . '" href="' . esc_url($home) . '">' . esc_html($display) . '</a>';
$auth_html = '';
$medal_html = '';
@@ -217,7 +222,7 @@ if (!function_exists('aksrt_get_user_name')) {
}
// Order: name → auth → wear medal → level → follow (Zibll).
$html = '<name class="' . esc_attr((string) $args['class']) . '">' . $name_link . $auth_html . $medal_html . $level_html . $follow_html . '</name>';
$html = '<name class="' . esc_attr((string) $args['class']) . '">' . $name_link . $vip_html . $auth_html . $medal_html . $level_html . $follow_html . '</name>';
/**
* Filter rendered user name chrome.
*
+1 -1
View File
@@ -238,7 +238,7 @@ if (!function_exists('aksrt_header_user_box_html')) :
$con .= $avatar;
$con .= '<div class="user-right flex flex1 ac jsb ml10">';
$con .= '<div class="flex1" style="max-width: calc(100% - 40px);"><b>'
. '<span class="display-name text-ellipsis">' . esc_html($display_name) . '</span>' . $vip_badge . $level_badge . $certification_badge
. '<span class="display-name text-ellipsis">' . esc_html($display_name) . '</span>' . $vip_badge . $certification_badge . $level_badge
. '</b><div class="px12 muted-2-color text-ellipsis">' . esc_html($desc) . '</div></div>';
$con .= '</div>';
$con .= $msg_icon;
@@ -36,32 +36,10 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
<div class="uc-header__info">
<h1 class="uc-header__name">
<?php echo esc_html($target_user->display_name); ?>
<?php
$vip_badge = function_exists('aksrt_render_vip_badge') ? aksrt_render_vip_badge($user_id) : '';
if ($vip_badge) {
echo $vip_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
// Worn medal icon inline to the right of the name (zibll parity).
if (function_exists('aksrt_get_worn_medal_icon')) {
echo aksrt_get_worn_medal_icon((int) $user_id); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
// Level icon inline to the right of the name (zibll parity).
if (class_exists('\AKSRT\User\Level') && method_exists('\AKSRT\User\Level', 'get_badge_html')) {
echo \AKSRT\User\Level::get_badge_html((int) $user_id); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
?>
<?php
foreach ($profile_signals as $signal) {
if ((string) ($signal['type'] ?? '') !== 'verify') {
continue;
}
$icon_url = esc_url((string) ($signal['icon_url'] ?? ''));
if ($icon_url !== '') {
echo '<img class="aksrt-identity-certification-icon img-icon ml3" src="' . $icon_url . '" alt="" title="' . esc_attr((string) ($signal['title'] ?? $signal['label'] ?? '')) . '" loading="lazy" decoding="async" />';
}
}
?>
</h1>
<?php if (function_exists('aksrt_render_user_identity_chips')) : ?>
<?php echo aksrt_render_user_identity_chips((int) $user_id, 'author', ['include_vip' => true]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php endif; ?>
</h1>
<div class="uc-header__meta desc user-identity flex ac hh">
<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); ?>
+5 -13
View File
@@ -92,19 +92,11 @@ $pm_url = ($pm_enabled && $messages_url !== '')
<div class="aksrt-author-hero__info">
<?php if ($show_name) : ?>
<h1 class="aksrt-author-hero__name">
<?php echo esc_html($user->display_name); ?>
<?php
$vip_badge = function_exists('aksrt_render_vip_badge') ? aksrt_render_vip_badge($user_id) : '';
if ($vip_badge) {
echo $vip_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
if (function_exists('aksrt_render_user_identity_chips')) {
echo aksrt_render_user_identity_chips($user_id, 'author', [
'include_vip' => false,
'skip_level' => false,
]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
?>
<?php if (function_exists('aksrt_get_user_name')) : ?>
<?php echo aksrt_get_user_name(['id' => $user_id, 'class' => 'aksrt-author-hero__name-inner', 'vip' => true, 'medal' => true, 'auth' => true, 'level' => true, 'follow' => false]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php else : ?>
<?php echo esc_html($user->display_name); ?>
<?php endif; ?>
</h1>
<?php endif; ?>