Move 288 types from global AKSRT_* + inc/classes manual requires into
namespace AKSRT\{Domain} under src/AKSRT/, wire composer.json psr-4,
and slim bootstrap to helpers/modules/hooks only. Split multi-class
widget/gateway files, update admin contract audit paths, and document
the layout in ADR/README.
44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* User center credits: sign-in captcha + recent calendar.
|
|
*
|
|
* Expects extracted $context vars.
|
|
*
|
|
* @package AKSRT
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
$credits_enabled = !empty($credits_enabled);
|
|
if (!$credits_enabled) {
|
|
return;
|
|
}
|
|
|
|
if (function_exists('aksrt_is_captcha_enabled_for') && aksrt_is_captcha_enabled_for('signin')) :
|
|
?>
|
|
<div class="aksrt-signin-captcha" data-signin-captcha style="margin-bottom:16px;">
|
|
<?php aksrt_render_captcha('signin'); ?>
|
|
</div>
|
|
<?php
|
|
endif;
|
|
|
|
$signin_dates = [];
|
|
if (class_exists('\AKSRT\Credits\Signin')) {
|
|
$signin_log = \AKSRT\Credits\Signin::get_instance()->get_recent_signins($user_id, 30);
|
|
$signin_dates = array_filter(array_map(static function ($entry) {
|
|
return $entry['signin_date'] ?? '';
|
|
}, $signin_log));
|
|
}
|
|
|
|
if (empty($signin_dates)) {
|
|
return;
|
|
}
|
|
?>
|
|
<div class="uc-signin-calendar" style="margin-bottom:16px;">
|
|
<h4 class="uc-signin-calendar__title">
|
|
<i class="fas fa-calendar-alt" aria-hidden="true"></i>
|
|
<?php esc_html_e('最近 30 天签到', 'aksrt'); ?>
|
|
</h4>
|
|
<div data-aksrt-signin-calendar='<?php echo esc_attr(wp_json_encode(array_values($signin_dates))); ?>'></div>
|
|
</div>
|