From 9f08c9337afbdc88bf5a7f8776c11620b3bfe7e2 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Jul 2026 21:56:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=B8=BB=E9=A1=B5=E5=87=8F?= =?UTF-8?q?=E5=B1=82=EF=BC=9A=E6=8B=86=E5=87=BA=20panel/sidebar=20partial?= =?UTF-8?q?=20=E5=B9=B6=E6=B8=85=E7=90=86=E5=A4=B1=E6=95=88=20CSS=20?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 把 page-user-home 的内容面板与侧栏抽到 user-home partial,删除公开主页已不再使用的 uc-header/user-home-stats 等 CSS 残段。 --- assets/css/routes/profile/layout.css | 21 - assets/css/routes/user-home.css | 55 --- templates/pages/page-user-home.php | 454 +++------------------ templates/parts/user-home/README.md | 2 + templates/parts/user-home/panel-follow.php | 39 ++ templates/parts/user-home/panel-forum.php | 169 ++++++++ templates/parts/user-home/panels-core.php | 147 +++++++ templates/parts/user-home/sidebar.php | 88 ++++ 8 files changed, 493 insertions(+), 482 deletions(-) create mode 100644 templates/parts/user-home/panel-follow.php create mode 100644 templates/parts/user-home/panel-forum.php create mode 100644 templates/parts/user-home/panels-core.php create mode 100644 templates/parts/user-home/sidebar.php diff --git a/assets/css/routes/profile/layout.css b/assets/css/routes/profile/layout.css index 2e42f6c0..0d6bcc45 100644 --- a/assets/css/routes/profile/layout.css +++ b/assets/css/routes/profile/layout.css @@ -221,27 +221,6 @@ background: var(--surface-2); } -.aksrt-user-home__notice { - display: flex; - align-items: center; - gap: 8px; - margin: 0 0 18px; - padding: 12px 14px; - border-radius: 10px; - font-size: 13px; - font-weight: 500; -} - -.aksrt-user-home__notice--muted, -.aksrt-user-home__notice--restricted { - color: #92400e; - background: rgba(245, 158, 11, 0.12); -} - -.aksrt-user-home__notice--banned { - color: #b91c1c; - background: rgba(239, 68, 68, 0.12); -} .uc-header__meta { display: flex; diff --git a/assets/css/routes/user-home.css b/assets/css/routes/user-home.css index 963798b5..a7b9e675 100644 --- a/assets/css/routes/user-home.css +++ b/assets/css/routes/user-home.css @@ -420,58 +420,6 @@ gap: 18px; } -.aksrt-user-home .uc-header--no-cover { - background: var(--surface-1); - border-radius: var(--radius-lg, 12px); - border: 1px solid var(--color-line-soft, rgba(0, 0, 0, 0.06)); -} - -.aksrt-user-home .uc-header--no-cover .uc-header__content { - padding-top: 24px; -} - -.aksrt-user-home .user-home-stats { - display: flex; - flex-wrap: wrap; - gap: 10px; - margin-top: 14px; -} - -.aksrt-user-home .user-home-stats__item { - display: inline-flex; - align-items: center; - gap: 6px; - min-height: 34px; - padding: 0 12px; - border-radius: 999px; - background: var(--surface-2); - color: var(--color-ink-3); - font-size: 13px; - font-weight: 500; -} - -.aksrt-user-home .user-home-stats__item strong { - color: var(--color-ink); - font-size: 14px; -} - -.aksrt-user-home .uc-header__actions { - display: flex; - flex-wrap: wrap; - justify-content: flex-end; - gap: 10px; -} - -.aksrt-user-home .aksrt-user-home__follow-btn { - display: inline-flex; - align-items: center; - gap: 8px; -} - -.aksrt-user-home .aksrt-user-home__follow-btn[aria-disabled="true"] { - opacity: 0.72; - cursor: not-allowed; -} .aksrt-user-home .aksrt-user-home__contacts .profile-social-links { display: flex; @@ -611,9 +559,6 @@ /* ==================== 响应式 ==================== */ @media (max-width: 640px) { - .aksrt-user-home .user-home-stats { - gap: 8px; - } .aksrt-user-home .dashboard--public { padding: 16px; diff --git a/templates/pages/page-user-home.php b/templates/pages/page-user-home.php index f7737610..bbf0a535 100644 --- a/templates/pages/page-user-home.php +++ b/templates/pages/page-user-home.php @@ -129,6 +129,7 @@ $svg_empty_favorite = '
@@ -142,418 +143,59 @@ $home_url = function_exists('aksrt_get_user_home_url') ? aksrt_get_user_home_url ]); ?> -
-
- - - -
- - -
> - $user_id, - 'posts_per_page' => $per_page, - 'post_status' => 'publish', - 'paged' => $posts_page, - 'no_found_rows' => false, - 'update_post_meta_cache' => false, - ]); - if ($author_posts->have_posts()) : - ?> -
- have_posts()) : $author_posts->the_post(); ?> - [ - 'type' => 'view', - 'url' => get_permalink(), - 'label' => __('阅读', 'aksrt'), - ], - ]); - ?> - -
- max_num_pages, $posts_page, 'posts_page'); - wp_reset_postdata(); - else : - aksrt_render_profile_empty($svg_empty_post, __('TA 还没有发布文章', 'aksrt')); - endif; - ?> -
- - - -
> - $user_id, - 'status' => 'approve', - 'number' => $per_page, - 'offset' => ($comments_page - 1) * $per_page, - 'type' => 'comment', - 'update_comment_meta_cache' => false, - ]); - if ($user_comments) : - ?> -
- - $c]); - ?> - -
- -
- - - -
> - - 'post', - 'post_status' => 'publish', - 'post__in' => $favorite_post_ids, - 'orderby' => 'post__in', - 'posts_per_page' => $per_page, - 'paged' => $favorites_page, - 'ignore_sticky_posts' => true, - 'no_found_rows' => false, - 'update_post_meta_cache' => false, - ]); - if ($favorites_query->have_posts()) : +
+
+ -
- have_posts()) : $favorites_query->the_post(); ?> - [ - 'type' => 'view', - 'url' => get_permalink(), - 'label' => __('阅读', 'aksrt'), - ], - ]); - ?> - -
- max_num_pages, $favorites_page, 'favorites_page'); - wp_reset_postdata(); - else : - aksrt_render_profile_empty($svg_empty_favorite, __('TA 还没有收藏文章', 'aksrt')); - endif; - ?> - - - -
- - - -
> -
-

-
-

- -
-
- - - __('暂无商品内容', 'aksrt'), - 'plate' => __('暂无圈子内容', 'aksrt'), - ]; - foreach ($_uh_extended_tabs as $_uh_ext) : - if (!in_array($_uh_ext, $enabled_tabs, true)) continue; - ?> -
> - -
- - - -
> -
-
-

-

-
- -
- - - - get_user_forum_topics($user_id, ['page' => $forum_page, 'limit' => $per_page]); - if (!empty($forum_topics['items'])) : ?> -
- -
-
- - - -
- - - -
-
-
- -
- 1) : ?> -
- add_query_arg('forum_page', '%#%', $home_url), - 'format' => '', - 'current' => $forum_page, - 'total' => $forum_topics['max_pages'], - 'add_args' => ['tab' => 'forum', 'forum_sub' => 'topics'], - ]); - ?> -
- - - - - - get_user_favorite_topics($user_id, $forum_page, $per_page); - if (!empty($fav_topics['items'])) : ?> -
- -
-
- - - -
- - - -
-
-
- -
- 1) : ?> -
- add_query_arg('forum_page', '%#%', $home_url), - 'format' => '', - 'current' => $forum_page, - 'total' => $fav_topics['max_pages'], - 'add_args' => ['tab' => 'forum', 'forum_sub' => 'favorites'], - ]); - ?> -
- - - - - - get_user_managed_plates($user_id); - $followed_plates = $forum_instance->get_user_followed_plates($user_id); - $has_plates = !empty($managed_plates['owned']) || !empty($managed_plates['moderating']) || !empty($followed_plates); - if ($has_plates) : ?> - -

- - - -

-
- - -
-
- -
-
- -
- - -

- - - - - - -
- - - -
> - get_user_followed_plates($user_id); - if (!empty($followed)) : ?> - - - - -
- -
-
- - -
-
-
- -
- - - - -
-
-
- - - - - - - - - - - - - - - - - - -
-
- - - - +
diff --git a/templates/parts/user-home/README.md b/templates/parts/user-home/README.md index 82c835c6..9895e621 100644 --- a/templates/parts/user-home/README.md +++ b/templates/parts/user-home/README.md @@ -3,6 +3,8 @@ 当前主路径: - 壳层:templates/pages/page-user-home.php - 头区:templates/parts/user/author-hero.php +- 内容面板:panels-core.php / panel-forum.php / panel-follow.php +- 侧栏:sidebar.php - 列表项:templates/parts/content-profile-*.php 旧 uh-* 草稿 partial 已删除,勿再引入。 diff --git a/templates/parts/user-home/panel-follow.php b/templates/parts/user-home/panel-follow.php new file mode 100644 index 00000000..cc1abf8a --- /dev/null +++ b/templates/parts/user-home/panel-follow.php @@ -0,0 +1,39 @@ + + +
> + get_user_followed_plates($user_id); + if (!empty($followed)) : ?> + + + + +
+ diff --git a/templates/parts/user-home/panel-forum.php b/templates/parts/user-home/panel-forum.php new file mode 100644 index 00000000..8198b159 --- /dev/null +++ b/templates/parts/user-home/panel-forum.php @@ -0,0 +1,169 @@ + + +
> +
+
+

+

+
+ +
+ + + + get_user_forum_topics($user_id, ['page' => $forum_page, 'limit' => $per_page]); + if (!empty($forum_topics['items'])) : ?> +
+ +
+
+ + + +
+ + + +
+
+
+ +
+ 1) : ?> +
+ add_query_arg('forum_page', '%#%', $home_url), + 'format' => '', + 'current' => $forum_page, + 'total' => $forum_topics['max_pages'], + 'add_args' => ['tab' => 'forum', 'forum_sub' => 'topics'], + ]); + ?> +
+ + + + + + get_user_favorite_topics($user_id, $forum_page, $per_page); + if (!empty($fav_topics['items'])) : ?> +
+ +
+
+ + + +
+ + + +
+
+
+ +
+ 1) : ?> +
+ add_query_arg('forum_page', '%#%', $home_url), + 'format' => '', + 'current' => $forum_page, + 'total' => $fav_topics['max_pages'], + 'add_args' => ['tab' => 'forum', 'forum_sub' => 'favorites'], + ]); + ?> +
+ + + + + + get_user_managed_plates($user_id); + $followed_plates = $forum_instance->get_user_followed_plates($user_id); + $has_plates = !empty($managed_plates['owned']) || !empty($managed_plates['moderating']) || !empty($followed_plates); + if ($has_plates) : ?> + +

+ + + +

+
+ + +
+
+ +
+
+ +
+ + +

+ + + + + + +
+ diff --git a/templates/parts/user-home/panels-core.php b/templates/parts/user-home/panels-core.php new file mode 100644 index 00000000..5db7931f --- /dev/null +++ b/templates/parts/user-home/panels-core.php @@ -0,0 +1,147 @@ + + +
> + $user_id, + 'posts_per_page' => $per_page, + 'post_status' => 'publish', + 'paged' => $posts_page, + 'no_found_rows' => false, + 'update_post_meta_cache' => false, + ]); + if ($author_posts->have_posts()) : + ?> +
+ have_posts()) : $author_posts->the_post(); ?> + [ + 'type' => 'view', + 'url' => get_permalink(), + 'label' => __('阅读', 'aksrt'), + ], + ]); + ?> + +
+ max_num_pages, $posts_page, 'posts_page'); + wp_reset_postdata(); + else : + aksrt_render_profile_empty($svg_empty_post, __('TA 还没有发布文章', 'aksrt')); + endif; + ?> +
+ + + +
> + $user_id, + 'status' => 'approve', + 'number' => $per_page, + 'offset' => ($comments_page - 1) * $per_page, + 'type' => 'comment', + 'update_comment_meta_cache' => false, + ]); + if ($user_comments) : + ?> +
+ + $c]); + ?> + +
+ +
+ + + +
> + + 'post', + 'post_status' => 'publish', + 'post__in' => $favorite_post_ids, + 'orderby' => 'post__in', + 'posts_per_page' => $per_page, + 'paged' => $favorites_page, + 'ignore_sticky_posts' => true, + 'no_found_rows' => false, + 'update_post_meta_cache' => false, + ]); + if ($favorites_query->have_posts()) : + ?> +
+ have_posts()) : $favorites_query->the_post(); ?> + [ + 'type' => 'view', + 'url' => get_permalink(), + 'label' => __('阅读', 'aksrt'), + ], + ]); + ?> + +
+ max_num_pages, $favorites_page, 'favorites_page'); + wp_reset_postdata(); + else : + aksrt_render_profile_empty($svg_empty_favorite, __('TA 还没有收藏文章', 'aksrt')); + endif; + ?> + + + +
+ + + +
> +
+

+
+

+ +
+
+ + + __('暂无商品内容', 'aksrt'), + 'plate' => __('暂无圈子内容', 'aksrt'), + ]; + foreach ($_uh_extended_tabs as $_uh_ext) : + if (!in_array($_uh_ext, $enabled_tabs, true)) continue; + ?> +
> + +
+ diff --git a/templates/parts/user-home/sidebar.php b/templates/parts/user-home/sidebar.php new file mode 100644 index 00000000..5d91cf44 --- /dev/null +++ b/templates/parts/user-home/sidebar.php @@ -0,0 +1,88 @@ + + + +