refactor: remove forum and topic feature chains
This commit is contained in:
@@ -53,7 +53,6 @@ trait DisplayPageGroups {
|
||||
$s = self::get_all();
|
||||
$allowed_page_types = [
|
||||
'home',
|
||||
'topics',
|
||||
'category',
|
||||
'tag',
|
||||
'author',
|
||||
@@ -153,7 +152,6 @@ trait DisplayPageGroups {
|
||||
'category_recommend' => self::get_category_recommend_settings(),
|
||||
'category' => self::get_category_page_settings(),
|
||||
'tag' => self::get_tag_page_settings(),
|
||||
'special' => self::get_special_page_settings(),
|
||||
'user_home' => self::get_user_home_settings(),
|
||||
'other' => self::get_other_page_settings(),
|
||||
'background' => self::get_global_background_settings(),
|
||||
@@ -205,7 +203,6 @@ trait DisplayPageGroups {
|
||||
'list_card_home' => $list['card_home'],
|
||||
'list_card_cat' => $list['card_cat_ids'] ?? [],
|
||||
'list_card_tag' => $list['card_tag'],
|
||||
'list_card_topics' => $list['card_topics'],
|
||||
'list_card_author' => $list['card_author'],
|
||||
],
|
||||
'thumb' => [
|
||||
|
||||
@@ -67,7 +67,7 @@ trait FacadeBulk {
|
||||
|
||||
$types = [];
|
||||
if (!empty($s['header_newposts_types']) && is_array($s['header_newposts_types'])) {
|
||||
$types = array_values(array_filter(array_map('sanitize_key', $s['header_newposts_types'])));
|
||||
$types = array_values(array_intersect(array_map('sanitize_key', $s['header_newposts_types']), ['post']));
|
||||
}
|
||||
|
||||
// zibll nav_newposts_radius is bool pill; map true→20px, false→0. Legacy int still accepted once.
|
||||
@@ -218,59 +218,6 @@ trait FacadeBulk {
|
||||
'page_author_posts_per_page' => $author_per_page,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Special/topic page display settings.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function get_special_page_settings(): array {
|
||||
$s = self::get_all();
|
||||
$layout = sanitize_key((string) ($s['special_layout'] ?? 'grid'));
|
||||
$source_type = sanitize_key((string) ($s['special_source_type'] ?? 'category'));
|
||||
$subpage_display = sanitize_key((string) ($s['special_subpage_display'] ?? 'cards'));
|
||||
$pagination = sanitize_key((string) ($s['special_pagination'] ?? 'numeric'));
|
||||
$orderby = sanitize_key((string) ($s['special_orderby'] ?? 'date'));
|
||||
|
||||
if (!in_array($layout, ['grid', 'list', 'masonry'], true)) {
|
||||
$layout = 'grid';
|
||||
}
|
||||
if (!in_array($source_type, ['category', 'tag', 'custom'], true)) {
|
||||
$source_type = 'category';
|
||||
}
|
||||
if (!in_array($subpage_display, ['cards', 'list', 'grid'], true)) {
|
||||
$subpage_display = 'cards';
|
||||
}
|
||||
if (!in_array($pagination, ['numeric', 'load_more', 'infinite'], true)) {
|
||||
$pagination = 'numeric';
|
||||
}
|
||||
if (!in_array($orderby, ['date', 'modified', 'views', 'comments'], true)) {
|
||||
$orderby = 'date';
|
||||
}
|
||||
|
||||
return [
|
||||
'cover_enabled' => !empty($s['special_cover_enabled']),
|
||||
'summary_enabled' => !empty($s['special_summary_enabled']),
|
||||
'summary_length' => max(50, min(500, (int) ($s['special_summary_length'] ?? 200))),
|
||||
'default_cover' => esc_url_raw((string) ($s['special_default_cover'] ?? '')),
|
||||
'layout' => $layout,
|
||||
'columns' => max(1, min(4, (int) ($s['special_columns'] ?? 2))),
|
||||
'source_type' => $source_type,
|
||||
'source_ids' => trim((string) ($s['special_source_ids'] ?? '')),
|
||||
'subpage_display' => $subpage_display,
|
||||
'subpage_count' => max(1, min(20, (int) ($s['special_subpage_count'] ?? 6))),
|
||||
'sidebar' => !empty($s['special_sidebar']),
|
||||
'pagination' => $pagination,
|
||||
'per_page' => max(4, min(48, (int) ($s['special_per_page'] ?? 12))),
|
||||
'post_count' => !empty($s['special_post_count']),
|
||||
'orderby' => $orderby,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Share and poster settings.
|
||||
*
|
||||
|
||||
@@ -41,7 +41,7 @@ class PostDisplay {
|
||||
|
||||
$sticky_pages_raw = $settings['sticky_s'] ?? null;
|
||||
if (is_array($sticky_pages_raw)) {
|
||||
$allowed_pages = ['home', 'cat', 'tag', 'topics'];
|
||||
$allowed_pages = ['home', 'cat', 'tag'];
|
||||
$sticky_pages = array_values(array_intersect(array_map('sanitize_key', $sticky_pages_raw), $allowed_pages));
|
||||
} else {
|
||||
$sticky_pages = ['home', 'cat'];
|
||||
@@ -49,10 +49,10 @@ class PostDisplay {
|
||||
|
||||
$badge_types_raw = $settings['list_badge_show'] ?? null;
|
||||
if (is_array($badge_types_raw)) {
|
||||
$allowed_types = ['pay', 'cat', 'topics', 'tag'];
|
||||
$allowed_types = ['pay', 'cat', 'tag'];
|
||||
$badge_types = array_values(array_intersect(array_map('sanitize_key', $badge_types_raw), $allowed_types));
|
||||
} else {
|
||||
$badge_types = ['pay', 'cat', 'topics', 'tag'];
|
||||
$badge_types = ['pay', 'cat', 'tag'];
|
||||
}
|
||||
|
||||
$show_author = array_key_exists('post_list_author', $settings)
|
||||
@@ -139,7 +139,6 @@ class PostDisplay {
|
||||
'card_cat' => !empty($card_cat_ids),
|
||||
'card_cat_ids' => $card_cat_ids,
|
||||
'card_tag' => !empty($settings['list_card_tag']),
|
||||
'card_topics' => !empty($settings['list_card_topics']),
|
||||
'card_author' => !empty($settings['list_card_author']),
|
||||
];
|
||||
}
|
||||
@@ -200,8 +199,6 @@ class PostDisplay {
|
||||
'cat_show_tag' => !empty($settings['filter_cat_show_tag']),
|
||||
'tag_show_cat' => !isset($settings['filter_tag_show_cat']) || !empty($settings['filter_tag_show_cat']),
|
||||
'tag_show_tag' => !empty($settings['filter_tag_show_tag']),
|
||||
'topics_show_cat' => !isset($settings['filter_topics_show_cat']) || !empty($settings['filter_topics_show_cat']),
|
||||
'topics_show_tag' => !empty($settings['filter_topics_show_tag']),
|
||||
'custom_filter_show' => is_array($settings['custom_filter_show'] ?? null) ? array_map('sanitize_key', $settings['custom_filter_show']) : ['cat', 'tag'],
|
||||
'custom_filter' => self::sanitize_custom_filter_defs($settings['custom_filter'] ?? []),
|
||||
'cat_custom_filter' => self::sanitize_cat_custom_filter($settings['cat_custom_filter'] ?? []),
|
||||
@@ -219,7 +216,6 @@ class PostDisplay {
|
||||
'cats' => [],
|
||||
'cat_s' => $cfg['cat_show_cat'],
|
||||
'tag_s' => $cfg['cat_show_tag'],
|
||||
'topics_s' => false,
|
||||
'orderby_s' => $cfg['sort'],
|
||||
'custom_filters' => [],
|
||||
];
|
||||
@@ -435,7 +431,6 @@ class PostDisplay {
|
||||
'pay_vip_price_s' => !isset($settings['post_article_pay_vip_price_s']) || !empty($settings['post_article_pay_vip_price_s']),
|
||||
'pay_vip_1_discount' => max(0, min(100, (int) ($settings['post_article_pay_vip_1_discount'] ?? 80))),
|
||||
'pay_vip_2_discount' => max(0, min(100, (int) ($settings['post_article_pay_vip_2_discount'] ?? 50))),
|
||||
'topics_s' => !empty($settings['post_article_topics_s']),
|
||||
'custom_filter_s' => !isset($settings['post_article_custom_filter_s']) || !empty($settings['post_article_custom_filter_s']),
|
||||
];
|
||||
}
|
||||
@@ -660,7 +655,6 @@ class PostDisplay {
|
||||
'cats' => $cats,
|
||||
'cat_s' => !isset($item['cat_s']) || !empty($item['cat_s']),
|
||||
'tag_s' => !empty($item['tag_s']),
|
||||
'topics_s' => !empty($item['topics_s']),
|
||||
'orderby_s' => !isset($item['orderby_s']) || !empty($item['orderby_s']),
|
||||
'custom_filters' => $filters,
|
||||
];
|
||||
|
||||
@@ -683,7 +683,7 @@ class Settings {
|
||||
* Finds the matching cat_custom_filter binding, falls back to global custom_filter.
|
||||
*
|
||||
* @param int $cat_id Category term ID.
|
||||
* @return array{dimensions: array, show_cat: bool, show_tag: bool, show_topics: bool, show_orderby: bool}
|
||||
* @return array{dimensions: array, show_cat: bool, show_tag: bool, show_orderby: bool}
|
||||
*/
|
||||
public static function get_filter_config_for_category(int $cat_id): array {
|
||||
return PostDisplay::get_filter_config_for_category($cat_id);
|
||||
|
||||
@@ -31,7 +31,7 @@ class UserRuntime {
|
||||
return $clean;
|
||||
};
|
||||
|
||||
// Zibll author_main_tab_opt defaults: post, favorite, comment, plate, forum, follow.
|
||||
// Public profile tabs supported by this theme.
|
||||
$normalized_tabs = $parse_csv('user_home_tabs', 'posts,favorites,comments,follow');
|
||||
if (empty($normalized_tabs)) {
|
||||
$normalized_tabs = ['posts', 'favorites', 'comments', 'follow'];
|
||||
|
||||
Reference in New Issue
Block a user