feat(assets): forum free-task depth, withdraw notices, share poster
Route forum essence/adopt/hot/score rewards through free-points day cap, notify users on withdraw complete/reject, surface 海报分享 on single share grid, and extend admin free-task keys for the remaining matrix.
This commit is contained in:
1 parent
c3eee3fa7e
commit
b1731f7a8d
11 files changed
+165
-55
No files matched your search
@@ -245,22 +245,32 @@ trait AKSRT_Forum_Topic_Service_Part_1 {
|
||||
return;
|
||||
}
|
||||
|
||||
// 积分奖励(§7.7):读 `credits.essence`,带每日上限。
|
||||
if (class_exists('AKSRT_Credits') && class_exists('AKSRT_Settings')) {
|
||||
// 积分奖励(§7.7):统一走免费积分日上限。
|
||||
if (class_exists('AKSRT_Settings')) {
|
||||
$cfg = AKSRT_Settings::get_forum_settings();
|
||||
$amount = (int) ($cfg['credits']['essence'] ?? 0);
|
||||
if ($amount > 0) {
|
||||
$daily_max = (int) ($cfg['credits']['daily_max'] ?? 50);
|
||||
if ($daily_max > 0 && $this->today_credits_count($author_id, 'forum_essence') >= $daily_max) {
|
||||
$amount = 0;
|
||||
}
|
||||
|
||||
if ($amount > 0) {
|
||||
AKSRT_Credits::add($author_id, $amount, 'forum_essence', [
|
||||
$granted = 0;
|
||||
if (class_exists('AKSRT_Points_Free')) {
|
||||
$result = AKSRT_Points_Free::grant($author_id, 'bbs_essence', $amount, [
|
||||
'type' => 'post',
|
||||
'id' => $topic_id,
|
||||
], __('主题被设为精华', 'aksrt'));
|
||||
|
||||
'id' => $topic_id,
|
||||
]);
|
||||
$granted = is_wp_error($result) ? 0 : (int) $result;
|
||||
} elseif (class_exists('AKSRT_Credits')) {
|
||||
$daily_max = (int) ($cfg['credits']['daily_max'] ?? 50);
|
||||
if ($daily_max > 0 && $this->today_credits_count($author_id, 'forum_essence') >= $daily_max) {
|
||||
$amount = 0;
|
||||
}
|
||||
if ($amount > 0) {
|
||||
AKSRT_Credits::add($author_id, $amount, 'forum_essence', [
|
||||
'type' => 'post',
|
||||
'id' => $topic_id,
|
||||
], __('主题被设为精华', 'aksrt'));
|
||||
$granted = $amount;
|
||||
}
|
||||
}
|
||||
if ($granted > 0) {
|
||||
update_post_meta($topic_id, '_aksrt_essence_rewarded', '1');
|
||||
update_post_meta($topic_id, '_aksrt_essence_rewarded_at', current_time('mysql'));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user