fix(user-home): 1:1 align public profile with Zibll author page

- Remove 主页概览/快捷入口/交易服务 private-dashboard sidebar from public home
- Full-width layout; counts live in tab bar (粉丝 = followers)
- Hero: 用户中心/消息 for self, 关注/私信 for others; drop body stats row
- Defaults: no sidebar, posts/favorites/comments/follow tabs
This commit is contained in:
2026-07-15 16:18:17 +08:00
parent bbe010f5b8
commit 50e9e83f68
10 changed files with 157 additions and 153 deletions
+2 -2
View File
@@ -125,8 +125,8 @@ extract($args, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_ext
<div class="user-home-balance-card">
<p class="user-home-balance-card__label"><?php echo esc_html(sprintf(__('当前%s余额', 'aksrt'), $currency_name)); ?></p>
<div class="user-home-balance-card__value"><?php echo esc_html(aksrt_format_credits($credit_balance)); ?></div>
<p class="user-home-balance-card__hint"><?php esc_html_e('完整账单和赚取/消费记录请在个人中心查看。', 'aksrt'); ?></p>
<a href="<?php echo esc_url(aksrt_get_user_center_url('credits')); ?>" class="btn-outline btn-sm"><?php esc_html_e('进入个人中心', 'aksrt'); ?></a>
<p class="user-home-balance-card__hint"><?php esc_html_e('完整账单和赚取/消费记录请在用户中心查看。', 'aksrt'); ?></p>
<a href="<?php echo esc_url(aksrt_get_user_center_url('credits')); ?>" class="btn-outline btn-sm"><?php esc_html_e('进入用户中心', 'aksrt'); ?></a>
</div>
</div>
<?php endif; ?>
+4 -80
View File
@@ -2,87 +2,11 @@
/**
* Public user home — page-owned sidebar.
*
* Zibll public author page has no private-dashboard sidebar
* (主页概览 / 快捷入口 / 交易服务). Those belong on 用户中心 only.
* This part is intentionally a no-op for 1:1 author parity.
*
* @package AKSRT
*/
defined('ABSPATH') || exit;
$args = is_array($args ?? null) ? $args : [];
extract($args, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_extract
?>
<?php if (!empty($user_home_settings['sidebar'])) : ?>
<aside class="content-layout__aside sidebar uc-sidebar aksrt-user-home__aside" role="complementary" aria-label="<?php esc_attr_e('用户主页侧栏', 'aksrt'); ?>">
<div class="uc-sidebar__section">
<div class="uc-sidebar__title"><?php esc_html_e('主页概览', 'aksrt'); ?></div>
<div class="uc-stats">
<?php foreach ($enabled_tabs as $tab_key) : ?>
<a class="uc-stats__item" href="<?php echo esc_url(add_query_arg('tab', $tab_key, $home_url)); ?>">
<span class="uc-stats__value"><?php echo esc_html((string) ($tab_counts[$tab_key] ?? 0)); ?></span>
<span class="uc-stats__label"><?php echo esc_html($tab_labels[$tab_key] ?? ucfirst($tab_key)); ?></span>
</a>
<?php endforeach; ?>
</div>
</div>
<?php if (!empty($user_contacts) && !empty($user_center_settings['social_links'])) : ?>
<div class="uc-sidebar__section">
<div class="uc-sidebar__title"><?php esc_html_e('公开联系', 'aksrt'); ?></div>
<div class="aksrt-user-home__contacts">
<?php if (function_exists('aksrt_render_social_links')) : ?>
<?php aksrt_render_social_links($user_contacts); ?>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<div class="uc-sidebar__section">
<div class="uc-sidebar__title"><?php esc_html_e('快捷入口', 'aksrt'); ?></div>
<div class="uc-sidebar__buttons">
<a href="<?php echo esc_url($home_url); ?>" class="uc-sidebar__btn">
<i class="fas fa-user" aria-hidden="true"></i>
<span><?php esc_html_e('主页首页', 'aksrt'); ?></span>
</a>
<?php if ($is_own_profile) : ?>
<a href="<?php echo esc_url(aksrt_get_user_center_url()); ?>" class="uc-sidebar__btn">
<i class="fas fa-cog" aria-hidden="true"></i>
<span><?php esc_html_e('个人中心', 'aksrt'); ?></span>
</a>
<?php endif; ?>
</div>
</div>
<?php if ($is_own_profile) : ?>
<?php
$orders_url = function_exists('aksrt_get_orders_page_url') ? aksrt_get_orders_page_url() : '';
$show_vip = class_exists('AKSRT_Settings') && !empty(AKSRT_Settings::get_payment_vip_settings()['enabled']);
$credits_enabled_side = class_exists('AKSRT_Settings') && AKSRT_Settings::credits_enabled();
?>
<?php if ($orders_url || $show_vip || $credits_enabled_side) : ?>
<div class="uc-sidebar__section">
<div class="uc-sidebar__title"><?php esc_html_e('交易服务', 'aksrt'); ?></div>
<div class="uc-sidebar__buttons">
<?php if ($orders_url) : ?>
<a href="<?php echo esc_url($orders_url); ?>" class="uc-sidebar__btn">
<i class="fas fa-receipt" aria-hidden="true"></i>
<span><?php esc_html_e('我的订单', 'aksrt'); ?></span>
</a>
<?php endif; ?>
<?php if ($show_vip) : ?>
<a href="<?php echo esc_url(function_exists('aksrt_get_user_center_tab_url') ? aksrt_get_user_center_tab_url('credits') : aksrt_get_user_center_url('credits')); ?>" class="uc-sidebar__btn">
<i class="fas fa-crown" aria-hidden="true"></i>
<span><?php esc_html_e('VIP 会员', 'aksrt'); ?></span>
</a>
<?php endif; ?>
<?php if ($credits_enabled_side) : ?>
<a href="<?php echo esc_url(function_exists('aksrt_get_user_center_tab_url') ? aksrt_get_user_center_tab_url('credits') : aksrt_get_user_center_url('credits')); ?>" class="uc-sidebar__btn">
<i class="fas fa-coins" aria-hidden="true"></i>
<span><?php echo esc_html(AKSRT_Settings::get_currency_name()); ?></span>
</a>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<?php endif; ?>
</aside>
<?php endif; ?>