get_home_view($current_user_id) : [ 'boards' => [], 'recent_topics' => [], 'hot_topics' => [], 'stats' => [], 'permissions' => ['can_compose' => false, 'can_manage' => false], 'applications' => [], 'home_tabs' => [], 'active_index' => 1, 'quick_posts' => true, ]; $boards = $view['boards'] ?? []; $recent_topics = $view['recent_topics'] ?? []; $synthesis = is_array($view['synthesis'] ?? null) ? $view['synthesis'] : ['items' => $recent_topics, 'max_pages' => 1, 'page' => 1, 'total' => count($recent_topics)]; $synthesis_max = max(1, (int) ($synthesis['max_pages'] ?? 1)); $hot_topics = $view['hot_topics'] ?? []; $stats = $view['stats'] ?? []; $permissions = $view['permissions'] ?? []; $applications = $view['applications'] ?? []; $compose_url = aksrt_get_forum_compose_url(); $forum_settings = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_forum_settings() : []; $forum_names = $forum_settings['names'] ?? []; $name_forum = $forum_names['forum'] ?? __('论坛', 'aksrt'); $name_plate = $forum_names['plate'] ?? __('版块', 'aksrt'); $name_topic = $forum_names['posts'] ?? __('主题', 'aksrt'); $name_reply = $forum_names['comment'] ?? __('回复', 'aksrt'); $admin_forum_url = admin_url('admin.php?page=aksrt-theme-admin#/forum'); $home_tabs = $view['home_tabs'] ?? []; $active_index = max(0, min(count($home_tabs) - 1, (int) ($view['active_index'] ?? 1))); $quick_posts = !empty($view['quick_posts']); $nonce = wp_create_nonce('aksrt_public_nonce'); // Resolve active tab from query param or default $active_tab_type = isset($_GET['forum_tab']) ? sanitize_key(wp_unslash($_GET['forum_tab'])) : ''; if ($active_tab_type === '' && isset($home_tabs[$active_index])) { $active_tab_type = $home_tabs[$active_index]['type'] ?? 'synthesis'; } if ($active_tab_type === '') { $active_tab_type = 'synthesis'; } // 前台公开主 tabs 不允许 pending;未登录时 follow 回落到综合 $can_manage = !empty($permissions['can_manage']); if ($active_tab_type === 'pending') { $active_tab_type = 'synthesis'; } if ($active_tab_type === 'follow' && $current_user_id <= 0) { $active_tab_type = 'synthesis'; } // 配置里的 pending 类型从公开 tab 列表剔除(治理入口单独渲染) $public_home_tabs = []; foreach ((array) $home_tabs as $tab_row) { $tt = sanitize_key((string) ($tab_row['type'] ?? '')); if ($tt === '' || $tt === 'pending') { continue; } $public_home_tabs[] = $tab_row; } if (empty($public_home_tabs)) { $public_home_tabs = [ ['type' => 'synthesis', 'label' => __('综合', 'aksrt')], ['type' => 'follow', 'label' => __('关注', 'aksrt')], ['type' => 'plate', 'label' => $name_plate], ]; } ?>

get_follow_stream($current_user_id) : ['items' => []]; if (!empty($follow_data['items'])) : ?>
render_topic_row($topic); } ?>
1) : ?>
0) : ?>

render_topic_row($topic); } } ?>
1) : ?>