Files
wordpress-theme-aksrt/inc/helpers/user-center-renderers/profile-header.php
T
kate522 9375b1c30c refactor(assets): vendor 资产迁入标准目录并全仓去除 zibll 标识
- assets/vendor 全量迁移: fontawesome5→assets/fontawesome5, css→assets/css,
  js→assets/js/runtime(避开 14 个同名自有文件), img 合并去重→assets/img,
  fonts→assets/fonts; 删除 assets/vendor
- libs 五个与 widgets/third-party 字节相同的库不重复入库, loader paths 改指向
- 运行时切换: _win.uri=assets 根, loader baseUrl=/js/runtime, enlighter 注入
  路径同步; PHP 7 个引用文件切换并改名 $zibll_*→$runtime_*
- 去品牌: Qinver 头注释/品牌 console.log/演示链接清除, 默认文案中性化
- 功能标识符改名: zib__→aksrt__, zib_ajax→aksrt_ajax, window.zib→
  window.aksrtLegacy, zibllblock/*→aksrtblock/*, .zib-widget→.aksrt-panel,
  .zib-slider→.aksrt-slider, zib_menu_options meta 键等
- 自有 CSS 改名: legacy-utilities/compat-vars/footer shell
- admin SPA 重建; 契约测试同步(路径/断言/文件更名)
- 例外保留: tests/visual 对照环境与 fixtures 前缀(外部 Zibll 产品引用)

验证: php -l 133 个改动文件通过; runtime 86 个 JS node --check 通过;
契约测试 68/70(2 个失败经 stash 对照确认为存量问题)
2026-08-22 16:16:30 +08:00

98 lines
5.0 KiB
PHP

<?php
/**
* User center profile header part.
*
* @package AKSRT
*/
defined('ABSPATH') || exit;
$context = is_array($args['context'] ?? null) ? $args['context'] : [];
extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_extract
?>
<div class="uc-header">
<div class="uc-header__cover">
<img id="aksrt-cover-img" class="uc-header__cover-img" src="<?php echo esc_url($user_background_url ? $user_background_url : get_theme_file_uri('assets/img/person_background.png')); ?>" alt="">
<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="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="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="fa fas fa-image" aria-hidden="true"></i><span><?php esc_html_e('修改背景图', 'aksrt'); ?></span></button>
<?php endif; ?>
</div>
</div>
<?php if ($allow_bg_upload) : ?><input type="file" id="aksrt-bg-file-input" accept="image/jpeg,image/png,image/webp,image/gif" hidden><?php endif; ?>
</div>
<div class="uc-header__content">
<div class="uc-header__avatar">
<?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="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>
<?php endif; ?>
</div>
<div class="uc-header__info">
<h1 class="uc-header__name">
<?php echo esc_html($target_user->display_name); ?>
<?php if (function_exists('aksrt_render_user_identity_chips')) : ?>
<?php echo aksrt_render_user_identity_chips((int) $user_id, 'author', ['include_vip' => true, 'skip_badges' => true]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php endif; ?>
</h1>
<div class="uc-header__meta desc user-identity flex ac hh">
<?php if (function_exists('aksrt_render_user_medal_entry')) : ?>
<?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="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="fa fas fa-envelope" aria-hidden="true"></i> <?php echo esc_html($target_user->user_email); ?>
</span>
<?php endif; ?>
<?php
// IP 归属地 (legacy user_page_header_desc + user_city_s).
$uc_city = function_exists('aksrt_get_user_city_badge_html')
? aksrt_get_user_city_badge_html((int) $user_id, 'user_center', 'badg')
: '';
if ($uc_city !== '') {
echo $uc_city; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
?>
</div>
</div>
<div class="uc-header__actions">
<?php if (!empty($signin_enabled)) : ?>
<span data-aksrt-signin>
<button
type="button"
class="btn btn-sm uc-header__signin-btn<?php echo !empty($signin_signed_today) ? ' is-done' : ''; ?>"
data-signin-btn
data-signin-idle-label="<?php esc_attr_e('签到', 'aksrt'); ?>"
data-signin-done-label="<?php esc_attr_e('已签到', 'aksrt'); ?>"
<?php disabled(!empty($signin_signed_today)); ?>
>
<i class="fa fas fa-calendar-check" aria-hidden="true"></i>
<span data-signin-label><?php echo !empty($signin_signed_today) ? esc_html__('已签到', 'aksrt') : esc_html__('签到', 'aksrt'); ?></span>
</button>
</span>
<?php endif; ?>
<?php if (!empty($messages_url)) : ?>
<a href="<?php echo esc_url($messages_url); ?>" class="btn-ghost btn-sm btn-icon uc-header__message-btn" aria-label="<?php esc_attr_e('消息通知', 'aksrt'); ?>" title="<?php esc_attr_e('消息通知', 'aksrt'); ?>">
<i class="fa fas fa-bell" aria-hidden="true"></i>
<?php if ($notification_unread_count > 0) : ?>
<span class="uc-header__action-badge"><?php echo esc_html((string) $notification_unread_count); ?></span>
<?php endif; ?>
</a>
<?php endif; ?>
</div>
</div>
</div>