'far fa-calendar-alt',
'text' => get_the_date(),
];
}
$author_meta_items[] = [
'icon' => 'far fa-eye',
'text' => sprintf(__('浏览 %s', 'aksrt'), function_exists('aksrt_format_number') ? aksrt_format_number($views) : number_format_i18n($views)),
];
$author_meta_items[] = [
'icon' => 'far fa-comment-dots',
'text' => sprintf(__('评论 %s', 'aksrt'), number_format_i18n($comment_count)),
];
if ($word_count > 0) {
$author_meta_items[] = [
'icon' => 'far fa-file-word',
'text' => sprintf(__('约 %s 字', 'aksrt'), number_format_i18n($word_count)),
];
}
if ($reading_minutes > 0) {
$author_meta_items[] = [
'icon' => 'far fa-hourglass',
'text' => sprintf(_n('约 %d 分钟', '约 %d 分钟', $reading_minutes, 'aksrt'), $reading_minutes),
];
}
$copyright_text = trim((string) ($single_settings['copyright_text'] ?? ''));
if ($copyright_text === '') {
$copyright_text = sprintf(
__('本文由 %s 原创发布,转载请注明出处。', 'aksrt'),
get_the_author()
);
}
$show_action_card = !empty($single_settings['like_enabled'])
|| !empty($single_settings['favorite_enabled'])
|| !empty($single_settings['share_enabled'])
|| !empty($single_settings['print_enabled'])
|| !empty($single_settings['pdf_export_enabled']);
$has_sidebar_widgets = is_active_sidebar('sidebar-article');
$show_sidebar = $has_sidebar_widgets || $show_toc;
$cover_breadcrumbs_html = '';
if (!empty($single_settings['breadcrumbs']) && function_exists('aksrt_breadcrumbs')) {
ob_start();
aksrt_breadcrumbs($single_settings['breadcrumbs_home'] ?? '');
$cover_breadcrumbs_html = trim((string) ob_get_clean());
}
$post_front_content = (string) ($single_settings['front_content'] ?? '');
$post_after_content = (string) ($single_settings['after_content'] ?? '');
$content_maxheight = !empty($single_settings['maxheight_enabled']) ? max(0, (int) ($single_settings['maxheight'] ?? 0)) : 0;
$post_toc_title = __('文章目录', 'aksrt');
$post_toc_widget = '';
$post_toc_drawer = '';
$post_share_dropdown = '';
$post_reward_modal = '';
$post_episode_count = max(0, (int) get_post_meta($post_id, '_aksrt_featured_video_episode', true));
$post_slide_images = array_values(array_filter((array) ($single_settings['slide_images'] ?? [])));
$author_card_html = '';
$is_resource_compat_post = function_exists('aksrt_is_resource_post') && aksrt_is_resource_post($post_id);
$has_download_capability = function_exists('aksrt_is_downloadable_content') && aksrt_is_downloadable_content($post_id);
$paid_settings = class_exists('AKSRT_Settings') ? AKSRT_Settings::get_paid_content_settings() : [];
$paid_display_settings = is_array($paid_settings['display'] ?? null) ? $paid_settings['display'] : [];
$paid_box_position = (string) ($paid_display_settings['box_position'] ?? 'top');
if (!in_array($paid_box_position, ['box_top', 'top', 'bottom', 'box_bottom'], true)) {
$paid_box_position = 'top';
}
if (class_exists('AKSRT_Docs_Presenter')) {
$docs_presenter = AKSRT_Docs_Presenter::get_instance();
if ($docs_presenter->is_docs_page($post_id)) {
get_template_part('templates/pages/page-documentnav');
get_footer();
return;
}
}
if (!empty($single_settings['share_enabled'])) {
$post_share_dropdown = '
'
. ''
. ''
. ''
. ''
. ''
. '
';
}
if (!empty($single_settings['rewards_enabled']) && !empty($single_settings['rewards_image'])) {
$post_reward_modal = '' . esc_html($single_settings['rewards_text']) . '
';
}
if ($show_toc) {
$post_toc_widget = '' . esc_html($post_toc_title) . '
';
$post_toc_drawer = ''
. ''
. '';
}
if (function_exists('aksrt_get_user_dashboard_view')) {
$author_dashboard = aksrt_get_user_dashboard_view((int) get_the_author_meta('ID'), ['viewer_id' => get_current_user_id()]);
$author_recent_posts = is_array($author_dashboard['recent_posts'] ?? null) ? $author_dashboard['recent_posts'] : [];
$author_card_stats = [
['label' => __('文章', 'aksrt'), 'value' => (int) ($author_dashboard['post_count'] ?? 0)],
['label' => __('评论', 'aksrt'), 'value' => (int) ($author_dashboard['comment_count'] ?? 0)],
['label' => __('收藏', 'aksrt'), 'value' => (int) ($author_dashboard['favorite_count'] ?? 0)],
];
$author_card_html = ''
. '';
if (!empty($author_recent_posts)) {
$author_card_html .= '
' . esc_html__('最新文章', 'aksrt') . '
';
}
$author_card_html .= '
';
}
$post_status_badge = '';
$post_status = get_post_status($post_id);
if ($post_status && $post_status !== 'publish') {
$status_map = [
'draft' => ['label' => __('草稿', 'aksrt'), 'class' => 'jb-yellow'],
'pending' => ['label' => __('待审核', 'aksrt'), 'class' => 'jb-red'],
'private' => ['label' => __('私密', 'aksrt'), 'class' => 'b-black opacity8'],
'future' => ['label' => __('定时发布', 'aksrt'), 'class' => 'c-blue'],
];
if (isset($status_map[$post_status])) {
$post_status_badge = '' . esc_html($status_map[$post_status]['label']) . '';
}
}
?>