feat(identity): tip QR upload, metrics engine, comment moderate caps
Close identity 1:1 gaps after p1: user-center weixin/alipay tip QR upload+save, AKSRT_User_Metrics counters for medal get_type and level XP bridges, forum/revenue/signin hooks, comment moderate via user_caps, and clearer free-task deep links/status CTAs.
This commit is contained in:
1 parent
4e3eb0414d
commit
487681a6c4
18 files changed
+854
-36
No files matched your search
@@ -52,22 +52,48 @@ $aksrt_points_task_action = static function (string $key): array {
|
||||
'href' => $submit !== '' ? $submit : $home,
|
||||
];
|
||||
case 'comment_new':
|
||||
return [
|
||||
'type' => 'link',
|
||||
'label' => __('去完成', 'aksrt'),
|
||||
'href' => $home,
|
||||
];
|
||||
case 'login':
|
||||
case 'post_like':
|
||||
case 'post_favorite':
|
||||
case 'followed':
|
||||
case 'comment_like':
|
||||
return [
|
||||
'type' => 'link',
|
||||
'label' => __('去看看', 'aksrt'),
|
||||
'href' => $home,
|
||||
];
|
||||
case 'bbs_posts_new':
|
||||
$posts = get_posts(['numberposts' => 1, 'post_status' => 'publish', 'orderby' => 'date', 'order' => 'DESC']);
|
||||
$href = $home;
|
||||
if (!empty($posts[0]) && $posts[0] instanceof WP_Post) {
|
||||
$link = get_permalink($posts[0]);
|
||||
if (is_string($link) && $link !== '') {
|
||||
$href = $link . '#comments';
|
||||
}
|
||||
}
|
||||
return [
|
||||
'type' => 'link',
|
||||
'label' => __('去完成', 'aksrt'),
|
||||
'href' => $href,
|
||||
];
|
||||
case 'login':
|
||||
return [
|
||||
'type' => 'none',
|
||||
'label' => __('登录即可领取', 'aksrt'),
|
||||
];
|
||||
case 'post_like':
|
||||
case 'post_favorite':
|
||||
case 'comment_like':
|
||||
$posts = get_posts(['numberposts' => 1, 'post_status' => 'publish', 'orderby' => 'comment_count', 'order' => 'DESC']);
|
||||
$href = $home;
|
||||
if (!empty($posts[0]) && $posts[0] instanceof WP_Post) {
|
||||
$link = get_permalink($posts[0]);
|
||||
if (is_string($link) && $link !== '') {
|
||||
$href = $link;
|
||||
}
|
||||
}
|
||||
return [
|
||||
'type' => 'link',
|
||||
'label' => __('去看看', 'aksrt'),
|
||||
'href' => $href,
|
||||
];
|
||||
case 'followed':
|
||||
$center = function_exists('aksrt_get_user_center_url') ? (string) aksrt_get_user_center_url() : $home;
|
||||
return [
|
||||
'type' => 'link',
|
||||
'label' => __('去主页', 'aksrt'),
|
||||
'href' => $center !== '' ? $center : $home,
|
||||
];
|
||||
case 'bbs_posts_new':
|
||||
case 'bbs_reply':
|
||||
if (!$forum_on) {
|
||||
return ['type' => 'none', 'label' => ''];
|
||||
@@ -180,16 +206,19 @@ $pane = isset($points_tasks_pane) ? sanitize_key((string) $points_tasks_pane)
|
||||
<div class="focus-color em14">
|
||||
<i class="fas fa-coins mr6 em09" aria-hidden="true"></i>+ <?php echo esc_html((string) (int) $task['points']); ?>
|
||||
</div>
|
||||
<?php if (($action['type'] ?? 'none') === 'signin') : ?>
|
||||
<button type="button" class="uc-points-tasks__action muted-color em09 mt6" data-aksrt-signin-goto>
|
||||
<?php echo esc_html((string) $action['label']); ?><i class="fa fa-angle-right em12 ml3" aria-hidden="true"></i>
|
||||
</button>
|
||||
<?php elseif (($action['type'] ?? 'none') === 'link' && !empty($action['href'])) : ?>
|
||||
<a class="uc-points-tasks__action muted-color em09 mt6" href="<?php echo esc_url((string) $action['href']); ?>">
|
||||
<?php echo esc_html((string) $action['label']); ?><i class="fa fa-angle-right em12 ml3" aria-hidden="true"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if ($done) : ?>
|
||||
<span class="uc-points-tasks__action muted-color em09 mt6"><?php esc_html_e('今日已完成', 'aksrt'); ?></span>
|
||||
<?php elseif (($action['type'] ?? 'none') === 'signin') : ?>
|
||||
<button type="button" class="uc-points-tasks__action muted-color em09 mt6" data-aksrt-signin-goto>
|
||||
<?php echo esc_html((string) $action['label']); ?><i class="fa fa-angle-right em12 ml3" aria-hidden="true"></i>
|
||||
</button>
|
||||
<?php elseif (($action['type'] ?? 'none') === 'link' && !empty($action['href'])) : ?>
|
||||
<a class="uc-points-tasks__action muted-color em09 mt6" href="<?php echo esc_url((string) $action['href']); ?>">
|
||||
<?php echo esc_html((string) $action['label']); ?><i class="fa fa-angle-right em12 ml3" aria-hidden="true"></i>
|
||||
</a>
|
||||
<?php elseif (($action['type'] ?? 'none') === 'none' && !empty($action['label'])) : ?>
|
||||
<span class="uc-points-tasks__action muted-color em09 mt6"><?php echo esc_html((string) $action['label']); ?></span>
|
||||
<?php endif; ?> </div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
Reference in new issue
Block a user