From 829cd0dc6772fa2c98ced52c6cf52a10a26db9b9 Mon Sep 17 00:00:00 2001 From: nanhaoluo <3075912108@qq.com> Date: Tue, 20 Jan 2026 22:21:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20AI=20=E6=91=98?= =?UTF-8?q?=E8=A6=81=E8=AF=86=E5=88=AB=E7=A0=81=E6=9F=A5=E8=AF=A2=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 创建专用查询页面模板(page-ai-summary-query.php) - 识别码改为可点击链接,跳转到查询页面 - 移除识别码的 title 提示 - 查询页面显示完整信息:文章信息、摘要内容、生成信息 - 支持直接通过 URL 参数查询(?code=识别码) --- page-ai-summary-query.php | 204 ++++++++++++++++++++++++++++++++++ template-parts/ai-summary.php | 15 ++- 2 files changed, 216 insertions(+), 3 deletions(-) create mode 100644 page-ai-summary-query.php diff --git a/page-ai-summary-query.php b/page-ai-summary-query.php new file mode 100644 index 0000000..e7d6ec8 --- /dev/null +++ b/page-ai-summary-query.php @@ -0,0 +1,204 @@ +get_var($wpdb->prepare( + "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key = '_argon_ai_summary_code' AND meta_value = %s", + $query_code + )); + + if ($post_id) { + $post = get_post($post_id); + if ($post && $post->post_status === 'publish') { + $result = [ + 'post_id' => $post_id, + 'post_title' => get_the_title($post_id), + 'post_url' => get_permalink($post_id), + 'post_date' => get_the_date('Y-m-d H:i:s', $post_id), + 'post_author' => get_the_author_meta('display_name', $post->post_author), + 'summary' => get_post_meta($post_id, '_argon_ai_summary', true), + 'model' => get_post_meta($post_id, '_argon_ai_summary_model', true), + 'provider' => get_post_meta($post_id, '_argon_ai_summary_provider', true), + 'generated_time' => get_post_meta($post_id, '_argon_ai_summary_time', true), + 'code' => $query_code + ]; + + // 提供商名称映射 + $provider_names = [ + 'openai' => 'OpenAI', + 'anthropic' => 'Anthropic', + 'deepseek' => 'DeepSeek', + 'qianwen' => '通义千问', + 'wenxin' => '文心一言', + 'doubao' => '豆包', + 'kimi' => 'Kimi', + 'zhipu' => '智谱', + 'siliconflow' => 'SiliconFlow' + ]; + + $result['provider_display'] = isset($provider_names[$result['provider']]) ? $provider_names[$result['provider']] : $result['provider']; + } else { + $error = __('文章不存在或未发布', 'argon'); + } + } else { + $error = __('未找到对应的摘要记录', 'argon'); + } + } +} +?> + +