feat: remove forum feature (Phase 1)

This commit is contained in:
kate522 committed 2026-08-02 20:02:44 +08:00
1 parent f3e4cdd9cf
commit 2bbd7c01a3
173 files changed
+51 -27360

No files matched your search

-42
View File
@@ -79,52 +79,16 @@ if (!function_exists('aksrt_get_user_home_page_context')) {
$display_tabs = $is_mobile ? $enabled_tabs_mobile : $enabled_tabs_pc;
$default_tab = !empty($display_tabs) ? $display_tabs[0] : $enabled_tabs[0];
$forum_instance = class_exists('\AKSRT\Forum\Forum') ? \AKSRT\Forum\Forum::get_instance() : null;
$forum_stats = $forum_instance ? $forum_instance->get_user_forum_stats($user_id) : [];
$forum_topic_count = (int) ($forum_stats['topic_count'] ?? 0);
$product_count = 0;
if (class_exists('\AKSRT\Shop\Shop')) {
$product_count = (int) \AKSRT\Shop\Shop::get_instance()->count_author_products($user_id);
}
$follow_count = 0;
if (class_exists('\AKSRT\User\Follow')) {
$follow_count = (int) \AKSRT\User\Follow::get_instance()->get_follower_count($user_id);
}
$plate_count = 0;
if ($forum_instance) {
$seen_plates = [];
if (method_exists($forum_instance, 'get_user_followed_plates')) {
foreach ((array) $forum_instance->get_user_followed_plates($user_id) as $plate) {
$pid = (int) ($plate['id'] ?? 0);
if ($pid > 0) {
$seen_plates[$pid] = true;
}
}
}
if (method_exists($forum_instance, 'get_user_managed_plates')) {
$managed = (array) $forum_instance->get_user_managed_plates($user_id);
foreach (['owned', 'moderating'] as $bucket) {
foreach ((array) ($managed[$bucket] ?? []) as $plate) {
$pid = (int) ($plate['id'] ?? 0);
if ($pid > 0) {
$seen_plates[$pid] = true;
}
}
}
}
$plate_count = count($seen_plates);
}
$tab_counts = [
'posts' => $post_count,
'comments' => $comment_count,
'favorites' => $favorite_count,
'credits' => $credits_enabled && $is_own_profile ? (int) round((float) $credit_balance) : 0,
'product' => $product_count,
'plate' => $plate_count,
'forum' => $forum_topic_count,
'follow' => $follow_count,
];
@@ -133,9 +97,6 @@ if (!function_exists('aksrt_get_user_home_page_context')) {
'comments' => __('评论', 'aksrt'),
'favorites' => __('收藏', 'aksrt'),
'credits' => sprintf(__('我的%s', 'aksrt'), $currency_name),
'product' => __('商品', 'aksrt'),
'plate' => __('圈子', 'aksrt'),
'forum' => __('论坛', 'aksrt'),
'follow' => __('粉丝', 'aksrt'), // Zibll: 粉丝
];
foreach ($visible_tabs as $tab_key => $tab_config) {
@@ -174,9 +135,6 @@ if (!function_exists('aksrt_get_user_home_page_context')) {
'active_tab' => $active_tab,
'tab_counts' => $tab_counts,
'tab_labels' => $tab_labels,
'forum_instance' => $forum_instance,
'forum_stats' => $forum_stats,
'forum_topic_count' => $forum_topic_count,
'home_url' => $home_url,
'posts_page' => max(1, isset($_GET['posts_page']) ? (int) $_GET['posts_page'] : 1),
'comments_page' => max(1, isset($_GET['comments_page']) ? (int) $_GET['comments_page'] : 1),