fix(admin): replicate reference comment settings page 1:1
- Rewrite post_list/comment schema (PHP + JS) with the reference theme's field set, order, defaults and dependencies; smilie, comment location and quick-reply fields excluded - Map PostDisplay::get_comment_display_settings() to the new keys without legacy fallback: close_comments, comment_paginate_type (ajax_lists), user_edit_comment master switch, WP comment_order for sorting - Wire comment_box_hide visibility gate (signin / vip / vip_2 / auth) - Drop dead comment settings (order/per_page/depth/avatar/hot threshold/ empty text/city), the dead post_close_comments field, and city readers now fully owned by the IP-geo extension - Add comment settings reference contract test
This commit is contained in:
@@ -136,7 +136,6 @@ class SchemaPostList {
|
||||
['key' => 'post_default_likes_min', 'label' => '默认点赞最小值', 'type' => 'number', 'default' => 5, 'min' => 0, 'max' => 9999],
|
||||
['key' => 'post_default_likes_max', 'label' => '默认点赞最大值', 'type' => 'number', 'default' => 15, 'min' => 1, 'max' => 9999],
|
||||
['key' => 'post_views_s', 'label' => '浏览统计', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'post_close_comments', 'label' => '关闭评论', 'type' => 'switch', 'default' => false],
|
||||
]],
|
||||
],
|
||||
],
|
||||
@@ -199,53 +198,36 @@ class SchemaPostList {
|
||||
'comment' => [
|
||||
'key' => 'comment',
|
||||
'title' => '评论设置',
|
||||
'version' => '1.0.0',
|
||||
'version' => '2.0.0',
|
||||
'option_key' => 'aksrt_settings',
|
||||
'groups' => [
|
||||
['key' => 'display', 'title' => '评论展示', 'fields' => [
|
||||
['key' => 'comment_order', 'label' => '评论排序', 'type' => 'radio', 'default' => 'asc', 'options' => [
|
||||
['label' => '正序', 'value' => 'asc'],
|
||||
['label' => '倒序', 'value' => 'desc'],
|
||||
['key' => 'comment', 'title' => '评论设置', 'fields' => [
|
||||
['key' => 'close_comments', 'label' => '关闭文章评论功能', 'type' => 'switcher', 'default' => false, 'description' => '部分网站无需交互,或需备案审核,可在此关闭所有文章的评论功能。同时每一篇文章可单独关闭评论功能'],
|
||||
['key' => 'comment_box_hide', 'label' => '隐藏评论模块', 'type' => 'radio', 'default' => '', 'dependsOn' => ['key' => 'close_comments', 'value' => false], 'options' => [
|
||||
['label' => '不隐藏', 'value' => ''],
|
||||
['label' => '登录后显示', 'value' => 'signin'],
|
||||
['label' => '所有会员显示', 'value' => 'vip'],
|
||||
['label' => '二级会员显示', 'value' => 'vip_2'],
|
||||
['label' => '认证用户显示', 'value' => 'auth'],
|
||||
], 'description' => '当用户满足条件时,文章评论功能及模块才会显示'],
|
||||
['key' => 'comment_paginate_type', 'label' => '评论列表翻页模式', 'type' => 'radio', 'default' => 'default', 'dependsOn' => ['key' => 'close_comments', 'value' => false], 'options' => [
|
||||
['label' => 'AJAX追加列表翻页', 'value' => 'ajax_lists'],
|
||||
['label' => '数字翻页按钮', 'value' => 'default'],
|
||||
]],
|
||||
['key' => 'comment_per_page', 'label' => '每页评论数', 'type' => 'number', 'default' => 20, 'min' => 5, 'max' => 100],
|
||||
['key' => 'comment_pagination_type', 'label' => '分页方式', 'type' => 'radio', 'default' => 'numbered', 'options' => [
|
||||
['label' => '翻页', 'value' => 'numbered'],
|
||||
['label' => '加载更多', 'value' => 'load_more'],
|
||||
['label' => '无限滚动', 'value' => 'infinite'],
|
||||
]],
|
||||
['key' => 'comment_paging_ajax_ias_s', 'label' => '评论自动加载', 'type' => 'switch', 'default' => true, 'description' => '评论无限滚动时自动触发加载'],
|
||||
['key' => 'comment_paging_ajax_ias_max', 'label' => '评论最大加载页数', 'type' => 'number', 'default' => 3, 'min' => 0, 'max' => 10, 'description' => '0=不限'],
|
||||
['key' => 'comment_nested_depth', 'label' => '回复嵌套深度', 'type' => 'number', 'default' => 3, 'min' => 1, 'max' => 10],
|
||||
['key' => 'comment_avatar_size', 'label' => '头像大小', 'type' => 'number', 'default' => 48, 'min' => 24, 'max' => 96],
|
||||
]],
|
||||
['key' => 'permissions', 'title' => '评论权限', 'fields' => [
|
||||
['key' => 'comment_close_comments', 'label' => '关闭评论', 'type' => 'switch', 'default' => false],
|
||||
['key' => 'comment_edit_window', 'label' => '作者自助编辑时限(分钟)', 'type' => 'number', 'default' => 10, 'min' => 0, 'max' => 1440],
|
||||
]],
|
||||
['key' => 'toolbar', 'title' => '评论工具栏', 'fields' => [
|
||||
['key' => 'comment_code', 'label' => '代码插入', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'comment_img', 'label' => '图片按钮', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'comment_upload_img', 'label' => '评论图片上传', 'type' => 'switch', 'default' => false],
|
||||
['key' => 'comment_link', 'label' => '链接按钮', 'type' => 'switch', 'default' => false],
|
||||
]],
|
||||
['key' => 'interaction', 'title' => '互动功能', 'fields' => [
|
||||
['key' => 'comment_hot_threshold', 'label' => '神评点赞阈值', 'type' => 'number', 'default' => 10, 'min' => 1, 'max' => 999],
|
||||
['key' => 'comment_like_s', 'label' => '评论点赞', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'comment_user_url_s', 'label' => '匿名者网址', 'type' => 'switch', 'default' => false, 'description' => '用户未登录评论时,允许输入用户博客地址'],
|
||||
['key' => 'comment_city_s', 'label' => '评论城市', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'comment_city_type', 'label' => '城市显示格式', 'type' => 'radio', 'default' => 'province_city', 'options' => [
|
||||
['label' => '省份+城市', 'value' => 'province_city'],
|
||||
['label' => '仅省份', 'value' => 'province'],
|
||||
['label' => '国家+省份', 'value' => 'country_province'],
|
||||
]],
|
||||
['key' => 'comment_author_tag', 'label' => '作者标签', 'type' => 'switch', 'default' => true],
|
||||
['key' => 'comment_corderby', 'label' => '评论排序切换', 'type' => 'switch', 'default' => true, 'description' => '前台显示最新/最早/最热切换按钮'],
|
||||
]],
|
||||
['key' => 'text', 'title' => '文案配置', 'fields' => [
|
||||
['key' => 'comment_empty_text', 'label' => '空评论提示', 'type' => 'input', 'default' => '暂无评论,来做第一个评论的人吧~'],
|
||||
['key' => 'comment_title', 'label' => '评论区标题', 'type' => 'input', 'default' => '评论'],
|
||||
['key' => 'comment_submit_text', 'label' => '提交按钮文案', 'type' => 'input', 'default' => '提交评论'],
|
||||
['key' => 'comment_text', 'label' => '评论框提示', 'type' => 'input', 'default' => '说点什么吧...'],
|
||||
['key' => 'comment_paging_ajax_ias_s', 'label' => 'AJAX翻页自动加载', 'type' => 'switcher', 'default' => true, 'dependsOn' => ['key' => 'comment_paginate_type', 'value' => 'ajax_lists'], 'description' => '页面滚动到列表尽头时,自动加载下一页'],
|
||||
['key' => 'comment_paging_ajax_ias_max', 'label' => '自动加载页数', 'type' => 'number', 'default' => 3, 'min' => 0, 'max' => 10, 'unit' => '页', 'dependsOn' => ['all' => [['key' => 'comment_paginate_type', 'value' => 'ajax_lists'], ['key' => 'comment_paging_ajax_ias_s', 'value' => true]]], 'description' => 'AJAX翻页自动加载最多加载几页(为0则不限制,直到加载全部评论)'],
|
||||
['key' => 'comment_code', 'label' => '允许插入代码', 'type' => 'switcher', 'default' => true, 'dependsOn' => ['key' => 'close_comments', 'value' => false], 'help' => '为了防止恶意评论,建议在后台-设置-讨论:开启“用户必须登录后才能发表评论”'],
|
||||
['key' => 'comment_img', 'label' => '允许插入图片', 'type' => 'switcher', 'default' => true, 'dependsOn' => ['key' => 'close_comments', 'value' => false]],
|
||||
['key' => 'comment_upload_img', 'label' => '允许上传图片', 'type' => 'switcher', 'default' => false, 'dependsOn' => ['all' => [['key' => 'close_comments', 'value' => false], ['key' => 'comment_img', 'value' => true]]]],
|
||||
['key' => 'comment_link', 'label' => '允许插入链接', 'type' => 'switcher', 'default' => false],
|
||||
['key' => 'comment_author_tag', 'label' => '显示“作者”标签', 'type' => 'switcher', 'default' => true, 'dependsOn' => ['key' => 'close_comments', 'value' => false]],
|
||||
['key' => 'user_edit_comment', 'label' => '允许用户编辑评论', 'type' => 'switcher', 'default' => true, 'dependsOn' => ['key' => 'close_comments', 'value' => false]],
|
||||
['key' => 'comment_like_s', 'label' => '评论点赞功能', 'type' => 'switcher', 'default' => true, 'dependsOn' => ['key' => 'close_comments', 'value' => false]],
|
||||
['key' => 'comment_user_url_s', 'label' => '匿名评论允许输入链接', 'type' => 'switcher', 'default' => false, 'dependsOn' => ['key' => 'close_comments', 'value' => false], 'description' => '用户未登录评论时,允许输入用户博客地址'],
|
||||
['key' => 'comment_corderby', 'label' => '评论排序功能', 'type' => 'switcher', 'default' => true, 'dependsOn' => ['all' => [['key' => 'close_comments', 'value' => false], ['key' => 'comment_like_s', 'value' => true]]], 'description' => '显示“最新、最热”排序按钮'],
|
||||
['key' => 'comment_title', 'label' => '自定义评论标题', 'type' => 'textarea', 'default' => '评论', 'rows' => 1, 'dependsOn' => ['key' => 'close_comments', 'value' => false]],
|
||||
['key' => 'comment_submit_text', 'label' => '自定义评论提交按钮文案', 'type' => 'textarea', 'default' => '提交评论', 'rows' => 1, 'dependsOn' => ['key' => 'close_comments', 'value' => false]],
|
||||
['key' => 'comment_text', 'label' => '自定义评论框占位符文案', 'type' => 'input', 'default' => '欢迎您留下宝贵的见解!', 'dependsOn' => ['key' => 'close_comments', 'value' => false]],
|
||||
]],
|
||||
],
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user