feat(forum): rebuild forum home page

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Fable 5 committed 2026-11-11 14:41:02 +08:00
1 parent 51d5b8a2a1
commit 024ecddfed
16 files changed
+1061 -198

No files matched your search

+37 -1
View File
@@ -17,7 +17,41 @@ final class SchemaForum {
]),
'home' => self::section('home', '首页与列表', [
self::field('jio_forum_page_size', '每页帖子数', 'number', 20, ['min' => 1, 'max' => 50]),
self::field('jio_forum_home_tabs', '首页栏目', 'checkbox', ['latest', 'popular', 'essence', 'question', 'vote', 'plates', 'follow'], ['options' => self::options(['latest' => '最新', 'popular' => '热门', 'essence' => '精华', 'question' => '问答', 'vote' => '投票', 'plates' => '版块', 'follow' => '已关注'])]),
self::field('jio_forum_home_tab_items', '首页栏目', 'repeater', \Jio\Forum\HomeTabs::defaults(), [
'addText' => '添加栏目',
'description' => '选择并排序论坛首页的栏目,访客可通过 index 参数直接打开某个栏目',
'fields' => [
self::field('title', '栏目标题', 'input', ''),
self::field('type', '栏目类型', 'select', 'posts', ['options' => self::options([
'follow' => '关注',
'synthesis' => '综合',
'plate' => '版块',
'posts' => '帖子列表',
])]),
self::field('orderby', '排序方式', 'select', 'date', ['options' => self::options([
'date' => '发布时间',
'modified' => '修改时间',
'last_reply' => '最新回复',
'popular' => '热度',
'views' => '阅读量',
'score' => '评分',
])]),
self::field('filter', '内容筛选', 'select', '', ['options' => self::options([
'' => '全部',
'essence' => '精华',
'question' => '问答',
'vote' => '投票',
])]),
self::field('style', '列表样式', 'radio', 'detail', ['options' => self::options(['detail' => '详细内容', 'mini' => '简约风格'])]),
self::field('show', '显示端', 'checkbox', ['pc_s', 'm_s'], ['options' => self::options(['pc_s' => 'PC 端', 'm_s' => '移动端'])]),
],
]),
self::field('jio_forum_home_tab_active', '默认栏目', 'number', 2, ['min' => 1, 'max' => 20, 'description' => '打开首页时默认显示第几个栏目']),
self::field('jio_forum_home_quick_post', '快速发布', 'switcher', true),
self::field('jio_forum_home_quick_post_tab', '快速发布所在栏目', 'number', 2, ['min' => 1, 'max' => 20]),
self::field('jio_forum_home_hot_plate', '版块栏目显示热门推荐', 'switcher', true),
self::field('jio_forum_home_follow_plate', '版块栏目显示已关注版块', 'switcher', true),
self::field('jio_forum_home_recommend_plate', '关注栏目显示版块推荐', 'switcher', true),
self::field('jio_forum_show_plate_cover', '显示版块封面', 'switcher', true),
self::field('jio_forum_search_enabled', '搜索包含帖子', 'switcher', true),
]),
@@ -65,6 +99,8 @@ final class SchemaForum {
return ['key' => $key, 'title' => $title, 'version' => '1.0.0', 'option_key' => 'jio_settings', 'groups' => [['key' => $key, 'fields' => $fields]]];
}
/** Initial tab rows for the forum home; mirrors the built-in home layout. */
private static function field(string $key, string $label, string $type, $default, array $extra = []): array {
return array_merge(['key' => $key, 'label' => $label, 'type' => $type, 'default' => $default], $extra);
}