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:
1 parent
bbe010f5b8
commit
50e9e83f68
10 files changed
+157
-153
No files matched your search
@@ -209,19 +209,19 @@ class AKSRT_Admin_Schema_Page_Display {
|
||||
'user-home' => [
|
||||
'key' => 'user-home',
|
||||
'title' => '用户主页',
|
||||
'version' => '1.0.0',
|
||||
'version' => '1.1.0',
|
||||
'option_key' => 'aksrt_settings',
|
||||
'groups' => [
|
||||
['key' => 'layout', 'title' => '主页布局', 'fields' => [
|
||||
['key' => 'user_home_cover', 'label' => '封面区域', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'user_home_sidebar', 'label' => '侧边栏', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'user_home_sidebar', 'label' => '侧边栏(已弃用)', 'type' => 'switch', 'default' => false, 'help' => '公开主页对齐 Zibll 作者页为通栏布局;交易/快捷入口仅在用户中心展示。此开关保留兼容,运行时强制关闭。'],
|
||||
['key' => 'user_home_follow', 'label' => '关注按钮', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'user_home_posts_per_page', 'label' => '每页文章数', 'type' => 'number', 'default' => 10, 'min' => 5, 'max' => 50],
|
||||
['key' => 'user_home_paging_ajax', 'label' => 'AJAX 翻页', 'type' => 'switch', 'default' => true],
|
||||
]],
|
||||
['key' => 'tabs', 'title' => 'Tab 配置', 'fields' => [
|
||||
['key' => 'user_home_tabs', 'label' => '显示的 Tab', 'type' => 'input', 'default' => 'posts,comments,favorites,credits,product,plate,forum,follow'],
|
||||
['key' => 'user_home_tabs_order', 'label' => 'Tab 显示顺序', 'type' => 'input', 'default' => 'posts,comments,favorites,credits,product,plate,forum,follow'],
|
||||
['key' => 'user_home_tabs', 'label' => '显示的 Tab', 'type' => 'input', 'default' => 'posts,favorites,comments,follow', 'help' => '逗号分隔;默认对齐 Zibll:posts,favorites,comments,follow(粉丝)。可选 credits,product,plate,forum'],
|
||||
['key' => 'user_home_tabs_order', 'label' => 'Tab 显示顺序', 'type' => 'input', 'default' => 'posts,favorites,comments,follow'],
|
||||
['key' => 'user_home_tabs_pc_hide', 'label' => 'PC 端隐藏', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'user_home_tabs_mobile_hide', 'label' => '移动端隐藏', 'type' => 'input', 'default' => ''],
|
||||
['key' => 'author_main_tab_swiper', 'label' => '移动端滑动切换', 'type' => 'switch', 'default' => false],
|
||||
@@ -230,9 +230,9 @@ class AKSRT_Admin_Schema_Page_Display {
|
||||
['key' => 'user_home_avatar', 'label' => '显示头像', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'user_home_name', 'label' => '显示用户名', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'user_home_desc', 'label' => '显示个人简介', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'user_home_stats', 'label' => '显示统计数据', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'user_home_stats', 'label' => '显示统计数据(已弃用)', 'type' => 'switch', 'default' => false, 'help' => '计数已并入 Tab 角标(对齐 Zibll),头图内不再重复展示文章/评论/收藏。'],
|
||||
['key' => 'user_home_social', 'label' => '显示社交链接', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'user_home_message', 'label' => '私信按钮', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'user_home_message', 'label' => '私信/消息按钮', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'user_home_private', 'label' => '留言按钮', 'type' => 'switch', 'default' => true],
|
||||
]],
|
||||
],
|
||||
|
||||
@@ -72,7 +72,7 @@ class AKSRT_User_Home {
|
||||
'priority' => 70,
|
||||
],
|
||||
'follow' => [
|
||||
'label' => __('关注', 'aksrt'),
|
||||
'label' => __('粉丝', 'aksrt'),
|
||||
'icon' => 'user-plus',
|
||||
'priority' => 80,
|
||||
],
|
||||
|
||||
@@ -31,9 +31,10 @@ class AKSRT_Settings_User_Runtime {
|
||||
return $clean;
|
||||
};
|
||||
|
||||
$normalized_tabs = $parse_csv('user_home_tabs', 'posts,comments,favorites');
|
||||
// Zibll author_main_tab_opt defaults: post, favorite, comment, plate, forum, follow.
|
||||
$normalized_tabs = $parse_csv('user_home_tabs', 'posts,favorites,comments,follow');
|
||||
if (empty($normalized_tabs)) {
|
||||
$normalized_tabs = ['posts', 'comments', 'favorites'];
|
||||
$normalized_tabs = ['posts', 'favorites', 'comments', 'follow'];
|
||||
}
|
||||
|
||||
$raw_order = $parse_csv('user_home_tabs_order', '');
|
||||
@@ -57,14 +58,16 @@ class AKSRT_Settings_User_Runtime {
|
||||
'tabs_order' => $ordered,
|
||||
'tabs_pc_hide' => $pc_hide,
|
||||
'tabs_mobile_hide' => $mobile_hide,
|
||||
'sidebar' => !isset($settings['user_home_sidebar']) || !empty($settings['user_home_sidebar']),
|
||||
// Public author page is full-width (Zibll author.php). Sidebar option kept as no-op reserved key.
|
||||
'sidebar' => false,
|
||||
'cover' => !isset($settings['user_home_cover']) || !empty($settings['user_home_cover']),
|
||||
'follow' => !isset($settings['user_home_follow']) || !empty($settings['user_home_follow']),
|
||||
'posts_per_page' => max(5, min(50, (int) ($settings['user_home_posts_per_page'] ?? 10))),
|
||||
'avatar' => !isset($settings['user_home_avatar']) || !empty($settings['user_home_avatar']),
|
||||
'name' => !isset($settings['user_home_name']) || !empty($settings['user_home_name']),
|
||||
'desc' => !isset($settings['user_home_desc']) || !empty($settings['user_home_desc']),
|
||||
'stats' => !isset($settings['user_home_stats']) || !empty($settings['user_home_stats']),
|
||||
// Body stats row removed; counts live in tabs like Zibll.
|
||||
'stats' => false,
|
||||
'social' => !isset($settings['user_home_social']) || !empty($settings['user_home_social']),
|
||||
'tab_swiper' => !empty($settings['author_main_tab_swiper']),
|
||||
'message' => !isset($settings['user_home_message']) || !empty($settings['user_home_message']),
|
||||
|
||||
Reference in new issue
Block a user