From 04f20d43f84082ca085354bea3c20b12dcdfadb6 Mon Sep 17 00:00:00 2001 From: nanhaoluo <3075912108@qq.com> Date: Mon, 26 Jan 2026 13:43:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20AI=20=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=80=89=E9=A1=B9=E4=BF=9D=E5=AD=98=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除旧的 argon_ai_summary_provider 保存逻辑 - 移除旧的多 API 配置保存逻辑(10 个提供商的循环) - 添加新的 argon_ai_summary_active_api 保存 - 添加新的 argon_ai_spam_active_api 保存 - 更新 argon_ai_summary_exclude_ids 为 argon_ai_summary_exclude_posts - 简化评论审核相关选项保存 - 移除不再使用的旧选项保存逻辑 --- settings.php | 37 +++++++------------------------------ 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/settings.php b/settings.php index 0dc942f..57e16a2 100644 --- a/settings.php +++ b/settings.php @@ -7724,41 +7724,18 @@ function argon_update_themeoptions(){ //AI 摘要 argon_update_option_checkbox('argon_ai_summary_enable'); - argon_update_option('argon_ai_summary_provider'); + argon_update_option('argon_ai_summary_active_api'); argon_update_option('argon_ai_summary_prompt'); - argon_update_option('argon_ai_summary_exclude_ids'); + argon_update_option('argon_ai_summary_exclude_posts'); - // 保存所有提供商的多 API 配置 - $providers = ['openai', 'anthropic', 'deepseek', 'xiaomi', 'qianwen', 'wenxin', 'doubao', 'kimi', 'zhipu', 'siliconflow']; - foreach ($providers as $provider) { - // 保存 API 配置数组 - if (isset($_POST["argon_ai_{$provider}_apis"])) { - $apis_json = stripslashes($_POST["argon_ai_{$provider}_apis"]); - $apis = json_decode($apis_json, true); - if (is_array($apis)) { - update_option("argon_ai_{$provider}_apis", $apis); - } - } - - // 保存当前激活的 API ID - if (isset($_POST["argon_ai_{$provider}_active_api"])) { - update_option("argon_ai_{$provider}_active_api", sanitize_text_field($_POST["argon_ai_{$provider}_active_api"])); - } - } - //AI 垃圾评论识别 argon_update_option_checkbox('argon_comment_spam_detection_enable'); - argon_update_option('argon_comment_spam_detection_prompt_mode'); - argon_update_option('argon_comment_spam_detection_confidence_threshold'); - argon_update_option('argon_comment_spam_detection_privacy_level'); - argon_update_option('argon_comment_spam_detection_prompt'); - argon_update_option('argon_comment_spam_detection_mode'); - argon_update_option('argon_comment_spam_detection_sample_rate'); - argon_update_option('argon_comment_spam_detection_auto_action'); - argon_update_option('argon_comment_spam_detection_whitelist'); - argon_update_option_checkbox('argon_comment_spam_detection_exclude_logged_in'); + argon_update_option('argon_ai_spam_active_api'); + argon_update_option('argon_comment_spam_detection_realtime_mode'); argon_update_option('argon_comment_spam_detection_keywords'); - argon_update_option_checkbox('argon_comment_spam_detection_ai_learn'); + argon_update_option('argon_comment_spam_detection_prompt_mode'); + argon_update_option('argon_comment_spam_detection_custom_prompt'); + argon_update_option('argon_comment_spam_detection_auto_threshold'); }