feat: remove forum feature (Phase 1)
This commit is contained in:
1 parent
f3e4cdd9cf
commit
2bbd7c01a3
173 files changed
+51
-27360
No files matched your search
@@ -38,7 +38,6 @@ require_once AKSRT_DIR . '/inc/helpers/aksrt-archive.php';
|
||||
require_once AKSRT_DIR . '/inc/helpers/aksrt-archive-filters.php';
|
||||
require_once AKSRT_DIR . '/inc/helpers/aksrt-comments.php';
|
||||
require_once AKSRT_DIR . '/inc/helpers/aksrt-forum.php';
|
||||
require_once AKSRT_DIR . '/inc/helpers/aksrt-forum-widgets.php';
|
||||
require_once AKSRT_DIR . '/inc/helpers/aksrt-slider.php';
|
||||
require_once AKSRT_DIR . '/inc/helpers/aksrt-vip.php';
|
||||
require_once AKSRT_DIR . '/inc/helpers/aksrt-auth-ui.php';
|
||||
|
||||
@@ -83,339 +83,4 @@ function aksrt_register_topics_taxonomy() {
|
||||
}
|
||||
add_action('init', 'aksrt_register_topics_taxonomy');
|
||||
|
||||
// ============================================================
|
||||
// 注册自定义文章类型 - Forum Topic & 分类法 - Forum Board
|
||||
// ============================================================
|
||||
|
||||
function aksrt_register_forum_cpt() {
|
||||
// Respect bbs_s switch — skip CPT registration when forum is disabled.
|
||||
// Admin context always registers so the backend settings page works.
|
||||
if (!is_admin() && class_exists('\AKSRT\Settings\Settings')) {
|
||||
$forum = \AKSRT\Settings\Settings::get_forum_settings();
|
||||
if (empty($forum['enabled'])) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Read custom slugs / names from settings when available
|
||||
$plate_slug = 'board';
|
||||
$topic_slug = 'topic';
|
||||
$forum_enabled = true;
|
||||
$forum_settings = [];
|
||||
if (class_exists('\AKSRT\Settings\Settings')) {
|
||||
$forum_settings = \AKSRT\Settings\Settings::get_forum_settings();
|
||||
$plate_slug = !empty($forum_settings['other']['plate_slug']) ? $forum_settings['other']['plate_slug'] : 'board';
|
||||
$topic_slug = !empty($forum_settings['other']['posts_slug']) ? $forum_settings['other']['posts_slug'] : 'topic';
|
||||
$forum_enabled = !empty($forum_settings['enabled']);
|
||||
}
|
||||
// Admin always registers types; menu follows bbs_s (zibll: show when forum on).
|
||||
$forum_show_menu = is_admin() ? $forum_enabled : false;
|
||||
$names = !empty($forum_settings['names']) ? $forum_settings['names'] : [];
|
||||
$forum_label = sanitize_text_field((string) ($names['forum'] ?? __('论坛', 'aksrt')));
|
||||
$posts_label = sanitize_text_field((string) ($names['posts'] ?? __('帖子', 'aksrt')));
|
||||
$topic_label = sanitize_text_field((string) ($names['topic'] ?? __('话题', 'aksrt')));
|
||||
$tag_label = sanitize_text_field((string) ($names['tag'] ?? __('标签', 'aksrt')));
|
||||
// Legacy board taxonomy: keep rewrite/bridge, hide from admin (plate CPT is canonical).
|
||||
register_taxonomy('aksrt_forum_board', 'aksrt_forum_topic', [
|
||||
'labels' => [
|
||||
'name' => __('论坛版块', 'aksrt'),
|
||||
'singular_name' => __('版块', 'aksrt'),
|
||||
'search_items' => __('搜索版块', 'aksrt'),
|
||||
'all_items' => __('所有版块', 'aksrt'),
|
||||
'edit_item' => __('编辑版块', 'aksrt'),
|
||||
'add_new_item' => __('添加版块', 'aksrt'),
|
||||
],
|
||||
'hierarchical' => true,
|
||||
'public' => true,
|
||||
'show_ui' => false,
|
||||
'show_in_menu' => false,
|
||||
'show_in_rest' => true,
|
||||
'show_admin_column' => false,
|
||||
'rewrite' => ['slug' => $plate_slug],
|
||||
]);
|
||||
|
||||
// Forum Tag taxonomy
|
||||
register_taxonomy('aksrt_forum_tag', 'aksrt_forum_topic', [
|
||||
'labels' => [
|
||||
'name' => sprintf(/* translators: %s: forum name */ __('%s标签', 'aksrt'), $forum_label),
|
||||
'singular_name' => $tag_label,
|
||||
'search_items' => sprintf(/* translators: %s: tag name */ __('搜索%s', 'aksrt'), $tag_label),
|
||||
'all_items' => sprintf(/* translators: %s: tag name */ __('所有%s', 'aksrt'), $tag_label),
|
||||
'edit_item' => sprintf(/* translators: %s: tag name */ __('编辑%s', 'aksrt'), $tag_label),
|
||||
'add_new_item' => sprintf(/* translators: %s: tag name */ __('添加%s', 'aksrt'), $tag_label),
|
||||
'menu_name' => $tag_label,
|
||||
],
|
||||
'hierarchical' => false,
|
||||
'public' => true,
|
||||
'show_ui' => true,
|
||||
'show_in_menu' => $forum_show_menu,
|
||||
'show_in_rest' => true,
|
||||
'show_admin_column' => true,
|
||||
'rewrite' => ['slug' => 'forum-tag'],
|
||||
]);
|
||||
|
||||
// Forum Topic taxonomy (话题,单选,区别于标签)
|
||||
register_taxonomy('aksrt_forum_topic_cat', 'aksrt_forum_topic', [
|
||||
'labels' => [
|
||||
'name' => sprintf(/* translators: %s: forum name */ __('%s话题', 'aksrt'), $forum_label),
|
||||
'singular_name' => $topic_label,
|
||||
'search_items' => sprintf(/* translators: %s: topic name */ __('搜索%s', 'aksrt'), $topic_label),
|
||||
'all_items' => sprintf(/* translators: %s: topic name */ __('所有%s', 'aksrt'), $topic_label),
|
||||
'edit_item' => sprintf(/* translators: %s: topic name */ __('编辑%s', 'aksrt'), $topic_label),
|
||||
'add_new_item' => sprintf(/* translators: %s: topic name */ __('添加%s', 'aksrt'), $topic_label),
|
||||
'menu_name' => $topic_label,
|
||||
],
|
||||
'hierarchical' => false,
|
||||
'public' => true,
|
||||
'show_ui' => true,
|
||||
'show_in_menu' => $forum_show_menu,
|
||||
'show_in_rest' => true,
|
||||
'show_admin_column' => true,
|
||||
'rewrite' => ['slug' => 'forum-topic'],
|
||||
]);
|
||||
|
||||
// Forum Topic CPT — native sidebar (zibll: forum_post @ pos 40)
|
||||
register_post_type('aksrt_forum_topic', [
|
||||
'labels' => [
|
||||
'name' => $forum_label . $posts_label,
|
||||
'singular_name' => $posts_label,
|
||||
'add_new' => sprintf(/* translators: %s: posts name */ __('添加%s', 'aksrt'), $posts_label),
|
||||
'add_new_item' => sprintf(/* translators: %s: posts name */ __('发布新%s', 'aksrt'), $posts_label),
|
||||
'edit_item' => sprintf(/* translators: %s: posts name */ __('编辑%s', 'aksrt'), $posts_label),
|
||||
'view_item' => sprintf(/* translators: %s: posts name */ __('查看%s', 'aksrt'), $posts_label),
|
||||
'all_items' => sprintf(/* translators: %s: posts name */ __('所有%s', 'aksrt'), $posts_label),
|
||||
'menu_name' => $forum_label . $posts_label,
|
||||
],
|
||||
'public' => true,
|
||||
'show_ui' => true,
|
||||
'show_in_menu' => $forum_show_menu,
|
||||
'show_in_rest' => true,
|
||||
'has_archive' => true,
|
||||
'menu_position' => 40,
|
||||
'menu_icon' => 'dashicons-buddicons-topics',
|
||||
'supports' => ['title', 'editor', 'author', 'comments', 'thumbnail', 'excerpt'],
|
||||
'capability_type' => 'post',
|
||||
'rewrite' => ['slug' => $topic_slug],
|
||||
]);
|
||||
}
|
||||
add_action('init', 'aksrt_register_forum_cpt');
|
||||
|
||||
// ============================================================
|
||||
// 注册板块 CPT (aksrt_forum_plate) + 板块分区 taxonomy (aksrt_plate_cat)
|
||||
// §7.0 plate CPT 脚手架:板块从 taxonomy 迁移为独立 CPT,
|
||||
// 支持作者(超级版主)、正文/摘要/封面、层级父子、独立 meta 扩展位。
|
||||
// ============================================================
|
||||
|
||||
function aksrt_register_forum_plate_cpt() {
|
||||
if (!is_admin() && class_exists('\AKSRT\Settings\Settings')) {
|
||||
$forum = \AKSRT\Settings\Settings::get_forum_settings();
|
||||
if (empty($forum['enabled'])) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$plate_slug = 'board';
|
||||
$forum_enabled = true;
|
||||
$forum = [];
|
||||
if (class_exists('\AKSRT\Settings\Settings')) {
|
||||
$forum = \AKSRT\Settings\Settings::get_forum_settings();
|
||||
$plate_slug = !empty($forum['other']['plate_slug']) ? $forum['other']['plate_slug'] : 'board';
|
||||
$forum_enabled = !empty($forum['enabled']);
|
||||
}
|
||||
$forum_show_menu = is_admin() ? $forum_enabled : false;
|
||||
$names = !empty($forum['names']) ? $forum['names'] : [];
|
||||
$forum_label = sanitize_text_field((string) ($names['forum'] ?? __('论坛', 'aksrt')));
|
||||
$plate_label = sanitize_text_field((string) ($names['plate'] ?? __('版块', 'aksrt')));
|
||||
|
||||
// Plate category taxonomy (分区)
|
||||
register_taxonomy('aksrt_plate_cat', 'aksrt_forum_plate', [
|
||||
'labels' => [
|
||||
'name' => sprintf(/* translators: %s: plate name */ __('%s分区', 'aksrt'), $plate_label),
|
||||
'singular_name' => __('分区', 'aksrt'),
|
||||
'search_items' => __('搜索分区', 'aksrt'),
|
||||
'all_items' => __('所有分区', 'aksrt'),
|
||||
'edit_item' => __('编辑分区', 'aksrt'),
|
||||
'add_new_item' => __('添加分区', 'aksrt'),
|
||||
'menu_name' => __('分区', 'aksrt'),
|
||||
],
|
||||
'hierarchical' => true,
|
||||
'public' => true,
|
||||
'show_ui' => true,
|
||||
'show_in_menu' => $forum_show_menu,
|
||||
'show_in_rest' => true,
|
||||
'show_admin_column' => true,
|
||||
'rewrite' => ['slug' => 'plate-cat'],
|
||||
]);
|
||||
|
||||
// Plate CPT (板块) — native sidebar (zibll: plate @ pos 40)
|
||||
register_post_type('aksrt_forum_plate', [
|
||||
'labels' => [
|
||||
'name' => $forum_label . $plate_label,
|
||||
'singular_name' => $plate_label,
|
||||
'add_new' => sprintf(/* translators: %s: plate name */ __('添加%s', 'aksrt'), $plate_label),
|
||||
'add_new_item' => sprintf(/* translators: %s: plate name */ __('创建%s', 'aksrt'), $plate_label),
|
||||
'edit_item' => sprintf(/* translators: %s: plate name */ __('编辑%s', 'aksrt'), $plate_label),
|
||||
'view_item' => sprintf(/* translators: %s: plate name */ __('查看%s', 'aksrt'), $plate_label),
|
||||
'search_items' => sprintf(/* translators: %s: plate name */ __('搜索%s', 'aksrt'), $plate_label),
|
||||
'not_found' => sprintf(/* translators: %s: plate name */ __('未找到%s', 'aksrt'), $plate_label),
|
||||
'not_found_in_trash' => sprintf(/* translators: %s: plate name */ __('回收站中未找到%s', 'aksrt'), $plate_label),
|
||||
'all_items' => sprintf(/* translators: %s: plate name */ __('所有%s', 'aksrt'), $plate_label),
|
||||
'menu_name' => $forum_label . $plate_label,
|
||||
],
|
||||
'public' => true,
|
||||
'hierarchical' => true,
|
||||
'show_ui' => true,
|
||||
'show_in_menu' => $forum_show_menu,
|
||||
'show_in_rest' => true,
|
||||
'has_archive' => false,
|
||||
'menu_position' => 40,
|
||||
'menu_icon' => 'dashicons-buddicons-forums',
|
||||
'supports' => ['title', 'editor', 'author', 'excerpt', 'thumbnail', 'page-attributes'],
|
||||
'capability_type' => 'post',
|
||||
'rewrite' => ['slug' => $plate_slug, 'with_front' => false],
|
||||
]);
|
||||
|
||||
// Keep aksrt_forum_topic assignable to plates via taxonomy bridge
|
||||
register_taxonomy_for_object_type('aksrt_forum_board', 'aksrt_forum_topic');
|
||||
}
|
||||
add_action('init', 'aksrt_register_forum_plate_cpt');
|
||||
|
||||
// ============================================================
|
||||
// §7.0 forum_post CPT 对齐:注册帖子 meta 扩展位地基
|
||||
// 为 aksrt_forum_topic 注册全部 meta key,提供类型安全 + REST 暴露。
|
||||
// ============================================================
|
||||
|
||||
function aksrt_register_forum_topic_meta() {
|
||||
$post_type = 'aksrt_forum_topic';
|
||||
|
||||
$meta_fields = [
|
||||
// 基础治理 meta (已有,补注册)
|
||||
'_aksrt_visibility' => ['type' => 'string', 'default' => 'public'],
|
||||
'_aksrt_review_status' => ['type' => 'string', 'default' => ''],
|
||||
'_aksrt_sticky' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_featured' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_locked' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_highlight' => ['type' => 'string', 'default' => ''],
|
||||
'_aksrt_views' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_moderation_note' => ['type' => 'string', 'default' => ''],
|
||||
'_aksrt_moderated_by' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_moderated_at' => ['type' => 'string', 'default' => ''],
|
||||
|
||||
// 帖子类型 + 问答状态 (Wave3)
|
||||
'_aksrt_bbs_type' => ['type' => 'string', 'default' => 'standard'],
|
||||
'_aksrt_question_status' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_adopted_comment' => ['type' => 'integer', 'default' => 0],
|
||||
|
||||
// 投票 (已有,补注册)
|
||||
'_aksrt_vote_enabled' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_vote_title' => ['type' => 'string', 'default' => ''],
|
||||
'_aksrt_vote_multiple' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_vote_type' => ['type' => 'string', 'default' => 'standard'],
|
||||
'_aksrt_vote_expiry_days' => ['type' => 'integer', 'default' => 0],
|
||||
|
||||
// 评分 (Wave3)
|
||||
'_aksrt_score' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_recommend_score' => ['type' => 'number', 'default' => 0],
|
||||
'_aksrt_hot_rewarded' => ['type' => 'integer', 'default' => 0],
|
||||
|
||||
// 收藏 (Wave3)
|
||||
'_aksrt_favorite_count' => ['type' => 'integer', 'default' => 0],
|
||||
|
||||
// 封面扩展位(论坛帖子封面;前台 forum-topic 渲染)
|
||||
'_aksrt_cover_type' => ['type' => 'string', 'default' => ''],
|
||||
'_aksrt_cover_image' => ['type' => 'string', 'default' => ''],
|
||||
'_aksrt_featured_slide' => ['type' => 'array', 'default' => []],
|
||||
'_aksrt_featured_video' => ['type' => 'string', 'default' => ''],
|
||||
'_aksrt_cover_ratio' => ['type' => 'string', 'default' => '16:9'],
|
||||
|
||||
// 付费内容扩展位(论坛帖子付费门槛;前台 forum-topic 渲染)
|
||||
'_aksrt_allow_view' => ['type' => 'string', 'default' => 'public'],
|
||||
'_aksrt_pay_price' => ['type' => 'number', 'default' => 0],
|
||||
'_aksrt_pay_vip_price' => ['type' => 'number', 'default' => 0], // legacy single VIP
|
||||
'_aksrt_pay_vip1_price' => ['type' => 'number', 'default' => 0],
|
||||
'_aksrt_pay_vip2_price' => ['type' => 'number', 'default' => 0],
|
||||
'_aksrt_pay_credits' => ['type' => 'integer', 'default' => 0], // legacy alias of credits_cost
|
||||
'_aksrt_credits_cost' => ['type' => 'integer', 'default' => 0], // runtime unlock price
|
||||
'_aksrt_credits_vip1' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_credits_vip2' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_pay_hide_part' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_virtual_sales' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_topic_coupon_s' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_visibility_roles' => ['type' => 'array', 'default' => []],
|
||||
|
||||
// 状态工作流扩展位 (Wave4)
|
||||
'_aksrt_closed' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_hidden' => ['type' => 'integer', 'default' => 0],
|
||||
|
||||
// 板块 CPT 关联 (§7.0 新增)
|
||||
'_aksrt_plate_id' => ['type' => 'integer', 'default' => 0],
|
||||
];
|
||||
|
||||
foreach ($meta_fields as $key => $args) {
|
||||
$schema = [
|
||||
'type' => $args['type'],
|
||||
'description' => $key,
|
||||
'single' => true,
|
||||
'default' => $args['default'],
|
||||
'show_in_rest' => false,
|
||||
];
|
||||
|
||||
if ($args['type'] === 'array') {
|
||||
$schema['show_in_rest'] = false;
|
||||
$schema['type'] = 'array';
|
||||
}
|
||||
|
||||
register_post_meta($post_type, $key, $schema);
|
||||
}
|
||||
|
||||
// Plate CPT meta registration
|
||||
$plate_meta = [
|
||||
'_aksrt_sort_order' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_icon' => ['type' => 'string', 'default' => ''],
|
||||
'_aksrt_moderators' => ['type' => 'array', 'default' => []],
|
||||
'_aksrt_moderator_roles' => ['type' => 'array', 'default' => []],
|
||||
'_aksrt_posts_count' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_reply_count' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_today_reply_count' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_plate_views' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_follow_count' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_last_reply' => ['type' => 'string', 'default' => ''],
|
||||
'_aksrt_last_post' => ['type' => 'string', 'default' => ''],
|
||||
'_aksrt_allow_view' => ['type' => 'string', 'default' => 'public'],
|
||||
'_aksrt_add_limit' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_follow_pay' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_follow_pay_modo' => ['type' => 'string', 'default' => 'money'],
|
||||
'_aksrt_follow_pay_price' => ['type' => 'number', 'default' => 0],
|
||||
'_aksrt_follow_pay_points' => ['type' => 'integer', 'default' => 0],
|
||||
'_aksrt_follow_pay_vip_price' => ['type' => 'number', 'default' => 0], // legacy read fallback → vip1
|
||||
'_aksrt_follow_pay_vip1_price' => ['type' => 'number', 'default' => 0],
|
||||
'_aksrt_follow_pay_vip2_price' => ['type' => 'number', 'default' => 0],
|
||||
'_aksrt_follow_pay_coupon_s' => ['type' => 'integer', 'default' => 0],
|
||||
];
|
||||
|
||||
foreach ($plate_meta as $key => $args) {
|
||||
register_post_meta('aksrt_forum_plate', $key, [
|
||||
'type' => $args['type'] === 'array' ? 'array' : $args['type'],
|
||||
'description' => $key,
|
||||
'single' => true,
|
||||
'default' => $args['default'],
|
||||
'show_in_rest' => false,
|
||||
]);
|
||||
}
|
||||
}
|
||||
add_action('init', 'aksrt_register_forum_topic_meta');
|
||||
|
||||
// Include forum topics in frontend search results (§7.10).
|
||||
add_action('pre_get_posts', function ($query) {
|
||||
if (!is_admin() && $query->is_main_query() && $query->is_search()) {
|
||||
$post_types = $query->get('post_type');
|
||||
if (empty($post_types) || $post_types === 'post') {
|
||||
$query->set('post_type', ['post', 'page', 'aksrt_forum_topic']);
|
||||
} elseif (is_array($post_types) && !in_array('aksrt_forum_topic', $post_types, true)) {
|
||||
$post_types[] = 'aksrt_forum_topic';
|
||||
$query->set('post_type', $post_types);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// ============================================================␍
|
||||
@@ -47,8 +47,6 @@ if (!function_exists('aksrt_credits_label')) {
|
||||
'download' => __('下载消费', 'aksrt'),
|
||||
'admin' => __('管理员调整', 'aksrt'),
|
||||
'refund' => __('退款', 'aksrt'),
|
||||
'forum_topic' => __('论坛发帖', 'aksrt'),
|
||||
'forum_reply' => __('论坛回复', 'aksrt'),
|
||||
'free_sign_up' => __('注册奖励', 'aksrt'),
|
||||
'free_sign_in' => __('每日签到', 'aksrt'),
|
||||
'free_login' => __('每日登录', 'aksrt'),
|
||||
@@ -58,13 +56,6 @@ if (!function_exists('aksrt_credits_label')) {
|
||||
'free_post_favorite'=> __('文章被收藏', 'aksrt'),
|
||||
'free_comment_new'=> __('发表评论', 'aksrt'),
|
||||
'free_comment_like'=> __('评论被赞', 'aksrt'),
|
||||
'free_bbs_posts_new'=> __('论坛发帖', 'aksrt'),
|
||||
'free_bbs_reply'=> __('论坛回复', 'aksrt'),
|
||||
'free_bbs_essence'=> __('帖子加精', 'aksrt'),
|
||||
'free_bbs_adopt'=> __('回复被采纳', 'aksrt'),
|
||||
'free_bbs_posts_hot'=> __('热帖奖励', 'aksrt'),
|
||||
'free_bbs_comment_hot'=> __('神评奖励', 'aksrt'),
|
||||
'free_bbs_score_extra'=> __('帖子加分', 'aksrt'),
|
||||
];
|
||||
if (isset($map[$reason])) {
|
||||
return $map[$reason];
|
||||
|
||||
@@ -1,363 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Shared forum widget renderers (zibll BBS posts/plate mini parity).
|
||||
*
|
||||
* Used by WidgetForumTopicLists, WidgetForumTabTopics, WidgetForumPlateLists,
|
||||
* WidgetForumBoardList, WidgetForumPlateModerator.
|
||||
*
|
||||
* @package AKSRT
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if (!function_exists('aksrt_forum_topic_meta_flags')) :
|
||||
/**
|
||||
* @return array{topping:bool,essence:bool,views:int,replies:int,plate_id:int}
|
||||
*/
|
||||
function aksrt_forum_topic_meta_flags(int $post_id): array {
|
||||
return [
|
||||
'topping' => (string) get_post_meta($post_id, '_aksrt_topping', true) === '1'
|
||||
|| (string) get_post_meta($post_id, '_aksrt_is_top', true) === '1',
|
||||
'essence' => (string) get_post_meta($post_id, '_aksrt_essence', true) === '1',
|
||||
'views' => (int) get_post_meta($post_id, '_aksrt_views', true),
|
||||
'replies' => (int) get_comments_number($post_id),
|
||||
'plate_id' => (int) get_post_meta($post_id, '_aksrt_plate_id', true),
|
||||
];
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_forum_topic_badges_html')) :
|
||||
/**
|
||||
* Topping / essence badges for forum topic rows.
|
||||
*/
|
||||
function aksrt_forum_topic_badges_html(int $post_id, bool $show_topping = true): string {
|
||||
$flags = aksrt_forum_topic_meta_flags($post_id);
|
||||
$html = '';
|
||||
if ($show_topping && !empty($flags['topping'])) {
|
||||
$html .= '<badge class="img-badge left jb-red"><i>' . esc_html__('置顶', 'aksrt') . '</i></badge>';
|
||||
}
|
||||
if (!empty($flags['essence'])) {
|
||||
$html .= '<badge class="img-badge right jb-yellow"><i>' . esc_html__('精华', 'aksrt') . '</i></badge>';
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_render_forum_topic_mini')) :
|
||||
/**
|
||||
* Mini forum topic row (zibll zib_bbs_get_posts_mini_list parity).
|
||||
*
|
||||
* @param int|null $post_id Null = current post in loop.
|
||||
* @param string $class Extra classes on outer element.
|
||||
* @param bool $show_topping Whether to show topping badge.
|
||||
*/
|
||||
function aksrt_render_forum_topic_mini(?int $post_id = null, string $class = 'ajax-item', bool $show_topping = true): string {
|
||||
$post_id = $post_id ?: (int) get_the_ID();
|
||||
if ($post_id <= 0) {
|
||||
return '';
|
||||
}
|
||||
$post = get_post($post_id);
|
||||
if (!$post || $post->post_status !== 'publish') {
|
||||
return '';
|
||||
}
|
||||
|
||||
$author_id = (int) $post->post_author;
|
||||
$flags = aksrt_forum_topic_meta_flags($post_id);
|
||||
$permalink = get_permalink($post_id);
|
||||
$title = get_the_title($post_id);
|
||||
|
||||
$avatar_url = function_exists('aksrt_get_avatar_url')
|
||||
? aksrt_get_avatar_url($author_id, ['size' => 48])
|
||||
: get_avatar_url($author_id, ['size' => 48]);
|
||||
$home = function_exists('aksrt_get_user_home_url')
|
||||
? aksrt_get_user_home_url($author_id)
|
||||
: get_author_posts_url($author_id);
|
||||
|
||||
$name = function_exists('aksrt_get_user_name')
|
||||
? aksrt_get_user_name([
|
||||
'id' => $author_id,
|
||||
'class' => 'flex ac flex1',
|
||||
'follow' => false,
|
||||
'medal' => false,
|
||||
'level' => false,
|
||||
])
|
||||
: '<a href="' . esc_url($home) . '">' . esc_html(get_the_author_meta('display_name', $author_id)) . '</a>';
|
||||
|
||||
// Prefer last reply time when available.
|
||||
$time_raw = (string) get_post_meta($post_id, '_aksrt_last_reply_time', true);
|
||||
if ($time_raw === '' || !strtotime($time_raw)) {
|
||||
$time_raw = (string) $post->post_date;
|
||||
}
|
||||
$time_txt = function_exists('aksrt_time_ago')
|
||||
? aksrt_time_ago($time_raw)
|
||||
: human_time_diff(strtotime($time_raw), current_time('timestamp')) . __('前', 'aksrt');
|
||||
|
||||
$views_txt = function_exists('aksrt_format_number')
|
||||
? aksrt_format_number($flags['views'])
|
||||
: (string) $flags['views'];
|
||||
|
||||
$cls = trim('forum-posts mini aksrt-ftopic-mini relative ' . $class);
|
||||
$html = '<posts class="' . esc_attr($cls) . '">';
|
||||
$html .= aksrt_forum_topic_badges_html($post_id, $show_topping);
|
||||
$html .= '<div class="forum-posts-header flex ac">';
|
||||
$html .= '<a class="avatar-img mr6" href="' . esc_url($home) . '"><img class="avatar aksrt-lazy lazyload" data-src="' . esc_url($avatar_url) . '" src="' . esc_url(get_template_directory_uri() . '/assets/img/placeholder.svg') . '" alt="" loading="lazy" width="28" height="28" /></a>';
|
||||
$html .= '<div class="flex1 min-w0">';
|
||||
$html .= '<div class="forum-title text-ellipsis"><a class="icon-circle" href="' . esc_url($permalink) . '">' . esc_html($title) . '</a></div>';
|
||||
$html .= '<div class="item-meta em09 muted-2-color flex ac flex-wrap">';
|
||||
$html .= '<span class="forum-user-name">' . $name . '</span>';
|
||||
$html .= '<span class="ml6">' . esc_html($time_txt) . '</span>';
|
||||
$html .= '<span class="ml6"><i class="fa fa-eye" aria-hidden="true"></i> ' . esc_html((string) $views_txt) . '</span>';
|
||||
if ($flags['replies'] > 0) {
|
||||
$html .= '<span class="ml6"><i class="fa fa-comment-o" aria-hidden="true"></i> ' . esc_html((string) $flags['replies']) . '</span>';
|
||||
}
|
||||
$html .= '</div></div></div></posts>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_render_forum_topic_detail')) :
|
||||
/**
|
||||
* Detail forum topic row (richer entry meta).
|
||||
*
|
||||
* @param int|null $post_id
|
||||
* @param string $class
|
||||
* @param bool $show_topping
|
||||
*/
|
||||
function aksrt_render_forum_topic_detail(?int $post_id = null, string $class = 'ajax-item', bool $show_topping = true): string {
|
||||
$post_id = $post_id ?: (int) get_the_ID();
|
||||
if ($post_id <= 0) {
|
||||
return '';
|
||||
}
|
||||
$post = get_post($post_id);
|
||||
if (!$post || $post->post_status !== 'publish') {
|
||||
return '';
|
||||
}
|
||||
|
||||
$author_id = (int) $post->post_author;
|
||||
$flags = aksrt_forum_topic_meta_flags($post_id);
|
||||
$permalink = get_permalink($post_id);
|
||||
$title = get_the_title($post_id);
|
||||
$excerpt = wp_trim_words(wp_strip_all_tags((string) $post->post_content), 36, '…');
|
||||
|
||||
$avatar_url = function_exists('aksrt_get_avatar_url')
|
||||
? aksrt_get_avatar_url($author_id, ['size' => 64])
|
||||
: get_avatar_url($author_id, ['size' => 64]);
|
||||
$home = function_exists('aksrt_get_user_home_url')
|
||||
? aksrt_get_user_home_url($author_id)
|
||||
: get_author_posts_url($author_id);
|
||||
|
||||
$name = function_exists('aksrt_get_user_name')
|
||||
? aksrt_get_user_name([
|
||||
'id' => $author_id,
|
||||
'class' => 'flex ac',
|
||||
'follow' => false,
|
||||
'medal' => true,
|
||||
'level' => true,
|
||||
])
|
||||
: '<a href="' . esc_url($home) . '">' . esc_html(get_the_author_meta('display_name', $author_id)) . '</a>';
|
||||
|
||||
$time_raw = (string) get_post_meta($post_id, '_aksrt_last_reply_time', true);
|
||||
if ($time_raw === '' || !strtotime($time_raw)) {
|
||||
$time_raw = (string) $post->post_date;
|
||||
}
|
||||
$time_txt = function_exists('aksrt_time_ago')
|
||||
? aksrt_time_ago($time_raw)
|
||||
: human_time_diff(strtotime($time_raw), current_time('timestamp')) . __('前', 'aksrt');
|
||||
|
||||
$views_txt = function_exists('aksrt_format_number')
|
||||
? aksrt_format_number($flags['views'])
|
||||
: (string) $flags['views'];
|
||||
|
||||
// Optional plate name chip.
|
||||
$plate_chip = '';
|
||||
if ($flags['plate_id'] > 0) {
|
||||
$plate = get_post($flags['plate_id']);
|
||||
if ($plate instanceof WP_Post) {
|
||||
$plate_chip = '<a class="but p2-10 em09 mr6" href="' . esc_url(get_permalink($plate)) . '">' . esc_html(get_the_title($plate)) . '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
$cls = trim('forum-posts detail aksrt-ftopic-detail relative ' . $class);
|
||||
$html = '<posts class="' . esc_attr($cls) . '">';
|
||||
$html .= aksrt_forum_topic_badges_html($post_id, $show_topping);
|
||||
$html .= '<div class="forum-posts-header flex ac">';
|
||||
$html .= '<a class="avatar-img mr10" href="' . esc_url($home) . '"><img class="avatar aksrt-lazy lazyload" data-src="' . esc_url($avatar_url) . '" src="' . esc_url(get_template_directory_uri() . '/assets/img/placeholder.svg') . '" alt="" loading="lazy" width="40" height="40" /></a>';
|
||||
$html .= '<div class="flex1 min-w0">' . $name . '<div class="em09 muted-2-color mt3">' . esc_html($time_txt) . '</div></div>';
|
||||
$html .= '</div>';
|
||||
$html .= '<h2 class="forum-title mt10"><a href="' . esc_url($permalink) . '">' . esc_html($title) . '</a></h2>';
|
||||
if ($excerpt !== '') {
|
||||
$html .= '<div class="forum-excerpt muted-2-color em09 mt6">' . esc_html($excerpt) . '</div>';
|
||||
}
|
||||
$html .= '<div class="item-meta flex ac flex-wrap mt10 em09 muted-2-color">';
|
||||
$html .= $plate_chip;
|
||||
$html .= '<span class="mr10"><i class="fa fa-eye" aria-hidden="true"></i> ' . esc_html((string) $views_txt) . '</span>';
|
||||
$html .= '<span class="mr10"><i class="fa fa-comment-o" aria-hidden="true"></i> ' . esc_html((string) $flags['replies']) . '</span>';
|
||||
$html .= '</div></posts>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_render_plate_thumb_html')) :
|
||||
/**
|
||||
* Shared plate thumb with lazy pattern.
|
||||
*/
|
||||
function aksrt_render_plate_thumb_html(int $plate_id, string $size = 'thumbnail'): string {
|
||||
$thumb = get_the_post_thumbnail_url($plate_id, $size);
|
||||
$icon = (string) get_post_meta($plate_id, '_aksrt_icon', true);
|
||||
$ph = get_template_directory_uri() . '/assets/img/placeholder.svg';
|
||||
if ($thumb) {
|
||||
return '<span class="plate-thumb aksrt-plate-item__thumb"><img class="aksrt-lazy lazyload fit-cover" data-src="' . esc_url($thumb) . '" src="' . esc_url($ph) . '" alt="" loading="lazy" width="48" height="48" /></span>';
|
||||
}
|
||||
if ($icon !== '') {
|
||||
return '<span class="plate-thumb aksrt-plate-item__thumb is-icon"><i class="' . esc_attr($icon) . '" aria-hidden="true"></i></span>';
|
||||
}
|
||||
return '<span class="plate-thumb aksrt-plate-item__thumb is-empty"><i class="fa fa-comments" aria-hidden="true"></i></span>';
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_render_plate_row')) :
|
||||
/**
|
||||
* Plate list row (zibll plate-item flex).
|
||||
*
|
||||
* @param WP_Post|int $plate
|
||||
*/
|
||||
function aksrt_render_plate_row($plate): string {
|
||||
$post = $plate instanceof WP_Post ? $plate : get_post((int) $plate);
|
||||
if (!$post instanceof WP_Post) {
|
||||
return '';
|
||||
}
|
||||
$id = (int) $post->ID;
|
||||
$url = get_permalink($id);
|
||||
$count = (int) get_post_meta($id, '_aksrt_posts_count', true);
|
||||
$follow = (int) get_post_meta($id, '_aksrt_follow_count', true);
|
||||
$desc = $post->post_excerpt !== '' ? $post->post_excerpt : wp_trim_words(wp_strip_all_tags((string) $post->post_content), 18);
|
||||
|
||||
$html = '<a class="plate-item flex aksrt-plate-item ajax-item" href="' . esc_url($url) . '">';
|
||||
$html .= aksrt_render_plate_thumb_html($id, 'thumbnail');
|
||||
$html .= '<div class="item-info flex1 aksrt-plate-item__body">';
|
||||
$html .= '<div class="info-header"><h2 class="forum-title aksrt-plate-item__title">' . esc_html(get_the_title($post)) . '</h2></div>';
|
||||
if ($desc !== '') {
|
||||
$html .= '<div class="muted-2-color em09 mt3 text-ellipsis aksrt-plate-item__desc">' . esc_html($desc) . '</div>';
|
||||
}
|
||||
$html .= '<div class="item-meta em09 muted-2-color mt3 aksrt-plate-item__meta">';
|
||||
$html .= '<span>' . esc_html(sprintf(/* translators: %d topic count */ __('%d 帖', 'aksrt'), $count)) . '</span>';
|
||||
if ($follow > 0) {
|
||||
$html .= '<span class="ml10">' . esc_html(sprintf(/* translators: %d follow count */ __('%d 关注', 'aksrt'), $follow)) . '</span>';
|
||||
}
|
||||
$html .= '</div></div></a>';
|
||||
return $html;
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_render_plate_card')) :
|
||||
/**
|
||||
* Plate card slide item.
|
||||
*
|
||||
* @param WP_Post|int $plate
|
||||
*/
|
||||
function aksrt_render_plate_card($plate): string {
|
||||
$post = $plate instanceof WP_Post ? $plate : get_post((int) $plate);
|
||||
if (!$post instanceof WP_Post) {
|
||||
return '';
|
||||
}
|
||||
$id = (int) $post->ID;
|
||||
$url = get_permalink($id);
|
||||
$thumb = get_the_post_thumbnail_url($id, 'medium');
|
||||
$count = (int) get_post_meta($id, '_aksrt_posts_count', true);
|
||||
$follow = (int) get_post_meta($id, '_aksrt_follow_count', true);
|
||||
$ph = get_template_directory_uri() . '/assets/img/placeholder.svg';
|
||||
|
||||
$html = '<a class="plate-card aksrt-plate-card ajax-item" href="' . esc_url($url) . '">';
|
||||
$html .= '<div class="plate-thumb aksrt-plate-card__cover">';
|
||||
if ($thumb) {
|
||||
$html .= '<img class="aksrt-lazy lazyload fit-cover" data-src="' . esc_url($thumb) . '" src="' . esc_url($ph) . '" alt="" loading="lazy" />';
|
||||
} else {
|
||||
$html .= '<span class="is-empty"><i class="fa fa-comments" aria-hidden="true"></i></span>';
|
||||
}
|
||||
$html .= '</div>';
|
||||
$html .= '<div class="aksrt-plate-card__title forum-title mt10">' . esc_html(get_the_title($post)) . '</div>';
|
||||
$html .= '<div class="aksrt-plate-card__meta muted-2-color em09 mt6">';
|
||||
$html .= '<span>' . esc_html(sprintf(__('%d 帖', 'aksrt'), $count)) . '</span>';
|
||||
$html .= '<span class="ml10">' . esc_html(sprintf(__('%d 关注', 'aksrt'), $follow)) . '</span>';
|
||||
$html .= '</div></a>';
|
||||
return $html;
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_render_moderator_row')) :
|
||||
/**
|
||||
* Moderator identity row with optional follow.
|
||||
*
|
||||
* @param int $user_id
|
||||
* @param string $role author|super|moderator
|
||||
* @param bool $show_avatar
|
||||
* @param string $style list|grid
|
||||
*/
|
||||
function aksrt_render_moderator_row(int $user_id, string $role = 'moderator', bool $show_avatar = true, string $style = 'list'): string {
|
||||
if ($user_id <= 0) {
|
||||
return '';
|
||||
}
|
||||
$user = get_userdata($user_id);
|
||||
if (!$user) {
|
||||
return '';
|
||||
}
|
||||
$avatar = function_exists('aksrt_get_avatar_url')
|
||||
? aksrt_get_avatar_url($user_id, ['size' => 64])
|
||||
: get_avatar_url($user_id, ['size' => 64]);
|
||||
$home = function_exists('aksrt_get_user_home_url')
|
||||
? aksrt_get_user_home_url($user_id)
|
||||
: get_author_posts_url($user_id);
|
||||
$ph = get_template_directory_uri() . '/assets/img/placeholder.svg';
|
||||
|
||||
if ($role === 'author' || $role === 'super') {
|
||||
$role_label = __('超级版主', 'aksrt');
|
||||
} else {
|
||||
$role_label = __('版主', 'aksrt');
|
||||
}
|
||||
|
||||
$name = function_exists('aksrt_get_user_name')
|
||||
? aksrt_get_user_name([
|
||||
'id' => $user_id,
|
||||
'class' => 'flex ac flex1',
|
||||
'follow' => false,
|
||||
'medal' => true,
|
||||
'level' => true,
|
||||
])
|
||||
: '<a href="' . esc_url($home) . '">' . esc_html($user->display_name) . '</a>';
|
||||
|
||||
// Follow control (not for self).
|
||||
$follow_html = '';
|
||||
$cuid = get_current_user_id();
|
||||
if ($cuid > 0 && $cuid !== $user_id && class_exists('\AKSRT\User\Follow')) {
|
||||
$following = \AKSRT\User\Follow::get_instance()->is_following($cuid, $user_id);
|
||||
$label = $following ? __('已关注', 'aksrt') : __('关注', 'aksrt');
|
||||
$follow_html = '<button type="button" class="but hollow c-blue p2-10 em09 ml10 flex0' . ($following ? ' is-following' : '') . '" data-aksrt-follow="' . (int) $user_id . '">' . esc_html($label) . '</button>';
|
||||
}
|
||||
|
||||
if ($style === 'grid') {
|
||||
$html = '<div class="aksrt-plate-mods__item role-' . esc_attr($role) . ' is-grid">';
|
||||
if ($show_avatar) {
|
||||
$html .= '<a href="' . esc_url($home) . '"><img class="aksrt-plate-mods__avatar aksrt-lazy lazyload" data-src="' . esc_url($avatar) . '" src="' . esc_url($ph) . '" alt="" loading="lazy" width="48" height="48" /></a>';
|
||||
}
|
||||
$html .= '<div class="aksrt-plate-mods__name">' . $name . '</div>';
|
||||
$html .= '<div class="aksrt-plate-mods__role muted-2-color em09">' . esc_html($role_label) . '</div>';
|
||||
$html .= $follow_html;
|
||||
$html .= '</div>';
|
||||
return $html;
|
||||
}
|
||||
|
||||
$html = '<div class="aksrt-plate-mods__item role-' . esc_attr($role) . ' flex ac">';
|
||||
if ($show_avatar) {
|
||||
$html .= '<a class="avatar-img mr10" href="' . esc_url($home) . '"><img class="aksrt-plate-mods__avatar aksrt-lazy lazyload" data-src="' . esc_url($avatar) . '" src="' . esc_url($ph) . '" alt="" loading="lazy" width="40" height="40" /></a>';
|
||||
}
|
||||
$html .= '<div class="flex1 min-w0">';
|
||||
$html .= '<div class="aksrt-plate-mods__name">' . $name . '</div>';
|
||||
$html .= '<div class="aksrt-plate-mods__role muted-2-color em09">' . esc_html($role_label) . '</div>';
|
||||
$html .= '</div>';
|
||||
$html .= $follow_html;
|
||||
$html .= '</div>';
|
||||
return $html;
|
||||
}
|
||||
endif;
|
||||
@@ -1,8 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* Forum frontend URL helpers.
|
||||
* Generic page-template URL helpers.
|
||||
*
|
||||
* Page-template assignment is the source of truth for forum home / compose URLs.
|
||||
* Page-template assignment is the source of truth for resolving public URLs
|
||||
* for custom page templates (submit form, etc.).
|
||||
*
|
||||
* @package AKSRT
|
||||
*/
|
||||
@@ -13,7 +14,7 @@ if (!function_exists('aksrt_get_page_url_by_template')) :
|
||||
/**
|
||||
* Resolve the first published page that uses a given page template file.
|
||||
*
|
||||
* @param string $template_file Relative theme template path (e.g. templates/pages/page-forums.php).
|
||||
* @param string $template_file Relative theme template path (e.g. templates/pages/page-submit.php).
|
||||
*/
|
||||
function aksrt_get_page_url_by_template(string $template_file): string {
|
||||
$template_file = ltrim(str_replace('\\', '/', $template_file), '/');
|
||||
@@ -51,48 +52,3 @@ if (!function_exists('aksrt_get_page_url_by_template')) :
|
||||
return $url;
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_get_forum_home_url')) :
|
||||
/**
|
||||
* Public forum home URL (page template AKSRT - 论坛).
|
||||
*/
|
||||
function aksrt_get_forum_home_url(): string {
|
||||
$url = aksrt_get_page_url_by_template('templates/pages/page-forums.php');
|
||||
return $url !== '' ? $url : home_url('/');
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_get_forum_compose_url')) :
|
||||
/**
|
||||
* Public forum compose URL (page template AKSRT - 发帖).
|
||||
*
|
||||
* @param array<string, scalar> $args Optional query args (board, plate, …).
|
||||
*/
|
||||
function aksrt_get_forum_compose_url(array $args = []): string {
|
||||
$url = aksrt_get_page_url_by_template('templates/forum/forum-compose.php');
|
||||
if ($url === '') {
|
||||
$url = home_url('/');
|
||||
}
|
||||
|
||||
// Normalize plate → board for compose form contract.
|
||||
if (isset($args['plate']) && !isset($args['board'])) {
|
||||
$args['board'] = $args['plate'];
|
||||
unset($args['plate']);
|
||||
}
|
||||
|
||||
$clean = [];
|
||||
foreach ($args as $key => $value) {
|
||||
$key = sanitize_key((string) $key);
|
||||
if ($key === '') {
|
||||
continue;
|
||||
}
|
||||
if (is_bool($value)) {
|
||||
$clean[$key] = $value ? '1' : '0';
|
||||
} else {
|
||||
$clean[$key] = (string) $value;
|
||||
}
|
||||
}
|
||||
|
||||
return !empty($clean) ? add_query_arg($clean, $url) : $url;
|
||||
}
|
||||
endif;
|
||||
@@ -21,17 +21,6 @@ if (!function_exists('aksrt_get_header_newposts_config')) :
|
||||
$types = is_array($cfg['types'] ?? null) ? $cfg['types'] : [];
|
||||
if (!$types) {
|
||||
$types = ['post'];
|
||||
if (class_exists('\AKSRT\Settings\Settings')) {
|
||||
$forum = \AKSRT\Settings\Settings::get_forum_settings();
|
||||
$shop = \AKSRT\Settings\Settings::get_shop_settings();
|
||||
if (!empty($forum['enabled'])) {
|
||||
$types[] = 'topic';
|
||||
$types[] = 'plate';
|
||||
}
|
||||
if (!empty($shop['enabled'])) {
|
||||
$types[] = 'product';
|
||||
}
|
||||
}
|
||||
}
|
||||
$cfg['types'] = $types;
|
||||
if (empty($cfg['class'])) {
|
||||
@@ -65,53 +54,6 @@ if (!function_exists('aksrt_get_new_add_actions')) :
|
||||
'label' => __('写文章', 'aksrt'),
|
||||
'icon' => 'fas fa-file-alt',
|
||||
];
|
||||
} elseif ($type === 'topic') {
|
||||
$url = function_exists('aksrt_get_forum_compose_url') ? aksrt_get_forum_compose_url() : '';
|
||||
if ($url === '') {
|
||||
continue;
|
||||
}
|
||||
$out[] = [
|
||||
'type' => 'topic',
|
||||
'url' => $url,
|
||||
'label' => __('发帖', 'aksrt'),
|
||||
'icon' => 'fas fa-comments',
|
||||
];
|
||||
} elseif ($type === 'product') {
|
||||
$url = '';
|
||||
if (function_exists('aksrt_get_product_edit_url')) {
|
||||
$url = (string) aksrt_get_product_edit_url();
|
||||
}
|
||||
if ($url === '') {
|
||||
$url = admin_url('post-new.php?post_type=aksrt_product');
|
||||
}
|
||||
$out[] = [
|
||||
'type' => 'product',
|
||||
'url' => $url,
|
||||
'label' => __('发布商品', 'aksrt'),
|
||||
'icon' => 'fas fa-shopping-bag',
|
||||
];
|
||||
} elseif ($type === 'plate') {
|
||||
// zibll bbs_plate → AKSRT forum plate CPT (admin create for entitled users).
|
||||
$can = current_user_can('manage_options');
|
||||
if (!$can && class_exists('\AKSRT\Forum\Forum')) {
|
||||
try {
|
||||
$forum = \AKSRT\Forum\Forum::get_instance();
|
||||
if (method_exists($forum, 'forum_user_can')) {
|
||||
$can = (bool) $forum->forum_user_can(get_current_user_id(), 'plate_create');
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
$can = false;
|
||||
}
|
||||
}
|
||||
if (!$can || !post_type_exists('aksrt_forum_plate')) {
|
||||
continue;
|
||||
}
|
||||
$out[] = [
|
||||
'type' => 'plate',
|
||||
'url' => admin_url('post-new.php?post_type=aksrt_forum_plate'),
|
||||
'label' => __('创建版块', 'aksrt'),
|
||||
'icon' => 'fas fa-th-large',
|
||||
];
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
|
||||
@@ -356,26 +356,7 @@ if (!function_exists('aksrt_content_order_cookie_token_key')) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether guest cash purchase is allowed for forum topic / plate follow.
|
||||
* Reuses global pay_no_logged_in (same switch as content).
|
||||
*
|
||||
* @param WP_Post|int|null $post Topic or plate post (optional filter context).
|
||||
*/
|
||||
if (!function_exists('aksrt_allow_guest_forum_pay')) {
|
||||
function aksrt_allow_guest_forum_pay($post = null): bool {
|
||||
$order = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_order_settings() : [];
|
||||
$paid = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_paid_content_settings() : [];
|
||||
$allow = !empty($order['no_logged_in']) || !empty($paid['no_logged_in']);
|
||||
/**
|
||||
* @param bool $allow
|
||||
* @param WP_Post|int|null $post
|
||||
*/
|
||||
return (bool) apply_filters('aksrt_allow_guest_forum_pay', $allow, $post);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set guest paid cookies after cash order paid (content / topic / plate_follow).
|
||||
* Set guest paid cookies after cash order paid (content).
|
||||
*
|
||||
* @param array<string,mixed> $order
|
||||
*/
|
||||
@@ -495,18 +476,6 @@ if (!function_exists('aksrt_guest_has_paid_access')) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Guest paid plate follow access (cookie).
|
||||
*/
|
||||
if (!function_exists('aksrt_guest_has_plate_follow_access')) {
|
||||
function aksrt_guest_has_plate_follow_access(int $plate_id): bool {
|
||||
$type = class_exists('\AKSRT\Core\DomainModel')
|
||||
? \AKSRT\Core\DomainModel::ORDER_PRODUCT_PLATE_FOLLOW
|
||||
: 'plate_follow';
|
||||
return null !== aksrt_get_guest_paid_order($plate_id, $type);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the amount a given user should pay for a post (Zibll VIP tier min).
|
||||
*
|
||||
|
||||
@@ -7,51 +7,6 @@
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if (!function_exists('aksrt_get_float_shop_cart_html')) :
|
||||
/**
|
||||
* Floating shop cart button with badge.
|
||||
*/
|
||||
function aksrt_get_float_shop_cart_html(array $item = []): string {
|
||||
if (!is_user_logged_in()) {
|
||||
return '';
|
||||
}
|
||||
$shop_on = true;
|
||||
if (class_exists('\AKSRT\Settings\Settings')) {
|
||||
$shop = \AKSRT\Settings\Settings::get_shop_settings();
|
||||
$shop_on = !empty($shop['enabled']);
|
||||
}
|
||||
if (!$shop_on) {
|
||||
return '';
|
||||
}
|
||||
// Skip on cart page.
|
||||
if (function_exists('is_page_template') && is_page_template('templates/pages/page-cart.php')) {
|
||||
return '';
|
||||
}
|
||||
$url = function_exists('aksrt_get_cart_page_url') ? aksrt_get_cart_page_url() : '';
|
||||
if ($url === '') {
|
||||
return '';
|
||||
}
|
||||
$count = 0;
|
||||
if (class_exists('\AKSRT\Shop\Shop')) {
|
||||
$count = (int) \AKSRT\Shop\Shop::get_instance()->get_cart_count(get_current_user_id());
|
||||
}
|
||||
$icon = !empty($item['icon']) ? (string) $item['icon'] : 'fas fa-shopping-cart';
|
||||
$style = [];
|
||||
if (!empty($item['color'])) {
|
||||
$style[] = '--this-color:' . esc_attr((string) $item['color']);
|
||||
}
|
||||
if (!empty($item['bg'])) {
|
||||
$style[] = '--this-bg:' . esc_attr((string) $item['bg']);
|
||||
}
|
||||
$style_attr = $style ? ' style="' . implode(';', $style) . '"' : '';
|
||||
$badge = $count > 0 ? (string) min(99, $count) : '';
|
||||
return '<a class="float-btn float-btn-shop-cart nowave" href="' . esc_url($url) . '" title="' . esc_attr__('购物车', 'aksrt') . '"' . $style_attr . '>'
|
||||
. '<i class="' . esc_attr($icon) . '" aria-hidden="true"></i>'
|
||||
. '<badge cart-count="' . esc_attr($badge) . '">' . esc_html($badge) . '</badge>'
|
||||
. '</a>';
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_get_float_pay_vip_html')) :
|
||||
/**
|
||||
* Floating VIP open button.
|
||||
|
||||
@@ -485,18 +485,8 @@ if (!function_exists('aksrt_get_user_center_render_context')) {
|
||||
$wallet_balance = (float) ($dashboard['wallet_balance'] ?? 0.0);
|
||||
$runtime_config = aksrt_user_center_runtime_config($user_id, $tabs['default'], $active_tab, $tabs['urls']);
|
||||
$runtime_config['avatarUpload'] = aksrt_user_center_avatar_upload_config($allow_avatar_upload);
|
||||
$shop_settings = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_shop_settings() : [];
|
||||
$forum_settings = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_forum_settings() : [];
|
||||
$revenue_settings = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_payment_revenue_settings() : [];
|
||||
$shop_enabled = !empty($shop_settings['enabled']);
|
||||
$forum_enabled = !empty($forum_settings['enabled']);
|
||||
$new_post_url = function_exists('aksrt_get_new_post_url') ? aksrt_get_new_post_url() : '';
|
||||
$new_product_url = $shop_enabled && function_exists('aksrt_get_page_url_by_template')
|
||||
? aksrt_get_page_url_by_template('templates/pages/page-product-edit.php')
|
||||
: '';
|
||||
$forum_compose_url = $forum_enabled && function_exists('aksrt_get_page_url_by_template')
|
||||
? aksrt_get_page_url_by_template('templates/forum/forum-compose.php')
|
||||
: '';
|
||||
$revenue_url = (!empty($revenue_settings['enabled']) || !empty($affiliate_settings['enabled'])) && function_exists('aksrt_get_revenue_page_url')
|
||||
? aksrt_get_revenue_page_url()
|
||||
: '';
|
||||
@@ -523,8 +513,6 @@ if (!function_exists('aksrt_get_user_center_render_context')) {
|
||||
'notification_unread_count' => function_exists('aksrt_get_user_unread_notification_count') ? aksrt_get_user_unread_notification_count($user_id) : 0,
|
||||
'messages_url' => $messages_enabled && function_exists('aksrt_get_messages_page_url') ? aksrt_get_messages_page_url() : '',
|
||||
'new_post_url' => $new_post_url,
|
||||
'new_product_url' => $new_product_url,
|
||||
'forum_compose_url' => $forum_compose_url,
|
||||
'revenue_url' => $revenue_url,
|
||||
'per_page' => 10,
|
||||
'posts_page' => max(1, isset($_GET['posts_page']) ? (int) $_GET['posts_page'] : 1),
|
||||
|
||||
@@ -79,52 +79,16 @@ if (!function_exists('aksrt_get_user_home_page_context')) {
|
||||
$display_tabs = $is_mobile ? $enabled_tabs_mobile : $enabled_tabs_pc;
|
||||
$default_tab = !empty($display_tabs) ? $display_tabs[0] : $enabled_tabs[0];
|
||||
|
||||
$forum_instance = class_exists('\AKSRT\Forum\Forum') ? \AKSRT\Forum\Forum::get_instance() : null;
|
||||
$forum_stats = $forum_instance ? $forum_instance->get_user_forum_stats($user_id) : [];
|
||||
$forum_topic_count = (int) ($forum_stats['topic_count'] ?? 0);
|
||||
$product_count = 0;
|
||||
if (class_exists('\AKSRT\Shop\Shop')) {
|
||||
$product_count = (int) \AKSRT\Shop\Shop::get_instance()->count_author_products($user_id);
|
||||
}
|
||||
|
||||
$follow_count = 0;
|
||||
if (class_exists('\AKSRT\User\Follow')) {
|
||||
$follow_count = (int) \AKSRT\User\Follow::get_instance()->get_follower_count($user_id);
|
||||
}
|
||||
|
||||
$plate_count = 0;
|
||||
if ($forum_instance) {
|
||||
$seen_plates = [];
|
||||
if (method_exists($forum_instance, 'get_user_followed_plates')) {
|
||||
foreach ((array) $forum_instance->get_user_followed_plates($user_id) as $plate) {
|
||||
$pid = (int) ($plate['id'] ?? 0);
|
||||
if ($pid > 0) {
|
||||
$seen_plates[$pid] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (method_exists($forum_instance, 'get_user_managed_plates')) {
|
||||
$managed = (array) $forum_instance->get_user_managed_plates($user_id);
|
||||
foreach (['owned', 'moderating'] as $bucket) {
|
||||
foreach ((array) ($managed[$bucket] ?? []) as $plate) {
|
||||
$pid = (int) ($plate['id'] ?? 0);
|
||||
if ($pid > 0) {
|
||||
$seen_plates[$pid] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$plate_count = count($seen_plates);
|
||||
}
|
||||
|
||||
$tab_counts = [
|
||||
'posts' => $post_count,
|
||||
'comments' => $comment_count,
|
||||
'favorites' => $favorite_count,
|
||||
'credits' => $credits_enabled && $is_own_profile ? (int) round((float) $credit_balance) : 0,
|
||||
'product' => $product_count,
|
||||
'plate' => $plate_count,
|
||||
'forum' => $forum_topic_count,
|
||||
'follow' => $follow_count,
|
||||
];
|
||||
|
||||
@@ -133,9 +97,6 @@ if (!function_exists('aksrt_get_user_home_page_context')) {
|
||||
'comments' => __('评论', 'aksrt'),
|
||||
'favorites' => __('收藏', 'aksrt'),
|
||||
'credits' => sprintf(__('我的%s', 'aksrt'), $currency_name),
|
||||
'product' => __('商品', 'aksrt'),
|
||||
'plate' => __('圈子', 'aksrt'),
|
||||
'forum' => __('论坛', 'aksrt'),
|
||||
'follow' => __('粉丝', 'aksrt'), // Zibll: 粉丝
|
||||
];
|
||||
foreach ($visible_tabs as $tab_key => $tab_config) {
|
||||
@@ -174,9 +135,6 @@ if (!function_exists('aksrt_get_user_home_page_context')) {
|
||||
'active_tab' => $active_tab,
|
||||
'tab_counts' => $tab_counts,
|
||||
'tab_labels' => $tab_labels,
|
||||
'forum_instance' => $forum_instance,
|
||||
'forum_stats' => $forum_stats,
|
||||
'forum_topic_count' => $forum_topic_count,
|
||||
'home_url' => $home_url,
|
||||
'posts_page' => max(1, isset($_GET['posts_page']) ? (int) $_GET['posts_page'] : 1),
|
||||
'comments_page' => max(1, isset($_GET['comments_page']) ? (int) $_GET['comments_page'] : 1),
|
||||
|
||||
@@ -208,19 +208,7 @@ if (!function_exists('aksrt_header_user_box_html')) :
|
||||
if ($pub_text === '') {
|
||||
$pub_text = __('发布内容', 'aksrt');
|
||||
}
|
||||
$pub_type = sanitize_key((string) ($all['header_user_newposts_btn'] ?? 'post'));
|
||||
$pub_url = (string) $ctx['publish_url'];
|
||||
if ($pub_type === 'topic' && function_exists('aksrt_get_forum_compose_url')) {
|
||||
$u = aksrt_get_forum_compose_url();
|
||||
if ($u) { $pub_url = $u; }
|
||||
} elseif ($pub_type === 'product') {
|
||||
if (function_exists('aksrt_get_product_edit_url')) {
|
||||
$u = (string) aksrt_get_product_edit_url();
|
||||
if ($u !== '') { $pub_url = $u; }
|
||||
} else {
|
||||
$pub_url = admin_url('post-new.php?post_type=aksrt_product');
|
||||
}
|
||||
}
|
||||
$href .= '<a rel="nofollow" href="' . esc_url($pub_url) . '">';
|
||||
$href .= '<div class="badg mb6 toggle-radius c-green"><i class="fas fa-pen" aria-hidden="true"></i></div>';
|
||||
$href .= '<div class="c-green">' . esc_html($pub_text) . '</div></a>';
|
||||
@@ -240,13 +228,6 @@ if (!function_exists('aksrt_header_user_box_html')) :
|
||||
$href .= '<a rel="nofollow" target="_blank" href="' . esc_url(admin_url('widgets.php')) . '">';
|
||||
$href .= '<div class="badg mb6 toggle-radius c-yellow"><i class="fas fa-chart-pie" aria-hidden="true"></i></div>';
|
||||
$href .= '<div class="c-yellow">' . esc_html__('模块布局', 'aksrt') . '</div></a>';
|
||||
// zibll: 商城中心.
|
||||
$shop_url = post_type_exists('aksrt_product')
|
||||
? admin_url('edit.php?post_type=aksrt_product')
|
||||
: admin_url('admin.php?page=aksrt_pay');
|
||||
$href .= '<a rel="nofollow" target="_blank" href="' . esc_url($shop_url) . '">';
|
||||
$href .= '<div class="badg mb6 toggle-radius c-yellow"><i class="fas fa-shopping-bag" aria-hidden="true"></i></div>';
|
||||
$href .= '<div class="c-yellow">' . esc_html__('商城中心', 'aksrt') . '</div></a>';
|
||||
$href .= '<a rel="nofollow" target="_blank" href="' . esc_url(admin_url()) . '">';
|
||||
$href .= '<div class="badg mb6 toggle-radius c-yellow"><i class="fas fa-cog" aria-hidden="true"></i></div>';
|
||||
$href .= '<div class="c-yellow">' . esc_html__('后台管理', 'aksrt') . '</div></a>';
|
||||
|
||||
@@ -22,9 +22,6 @@ if (!function_exists('aksrt_header_components_page_type_keys')) {
|
||||
'author',
|
||||
'single',
|
||||
'search',
|
||||
'forum_home',
|
||||
'forum_plate',
|
||||
'forum_post',
|
||||
'page',
|
||||
];
|
||||
}
|
||||
@@ -46,7 +43,6 @@ if (!function_exists('aksrt_header_slide_excluded_page_templates')) {
|
||||
'templates/pages/page-verify-email.php',
|
||||
'templates/pages/page-download.php',
|
||||
'templates/pages/page-download-file.php',
|
||||
'templates/pages/page-forums.php',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -77,18 +73,6 @@ if (!function_exists('aksrt_header_slide_match_page_type')) {
|
||||
return is_tax('topics');
|
||||
}
|
||||
|
||||
if ($type === 'forum_home') {
|
||||
return is_page_template('templates/pages/page-forums.php');
|
||||
}
|
||||
|
||||
if ($type === 'forum_plate') {
|
||||
return is_singular('aksrt_forum_plate') || $post_type === 'aksrt_forum_plate';
|
||||
}
|
||||
|
||||
if ($type === 'forum_post') {
|
||||
return is_singular('aksrt_forum_topic') || $post_type === 'aksrt_forum_topic';
|
||||
}
|
||||
|
||||
// Generic WP_Query is_* flags (home/category/tag/author/single/search/page).
|
||||
$query_flag = 'is_' . $type;
|
||||
if (empty($wp_query->{$query_flag})) {
|
||||
|
||||
@@ -23,22 +23,6 @@ $aksrt_points_task_action = static function (string $key): array {
|
||||
$submit = (string) aksrt_get_page_url_by_template('templates/pages/page-submit.php');
|
||||
}
|
||||
|
||||
$forum_on = false;
|
||||
$forum_home = '';
|
||||
$forum_compose = '';
|
||||
if (class_exists('\AKSRT\Settings\Settings') && method_exists('\AKSRT\Settings\Settings', 'get_forum_settings')) {
|
||||
$f = \AKSRT\Settings\Settings::get_forum_settings();
|
||||
$forum_on = !empty($f['enabled']);
|
||||
}
|
||||
if ($forum_on) {
|
||||
if (function_exists('aksrt_get_forum_home_url')) {
|
||||
$forum_home = (string) aksrt_get_forum_home_url();
|
||||
}
|
||||
if (function_exists('aksrt_get_forum_compose_url')) {
|
||||
$forum_compose = (string) aksrt_get_forum_compose_url();
|
||||
}
|
||||
}
|
||||
|
||||
switch ($key) {
|
||||
case 'sign_in':
|
||||
return [
|
||||
@@ -93,37 +77,10 @@ $aksrt_points_task_action = static function (string $key): array {
|
||||
'label' => __('去主页', 'aksrt'),
|
||||
'href' => $center !== '' ? $center : $home,
|
||||
];
|
||||
case 'bbs_posts_new':
|
||||
case 'bbs_reply':
|
||||
if (!$forum_on) {
|
||||
default:
|
||||
return ['type' => 'none', 'label' => ''];
|
||||
}
|
||||
$href = $forum_compose !== '' ? $forum_compose : $forum_home;
|
||||
if ($href === '') {
|
||||
return ['type' => 'none', 'label' => ''];
|
||||
}
|
||||
return [
|
||||
'type' => 'link',
|
||||
'label' => __('去完成', 'aksrt'),
|
||||
'href' => $href,
|
||||
];
|
||||
case 'bbs_essence':
|
||||
case 'bbs_adopt':
|
||||
case 'bbs_posts_hot':
|
||||
case 'bbs_comment_hot':
|
||||
case 'bbs_score_extra':
|
||||
if (!$forum_on || $forum_home === '') {
|
||||
return ['type' => 'none', 'label' => ''];
|
||||
}
|
||||
return [
|
||||
'type' => 'link',
|
||||
'label' => __('去看看', 'aksrt'),
|
||||
'href' => $forum_home,
|
||||
];
|
||||
default:
|
||||
return ['type' => 'none', 'label' => ''];
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
$user_id = (int) ($user_id ?? get_current_user_id());
|
||||
$today = \AKSRT\Credits\PointsFree::today_total($user_id);
|
||||
|
||||
@@ -16,7 +16,6 @@ add_filter('query_vars', function ($vars) {
|
||||
$vars[] = 'aksrt_user_center';
|
||||
$vars[] = 'user_nicename';
|
||||
$vars[] = 'aksrt_orders';
|
||||
$vars[] = 'aksrt_cart';
|
||||
$vars[] = 'aksrt_revenue';
|
||||
return $vars;
|
||||
});
|
||||
@@ -40,13 +39,11 @@ add_action('init', function () {
|
||||
add_rewrite_tag('%aksrt_user_center%', '([^&]+)');
|
||||
add_rewrite_tag('%user_nicename%', '([^/]+)');
|
||||
add_rewrite_tag('%aksrt_orders%', '([0-1])');
|
||||
add_rewrite_tag('%aksrt_cart%', '([0-1])');
|
||||
add_rewrite_tag('%aksrt_revenue%', '([0-1])');
|
||||
add_rewrite_rule('^profile/?$', 'index.php?aksrt_user_center=1', 'top');
|
||||
add_rewrite_rule('^user/([^/]+)/?$', 'index.php?user_nicename=$matches[1]', 'top');
|
||||
// Commerce center aliases (work even before WP page is assigned).
|
||||
add_rewrite_rule('^orders/?$', 'index.php?aksrt_orders=1', 'top');
|
||||
add_rewrite_rule('^cart/?$', 'index.php?aksrt_cart=1', 'top');
|
||||
add_rewrite_rule('^revenue/?$', 'index.php?aksrt_revenue=1', 'top');
|
||||
});
|
||||
|
||||
|
||||
@@ -137,20 +137,6 @@ $_aksrt_special_templates = [
|
||||
'title' => '发布文章',
|
||||
'fallback' => '/submit/',
|
||||
],
|
||||
'product-edit' => [
|
||||
'file' => 'templates/pages/page-product-edit.php',
|
||||
'slug' => 'product-edit',
|
||||
'title' => '发布商品',
|
||||
'fallback' => '/product-edit/',
|
||||
'auto_create' => false,
|
||||
],
|
||||
'forum-compose' => [
|
||||
'file' => 'templates/forum/forum-compose.php',
|
||||
'slug' => 'forum-compose',
|
||||
'title' => '论坛发帖',
|
||||
'fallback' => '/forum-compose/',
|
||||
'auto_create' => false,
|
||||
],
|
||||
];
|
||||
|
||||
/** @var array 缓存 key=模板文件路径 => value=WP_Post|null */
|
||||
|
||||
@@ -84,17 +84,6 @@ function aksrt_get_orders_page_url(): string {
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_get_cart_page_url')) :
|
||||
/**
|
||||
* 购物车页面 URL(模板 templates/pages/page-cart.php)。
|
||||
*/
|
||||
function aksrt_get_cart_page_url(): string {
|
||||
return function_exists('aksrt_get_template_url')
|
||||
? aksrt_get_template_url('cart')
|
||||
: home_url('/cart/');
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_get_revenue_page_url')) :
|
||||
/**
|
||||
* 收益中心页面 URL(模板 templates/pages/page-revenue.php)。
|
||||
|
||||
@@ -92,36 +92,6 @@ function aksrt_register_widgets() {
|
||||
register_widget('\AKSRT\Widgets\WidgetIconCoverCards');
|
||||
register_widget('\AKSRT\Widgets\WidgetBookmarkLinks');
|
||||
|
||||
|
||||
// Forum widgets
|
||||
if (class_exists('\AKSRT\Widgets\WidgetForumBoardList')) {
|
||||
register_widget('\AKSRT\Widgets\WidgetForumBoardList');
|
||||
}
|
||||
if (class_exists('\AKSRT\Widgets\WidgetForumHotTopics')) {
|
||||
register_widget('\AKSRT\Widgets\WidgetForumHotTopics');
|
||||
}
|
||||
if (class_exists('\AKSRT\Widgets\WidgetForumRecentTopics')) {
|
||||
register_widget('\AKSRT\Widgets\WidgetForumRecentTopics');
|
||||
}
|
||||
if (class_exists('\AKSRT\Widgets\WidgetForumPlateLists')) {
|
||||
register_widget('\AKSRT\Widgets\WidgetForumPlateLists');
|
||||
}
|
||||
if (class_exists('\AKSRT\Widgets\WidgetForumPlateInfo')) {
|
||||
register_widget('\AKSRT\Widgets\WidgetForumPlateInfo');
|
||||
}
|
||||
if (class_exists('\AKSRT\Widgets\WidgetForumPlateModerator')) {
|
||||
register_widget('\AKSRT\Widgets\WidgetForumPlateModerator');
|
||||
}
|
||||
if (class_exists('\AKSRT\Widgets\WidgetForumTopicLists')) {
|
||||
register_widget('\AKSRT\Widgets\WidgetForumTopicLists');
|
||||
}
|
||||
if (class_exists('\AKSRT\Widgets\WidgetForumTopicTerms')) {
|
||||
register_widget('\AKSRT\Widgets\WidgetForumTopicTerms');
|
||||
}
|
||||
if (class_exists('\AKSRT\Widgets\WidgetForumTabTopics')) {
|
||||
register_widget('\AKSRT\Widgets\WidgetForumTabTopics');
|
||||
}
|
||||
|
||||
// Shop product widgets (§6.9)
|
||||
register_widget('\AKSRT\Widgets\WidgetProductList');
|
||||
register_widget('\AKSRT\Widgets\WidgetProductOneline');
|
||||
|
||||
Reference in new issue
Block a user