Files
wordpress-theme-aksrt/templates/parts/single-author-bar.php
T
kate522andClaude Opus 5 35bb96e82f refactor: rename the theme brand and every identifier from AKSRT to Jio
Full-project rename. `git grep -i aksrt` is now empty apart from the
DBMigrator 3.3.0 changelog note that documents the rename itself.

Code identifiers
- PHP namespace AKSRT\ -> Jio\ (composer PSR-4 + 378 declarations)
- global constants AKSRT_* -> JIO_* (VERSION/DIR/URI, PAY_TYPE_*, CAPTCHA_*)
- procedural functions, hooks, options, meta keys, table names,
  cookies, query vars, ajax actions and nonces: aksrt_ -> jio_
- text domain aksrt -> jio; Theme Name -> Jio
- JS globals: aksrtData/aksrtAdminData/... -> jioData/jioAdminData/...,
  window.AKSRTCaptcha & friends -> window.JioCaptcha, Aksrt* -> Jio*
- Vue components Aks*.vue -> Jio*.vue (15 files renamed + imports)
- CSS classes/data-attrs/custom properties: aksrt- -> jio-
- REST namespace aksrt/v1 -> jio/v1 (incl. payment gateway callbacks)

Storage layer
- DB tables {prefix}aksrt_* -> {prefix}jio_*; SCHEMA_VERSION 3.2.0 -> 3.3.0
  so dbDelta creates the new names on install
- widget id_base aksrt_widget_* -> jio_widget_*
- uninstall.php drop list rebuilt from the actual migrator tables
  (dropped 3 stale entries, added the 17 missing ones)

Removed
- hardcoded https://api.aksrt.com/version.json default update endpoint;
  get_endpoint() now reads the 「更新端点」 setting and do_check() no-ops
  when it is empty

Files renamed: inc/helpers/aksrt-*.php -> jio-*.php (54),
assets/admin/src/components/form/Aks*.vue -> Jio*.vue (15).
Build artifacts regenerated: assets/css/build, assets/js/runtime,
assets/admin/build.

Verified: audit-psr4-paths errors=0, audit-admin-contracts errors=0
(warnings=56, unchanged baseline), 813/813 widget-system tests,
44/44 phpunit, php -l clean across all PHP.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-11-01 20:05:04 +08:00

94 lines
3.8 KiB
PHP

<?php
/**
* Article header author bar.
*
* Contract: get_template_part(..., null, $args)
* show_time bool Relative publish/update time (default true)
* meta_html string Prebuilt single-metabox HTML
*
* @package Jio
*/
defined('ABSPATH') || exit;
$args = is_array($args ?? null) ? $args : [];
$show_time = !array_key_exists('show_time', $args) || !empty($args['show_time']);
$meta_html = (string) ($args['meta_html'] ?? '');
$author_id = (int) get_the_author_meta('ID');
$author_name = get_the_author();
$author_url = function_exists('jio_get_user_home_url') ? jio_get_user_home_url($author_id) : get_author_posts_url($author_id);
$modified_ts = (int) get_the_modified_time('U');
$published_ts = (int) get_the_time('U');
$use_modified = $modified_ts > $published_ts;
$rel_base = $use_modified ? $modified_ts : $published_ts;
$rel_label = $use_modified ? __('更新', 'jio') : __('发布', 'jio');
$abs_fmt = $use_modified
? sprintf(__('%s更新', 'jio'), get_the_modified_time('Y年m月d日 H:i'))
: sprintf(__('%s发布', 'jio'), get_the_time('Y年m月d日 H:i'));
$time_text = human_time_diff($rel_base, (int) current_time('timestamp')) . $rel_label;
$description = function_exists('jio_get_user_description')
? jio_get_user_description($author_id)
: trim((string) get_the_author_meta('description'));
$name_html = jio_get_user_name([
'id' => $author_id,
'class' => 'name flex ac flex1',
'name_class' => '',
'vip' => true,
'medal' => true,
'auth' => true,
'level' => true,
'follow' => false,
]);
$follow_html = jio_get_user_follow('px12-sm ml10 follow but c-red', $author_id);
$reward_button = get_current_user_id() !== $author_id && function_exists('jio_get_rewards_button')
? jio_get_rewards_button($author_id, 'ml6 but c-yellow px12-sm', get_the_ID())
: '';
?>
<div class="article-avatar">
<div class="user-info flex ac article-avatar">
<a href="<?php echo esc_url($author_url); ?>">
<span class="avatar-img">
<?php if (function_exists('jio_get_avatar_html')) : ?>
<?php echo jio_get_avatar_html($author_id, 42, ['class' => 'avatar avatar-id-' . $author_id]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php else : ?>
<?php echo get_avatar($author_id, 42, '', esc_attr($author_name), ['class' => 'avatar avatar-id-' . $author_id]); ?>
<?php endif; ?>
</span>
</a>
<div class="user-right flex flex1 ac jsb ml10">
<div class="flex1">
<?php echo $name_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<div class="px12-sm muted-2-color text-ellipsis">
<?php if ($show_time) : ?>
<span class="icon-circle" title="<?php echo esc_attr($abs_fmt); ?>" data-toggle="tooltip"><?php echo esc_html($time_text); ?></span>
<?php elseif ($description !== '') : ?>
<span class="icon-circle"><?php echo esc_html($description); ?></span>
<?php endif; ?>
<?php
$post_city = function_exists('jio_get_post_author_city_badge_html')
? jio_get_post_author_city_badge_html($author_id, 'badg badg-sm')
: '';
if ($post_city !== '') {
echo $post_city; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
?>
</div>
</div>
<div class="flex0 user-action">
<?php echo $follow_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php if ($reward_button !== '') : ?>
<?php echo $reward_button; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php jio_render_rewards_template_for_user($author_id, get_the_ID()); ?>
<?php endif; ?>
</div>
</div>
</div>
<div class="single-meta-row">
<i class="line-form-line" aria-hidden="true"></i>
<?php echo $meta_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
</div>