$enabled, 'home_url' => $home_url, 'breadcrumbs' => [ 'enabled' => $breadcrumbs_s, 'home' => $breadcrumbs_home, 'shop_home' => $breadcrumbs_shop_home, 'shop_home_name' => $breadcrumbs_shop_home_name, ], 'rewrite' => [ 'product_slug' => $product_rewrite_slug, 'cart_slug' => $cart_rewrite_slug, 'suffix_html' => $rewrite_suffix_html, ], 'list' => [ 'orderby' => $list_orderby, 'count' => $list_count, 'paging' => $list_paging, 'ias_s' => $list_ias_s, 'ias_max' => $list_ias_max, 'style' => $list_style, ], 'sales' => [ 'show' => $sales_show, 'show_min' => $sales_show_min, ], 'contact' => [ 'msg_s' => $contact_msg_s, 'name' => $contact_name, 'note' => $contact_note, 'more' => $contact_more, ], 'single' => [ 'content_layout' => $content_layout, 'content_show_bg' => $content_show_bg, 'tab' => $single_tab, 'content_after' => $content_after, 'related_s' => $related_s, 'related_opt' => $related_opt, 'main_image_default' => $main_image_default, ], 'product_defaults' => [ 'limit_buy' => $limit_buy, 'guest_buy' => $guest_buy, 'email_fill' => $email_fill, 'rebate' => $rebate, 'shipping_fee' => $shipping_fee, 'after_sale' => $after_sale, 'service' => $service, 'params_default' => $params_default, ], 'shipping' => [ 'manual_address' => $manual_address, 'express_api_sdk' => $express_api_sdk, 'express_query_interval' => $express_query_interval, 'express_kdniao_opt' => $express_kdniao_opt, 'express_kuaidi100_opt' => $express_kuaidi100_opt, 'express_aliyun_opt' => $express_aliyun_opt, 'shipping_company' => $shipping_company, ], 'timing' => [ 'receipt_max_day' => $receipt_max_day, 'comment_max_day' => $comment_max_day, 'comment_placeholder' => $comment_placeholder, 'comment_img_num' => $comment_img_num, 'after_sale_return_max_day' => $after_sale_return_max_day, 'after_sale_reason_refund' => $after_sale_reason_refund, 'after_sale_reason_return' => $after_sale_reason_return, ], 'author_show' => $author_show, ]; } /** * 获取论坛设置 * * 对标 zibll 论坛后台 12 section,提供一站式读取。 * 所有 key 与 schema_forum() 一一对应。 */ public static function get_forum_settings(): array { $s = AKSRT_Settings::get_all(); // helper: bool with default true $bool = static fn(string $k, bool $d = false): bool => isset($s[$k]) ? !empty($s[$k]) : $d; // helper: int $int = static fn(string $k, int $d): int => (int) ($s[$k] ?? $d); // helper: string $str = static fn(string $k, string $d): string => sanitize_text_field((string) ($s[$k] ?? $d)); // helper: select with allowlist $sel = static fn(string $k, string $d, array $allow): string => in_array($s[$k] ?? '', $allow, true) ? $s[$k] : $d; return [ // ── basic ── 'enabled' => $bool('bbs_s', true), 'admin_users' => array_map('absint', (array) ($s['bbs_admin_users'] ?? [])), // ── names ── 'names' => [ 'forum' => $str('bbs_forum_display_name', '论坛'), 'plate' => $str('bbs_plate_display_name', '版块'), 'posts' => $str('bbs_posts_display_name', '帖子'), 'topic' => $str('bbs_topic_display_name', '话题'), 'tag' => $str('bbs_tag_display_name', '标签'), 'comment' => $str('bbs_comment_display_name', '回复'), 'question_badge' => $str('bbs_question_badge_name', '提问'), 'question_ok_badge' => $str('bbs_question_ok_badge_name', '已解决'), 'cat_moderator' => $str('bbs_cat_moderator_name', '分区版主'), 'plate_author' => $str('bbs_plate_author_name', '超级版主'), 'plate_moderator' => $str('bbs_plate_moderator_name', '版主'), 'plate_follow' => $str('bbs_plate_follow_name', '关注'), ], // ── homepage ── 'homepage' => [ 'tabs' => (array) ($s['bbs_home_tab'] ?? [ ['type' => 'follow', 'label' => '关注'], ['type' => 'synthesis', 'label' => '综合'], ['type' => 'plate', 'label' => '版块'], ]), 'tab_active_index' => $int('bbs_home_tab_active_index', 1), 'quick_posts' => $bool('bbs_home_tab_quick_posts_s', true), 'tab_swiper' => $bool('bbs_home_tab_swiper', true), ], // ── board_page ── 'board_page' => [ 'top_info' => $bool('bbs_plate_top_info_s', true), 'tabs' => (array) ($s['bbs_plate_tab'] ?? [ ['label' => '全部', 'sort' => 'date'], ['label' => '推荐', 'sort' => 'featured'], ['label' => '最新回复', 'sort' => 'last_reply'], ['label' => '热门', 'sort' => 'hot'], ['label' => '精华', 'sort' => 'essence'], ]), 'tab_active_index' => $int('bbs_plate_tab_active_index', 0), 'tab_swiper' => $bool('bbs_plate_tab_swiper', true), ], // ── post_page ── 'post_page' => [ 'breadcrumbs' => $bool('bbs_breadcrumbs_s', true), 'breadcrumbs_home' => $bool('bbs_breadcrumbs_home', true), 'breadcrumbs_bbs_home' => $bool('bbs_breadcrumbs_bbs_home', true), 'breadcrumbs_bbs_home_name' => $str('bbs_breadcrumbs_bbs_home_name', '论坛'), 'breadcrumbs_plate_cat' => $bool('bbs_breadcrumbs_plate_cat', true), 'score_extra_max' => $int('bbs_score_extra_max', 5), 'score_deduct_max' => $int('bbs_score_deduct_max', 3), 'maxheight_enabled' => $bool('bbs_posts_maxheight_s'), 'maxheight' => $int('bbs_posts_maxheight', 800), 'cover_ratio' => $sel('bbs_posts_cover_ratio', '16:9', ['16:9', '4:3', '1:1', '3:4']), 'cover_video_mute' => $bool('bbs_posts_cover_video_mute', true), ], // ── reply ── 'reply' => [ 'paginate_type' => $sel('bbs_reply_paginate_type', 'ajax', ['ajax', 'page']), 'paginate_ias' => $bool('bbs_reply_paginate_ias_s'), 'paginate_ias_max' => $int('bbs_reply_paginate_ias_max', 3), 'smilie' => $bool('bbs_comment_smilie', true), 'code' => $bool('bbs_comment_code', true), 'img' => $bool('bbs_comment_img', true), 'upload_img' => $bool('bbs_comment_upload_img'), 'quick_reply' => $bool('bbs_comment_quick_s', true), 'quick_phrases' => $str('bbs_comment_quick_often', "不错,学习了\n感谢分享\n期待更新"), 'placeholder' => $str('bbs_comment_placeholder', '写下你的回复…'), 'hot_threshold' => $int('bbs_comment_hot_threshold', 10), ], // ── permissions ── 'permissions' => [ 'post_add_limit' => $int('bbs_posts_add_limit_opt_max', 10), 'plate_add_limit' => $int('bbs_plate_add_limit_opt_max', 3), 'show_new_plate' => $bool('bbs_show_new_plate'), 'show_new_topic' => $bool('bbs_show_new_topic', true), 'show_apply_moderator' => $bool('bbs_show_apply_moderator', true), 'paid_content' => $bool('bbs_post_pay_hide_type_s'), 'vip_price' => $bool('bbs_post_pay_vip_price_s'), 'vip_1_discount' => $int('bbs_post_pay_vip_1_discount', 80), 'vip_2_discount' => $int('bbs_post_pay_vip_2_discount', 50), 'pay_price_limit' => $int('bbs_post_pay_price_limit', 1000), 'plate_follow_pay' => $bool('bbs_plate_follow_pay_s'), 'plate_follow_price' => $int('bbs_plate_follow_pay_price', 10), 'plate_follow_pay_type' => $sel('bbs_plate_follow_pay_type', 'money', ['money', 'points']), ], // ── other ── 'other' => [ 'vote_number_type' => $sel('bbs_vote_number_type', 'percent', ['percent', 'number']), 'vote_max' => $int('bbs_vote_max', 8), 'apply_moderator_desc' => $str('bbs_apply_moderator_desc', '欢迎有热情的用户申请成为版主,协助管理社区秩序。'), 'term_thumb' => esc_url_raw((string) ($s['bbs_term_thumb'] ?? '')), 'hide_pay_in_list' => $bool('bbs_post_lists_hide_pay_s'), 'title_strlen_limit' => $int('bbs_post_title_strlen_limit', 30), 't_placeholder' => $str('bbs_t_placeholder', '请输入标题'), 'c_placeholder' => $str('bbs_c_placeholder', '请输入内容'), 'html_suffix' => $bool('bbs_rewrite_suffix_html_s'), 'plate_slug' => $str('bbs_plate_rewrite_slug', 'board'), 'posts_slug' => $str('bbs_posts_rewrite_slug', 'topic'), 'edit_slug' => $str('bbs_posts_edit_rewrite_slug', 'topic-edit'), 'gutenberg' => $bool('bbs_posts_show_in_rest_s'), ], // ── upload ── 'upload' => [ 'img_size' => $int('bbs_upload_img_size', 2048), 'img_multiple' => $int('bbs_image_upload_multiple', 9), 'video_size' => $int('bbs_upload_video_size', 20480), 'file_size' => $int('bbs_upload_file_size', 10240), 'file_mimes' => $str('bbs_upload_file_mimes', 'jpg,jpeg,png,gif,mp4,zip,rar,pdf'), ], // ── credits ── 'credits' => [ 'post_new' => $int('bbs_credits_post_new', 5), 'plate_new' => $int('bbs_credits_plate_new', 10), 'comment_new' => $int('bbs_credits_comment_new', 2), 'comment_like' => $int('bbs_credits_comment_like', 1), 'score_extra' => $int('bbs_credits_score_extra', 3), 'essence' => $int('bbs_credits_essence', 10), 'posts_hot' => $int('bbs_credits_posts_hot', 5), 'adopted' => $int('bbs_credits_adopted', 20), 'daily_max' => $int('bbs_credits_daily_max', 50), ], ]; } }