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:
kate522 committed 2026-07-16 17:46:51 +08:00
1 parent c3eee3fa7e
commit b1731f7a8d
11 files changed
+165 -55

No files matched your search

@@ -312,17 +312,27 @@ class AKSRT_Forum_Comment_Service {
update_post_meta($topic_id, '_aksrt_question_status', 1); // QUESTION_SOLVED
$adoptee_id = (int) $comment->user_id;
if ($adoptee_id > 0 && class_exists('AKSRT_Credits')) {
if ($adoptee_id > 0) {
$config = $this->forum->get_config();
$amount = (int) ($config['credits']['adopted'] ?? 20);
if ($amount > 0) {
$already = get_comment_meta($comment_id, '_aksrt_adopt_credited', true);
if (!$already) {
\AKSRT_Credits::add($adoptee_id, $amount, 'forum_adopted', [
'type' => 'comment',
'id' => $comment_id,
]);
update_comment_meta($comment_id, '_aksrt_adopt_credited', '1');
if (class_exists('AKSRT_Points_Free')) {
$granted = \AKSRT_Points_Free::grant($adoptee_id, 'bbs_adopt', $amount, [
'type' => 'comment',
'id' => $comment_id,
]);
if (!is_wp_error($granted) && (int) $granted > 0) {
update_comment_meta($comment_id, '_aksrt_adopt_credited', '1');
}
} elseif (class_exists('AKSRT_Credits')) {
\AKSRT_Credits::add($adoptee_id, $amount, 'forum_adopted', [
'type' => 'comment',
'id' => $comment_id,
]);
update_comment_meta($comment_id, '_aksrt_adopt_credited', '1');
}
}
}
@@ -498,15 +508,22 @@ class AKSRT_Forum_Comment_Service {
update_comment_meta($comment_id, '_aksrt_is_hot', '1');
// Credit the comment author
// Credit the comment author (free-task day cap).
$author_id = (int) $comment->user_id;
if ($author_id > 0 && class_exists('AKSRT_Credits')) {
$amount = (int) ($config['credits']['comment_like'] ?? 1);
if ($author_id > 0) {
$amount = (int) ($config['credits']['comment_hot'] ?? $config['credits']['comment_like'] ?? 5);
if ($amount > 0) {
\AKSRT_Credits::add($author_id, $amount, 'forum_hot_comment', [
'type' => 'comment',
'id' => $comment_id,
]);
if (class_exists('AKSRT_Points_Free')) {
\AKSRT_Points_Free::grant($author_id, 'bbs_comment_hot', $amount, [
'type' => 'comment',
'id' => $comment_id,
]);
} elseif (class_exists('AKSRT_Credits')) {
\AKSRT_Credits::add($author_id, $amount, 'forum_hot_comment', [
'type' => 'comment',
'id' => $comment_id,
]);
}
}
}