feat: remove forum feature (Phase 1)

This commit is contained in:
kate522 committed 2026-08-02 20:02:44 +08:00
1 parent f3e4cdd9cf
commit 2bbd7c01a3
173 files changed
+51 -27360

No files matched your search

@@ -23,22 +23,6 @@ $aksrt_points_task_action = static function (string $key): array {
$submit = (string) aksrt_get_page_url_by_template('templates/pages/page-submit.php');
}
$forum_on = false;
$forum_home = '';
$forum_compose = '';
if (class_exists('\AKSRT\Settings\Settings') && method_exists('\AKSRT\Settings\Settings', 'get_forum_settings')) {
$f = \AKSRT\Settings\Settings::get_forum_settings();
$forum_on = !empty($f['enabled']);
}
if ($forum_on) {
if (function_exists('aksrt_get_forum_home_url')) {
$forum_home = (string) aksrt_get_forum_home_url();
}
if (function_exists('aksrt_get_forum_compose_url')) {
$forum_compose = (string) aksrt_get_forum_compose_url();
}
}
switch ($key) {
case 'sign_in':
return [
@@ -93,37 +77,10 @@ $aksrt_points_task_action = static function (string $key): array {
'label' => __('去主页', 'aksrt'),
'href' => $center !== '' ? $center : $home,
];
case 'bbs_posts_new':
case 'bbs_reply':
if (!$forum_on) {
default:
return ['type' => 'none', 'label' => ''];
}
$href = $forum_compose !== '' ? $forum_compose : $forum_home;
if ($href === '') {
return ['type' => 'none', 'label' => ''];
}
return [
'type' => 'link',
'label' => __('去完成', 'aksrt'),
'href' => $href,
];
case 'bbs_essence':
case 'bbs_adopt':
case 'bbs_posts_hot':
case 'bbs_comment_hot':
case 'bbs_score_extra':
if (!$forum_on || $forum_home === '') {
return ['type' => 'none', 'label' => ''];
}
return [
'type' => 'link',
'label' => __('去看看', 'aksrt'),
'href' => $forum_home,
];
default:
return ['type' => 'none', 'label' => ''];
}
};
}
};
$user_id = (int) ($user_id ?? get_current_user_id());
$today = \AKSRT\Credits\PointsFree::today_total($user_id);