fix: 导航用户弹层认证图标同行
This commit is contained in:
@@ -91,8 +91,9 @@ if (!function_exists('aksrt_header_user_badges_row')) :
|
||||
if ($user_id <= 0 || !function_exists('aksrt_render_user_identity_chips')) {
|
||||
return '';
|
||||
}
|
||||
// VIP + level already shown next to display name in the header profile row.
|
||||
// Certification is displayed beside the name and level icon in the profile row.
|
||||
$chips = aksrt_render_user_identity_chips($user_id, 'card', ['include_vip' => false, 'skip_level' => true]);
|
||||
$chips = preg_replace('/<img class="aksrt-identity-certification-icon[^>]*>/', '', $chips);
|
||||
if ($chips === '') {
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -151,10 +151,24 @@ if (!function_exists('aksrt_header_user_box_html')) :
|
||||
$avatar = get_avatar($user_id, 44, '', esc_attr($display_name), ['loading' => 'lazy']);
|
||||
$desc = (string) ($ctx['user_desc'] ?? '');
|
||||
$vip_badge = function_exists('aksrt_render_vip_badge') ? aksrt_render_vip_badge($user_id, 'sm') : '';
|
||||
// Level icon rides inline to the right of the display name (zibll parity).
|
||||
// Level and certification icons ride inline to the right of the display name.
|
||||
$level_badge = (class_exists('\AKSRT\User\Level') && method_exists('\AKSRT\User\Level', 'get_badge_html'))
|
||||
? \AKSRT\User\Level::get_badge_html($user_id, 'aksrt-user-level-icon--header')
|
||||
: '';
|
||||
$certification_badge = '';
|
||||
if (function_exists('aksrt_get_user_identity_signals')) {
|
||||
foreach (aksrt_get_user_identity_signals($user_id) as $signal) {
|
||||
if ((string) ($signal['type'] ?? '') !== 'verify') {
|
||||
continue;
|
||||
}
|
||||
$icon_url = esc_url((string) ($signal['icon_url'] ?? ''));
|
||||
$title = (string) ($signal['title'] ?? $signal['label'] ?? '');
|
||||
if ($icon_url !== '' && $title !== '') {
|
||||
$certification_badge = '<img class="aksrt-identity-certification-icon img-icon ml3" src="' . $icon_url . '" alt="" title="' . esc_attr($title) . '" loading="lazy" decoding="async" />';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
$payvip = function_exists('aksrt_header_payvip_bar') ? aksrt_header_payvip_bar($user_id) : '';
|
||||
// nav_user_pay_vip gate: empty payvip when switch off for non-VIP CTA only — helper already handles VIP status.
|
||||
if (empty($ctx['nav_user_pay_vip']) && $payvip !== '' && strpos($payvip, 'is-vip') === false) {
|
||||
@@ -243,7 +257,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
|
||||
. '<span class="display-name text-ellipsis">' . esc_html($display_name) . '</span>' . $vip_badge . $level_badge . $certification_badge
|
||||
. '</b><div class="px12 muted-2-color text-ellipsis">' . esc_html($desc) . '</div></div>';
|
||||
$con .= '</div>';
|
||||
$con .= $msg_icon;
|
||||
|
||||
Reference in New Issue
Block a user