get_topic_view($topic_id, $current_user_id) : [
'topic' => null,
'board' => null,
'permissions' => [],
'board_options' => [],
'visibility_options' => [],
'review_options' => [],
];
$topic = $view['topic'] ?? null;
$board = $view['board'] ?? null;
$permissions = $view['permissions'] ?? [];
$board_options = $view['board_options'] ?? [];
$visibility_options = $view['visibility_options'] ?? [];
$review_options = $view['review_options'] ?? [];
// Forum settings for names, breadcrumbs, reply
$forum_settings = class_exists('AKSRT_Settings') ? AKSRT_Settings::get_forum_settings() : [];
$forum_names = $forum_settings['names'] ?? [];
$forum_bc = $forum_settings['post_page'] ?? [];
$reply_settings = $forum_settings['reply'] ?? [];
$show_breadcrumbs = $forum_bc['breadcrumbs'] ?? true;
$bc_show_home = $forum_bc['breadcrumbs_bbs_home'] ?? true;
$bc_forum_name = $forum_bc['breadcrumbs_bbs_home_name'] ?: ($forum_names['forum'] ?? __('论坛', 'aksrt'));
$reply_placeholder = $reply_settings['placeholder'] ?? __('写下你的回复…', 'aksrt');
$name_sticky = $forum_names['posts'] ?? __('置顶', 'aksrt');
$name_featured = $forum_names['topic'] ?? __('精华', 'aksrt');
$name_reply = $forum_names['comment'] ?? __('回复', 'aksrt');
if (!$topic) {
get_template_part('templates/parts/content', 'none');
get_footer();
return;
}
if (empty($topic['can_view'])) :
$deny_vis = $topic['visibility']['key'] ?? '';
$credits_cost = (int) get_post_meta($topic_id, '_aksrt_credits_cost', true);
$pay_price = get_post_meta($topic_id, '_aksrt_pay_price', true);
?>
increment_view_count($topic_id);
$topic['views'] = (int) ($topic['views'] ?? 0) + 1;
}
$is_locked = !empty($topic['locked']);
$comments_enabled = !empty($permissions['can_reply']);
?>