feat(forum): frontend 1:1 list/tabs/urls/enqueue

Wire Zibll-style board sort tabs, shared topic rows, page-template
URLs, forum asset enqueue on home/plate, home synthesis load-more,
and topic last_reply meta for last-reply ordering. No dual-read.
This commit is contained in:
kate522 committed 2026-07-12 08:38:31 +08:00
1 parent df6b224dd3
commit 780c8cb4f7
23 files changed
+843 -481

No files matched your search

+15 -2
View File
@@ -28,11 +28,13 @@ $view = $forum ? $forum->get_home_view($current_user_id) : [
$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 = home_url('/compose/');
$compose_url = aksrt_get_forum_compose_url();
$forum_settings = class_exists('AKSRT_Settings') ? AKSRT_Settings::get_forum_settings() : [];
$forum_names = $forum_settings['names'] ?? [];
@@ -258,10 +260,21 @@ if ($active_tab_type === '') {
if ($forum) { $forum->render_topic_row($topic); }
} ?>
</div>
<?php if ($synthesis_max > 1) : ?>
<div class="aksrt-forum-home__load-more">
<button type="button" class="aksrt-forum-replies__more-btn js-aksrt-home-load-more"
data-page="1" data-max="<?php echo esc_attr((string) $synthesis_max); ?>" data-tab="synthesis">
<i class="fas fa-chevron-down"></i> <?php esc_html_e('加载更多', 'aksrt'); ?>
</button>
</div>
<?php endif; ?>
<?php else : ?>
<div class="aksrt-forum__empty">
<i class="fas fa-feather-alt"></i>
<p><?php esc_html_e('还没有公开主题,欢迎创建第一个讨论。', 'aksrt'); ?></p>
<p><?php esc_html_e('内容空空如也', 'aksrt'); ?></p>
<?php if (!empty($permissions['can_compose'])) : ?>
<a href="<?php echo esc_url($compose_url); ?>"><?php esc_html_e('发布第一个主题', 'aksrt'); ?></a>
<?php endif; ?>
</div>
<?php endif; ?>
<?php endif; ?>