feat(frontend): illustrated null states and author rewards fallback

Add aksrt_get_null / widget null helpers with null.svg, use them in
sidebar widgets, comments empty, and related posts; when PM is off show
post rewards entry on the single author bar.
This commit is contained in:
2026-07-16 19:33:57 +08:00
parent b1731f7a8d
commit a0748c08fe
10 changed files with 140 additions and 9 deletions
+15 -1
View File
@@ -100,10 +100,24 @@ if (class_exists('AKSRT_User_Home')) {
<button type="button" class="px12-sm ml10 follow but c-red" data-aksrt-follow="<?php echo (int) $author_id; ?>">
<i class="fa fa-heart em09" aria-hidden="true"></i> <?php esc_html_e('关注', 'aksrt'); ?>
</button>
<?php if ($aksrt_pm_on && $aksrt_msg_url !== '') : ?>
<?php if ($aksrt_pm_on && $aksrt_msg_url !== '') : ?>
<a href="<?php echo esc_url(add_query_arg('msg_type', 'conversation', $aksrt_msg_url)); ?>" class="ml6 but c-blue px12-sm">
<i class="fa fa-comment em09" aria-hidden="true"></i> <?php esc_html_e('私信', 'aksrt'); ?>
</a>
<?php else : ?>
<?php
$aksrt_post_settings = class_exists('AKSRT_Settings') && method_exists('AKSRT_Settings', 'get_post_page_settings')
? AKSRT_Settings::get_post_page_settings()
: [];
$rewards_on = !empty($aksrt_post_settings['rewards_enabled'])
|| !empty($aksrt_post_settings['post_rewards_enabled'])
|| !empty($aksrt_post_settings['post_rewards_s']);
?>
<?php if ($rewards_on) : ?>
<button type="button" class="ml6 but c-yellow px12-sm" data-aksrt-reward-open>
<i class="fa fa-gift em09" aria-hidden="true"></i> <?php esc_html_e('赞赏', 'aksrt'); ?>
</button>
<?php endif; ?>
<?php endif; ?>
<?php else : ?>
<a href="<?php echo esc_url($login_url); ?>" class="px12-sm ml10 follow but c-red">