From 89706cf78c6b7376a21306529694a8b073ecddfc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8F=99=E8=BF=B0=E3=80=81=E5=88=AB=E7=A6=BB?=
 <93301500+xushubieli@users.noreply.github.com>
Date: Thu, 27 Mar 2025 08:30:58 +0800
Subject: [PATCH 1/7] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=87=AA=E5=8A=A8?=
 =?UTF-8?q?=E5=85=B3=E9=94=AE=E8=AF=8D=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/admin/archives_do.php                |  4 ++--
 src/admin/inc/inc_archives_functions.php | 18 +++---------------
 2 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/src/admin/archives_do.php b/src/admin/archives_do.php
index a2a416a1..aafad1c3 100644
--- a/src/admin/archives_do.php
+++ b/src/admin/archives_do.php
@@ -658,7 +658,7 @@ else if ($dopost == "makekw") {
                     if (strlen($keywords.$k) >= 60) {
                         break;
                     } else {
-                        if (strlen($k) <= 2 || $length == 3) continue;
+                        if (strlen($k) <= 6 || $length == 3) continue;
                         $keywords .= $k.',';
                     }
                 }
@@ -666,7 +666,7 @@ else if ($dopost == "makekw") {
                     if (strlen($keywords.$k) >= 60) {
                         break;
                     } else if (!in_array($k, $titleindexs)) {
-                        if (strlen($k) <= 2 || $length == 3) continue;
+                        if (strlen($k) <= 6 || $length == 3) continue;
                         $keywords .= $k.',';
                     }
                 }
diff --git a/src/admin/inc/inc_archives_functions.php b/src/admin/inc/inc_archives_functions.php
index 5336edfa..a4d3687c 100644
--- a/src/admin/inc/inc_archives_functions.php
+++ b/src/admin/inc/inc_archives_functions.php
@@ -537,12 +537,10 @@ function AnalyseHtmlBody($body, &$description, &$litpic, &$keywords, $dtype = ''
     //自动获取关键词
     if ($autokey == 1) {
         $subject = $title;
-        $message = $body;
         //采用DedeBIZ Core分词组件分词
         if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) {
             $keywords = '';
             $client = new DedeBizClient();
-            $data = $client->Spliteword($subject.Html2Text($message));
             $keywords = $data->data;
             $client->Close();
         } else {
@@ -552,24 +550,14 @@ function AnalyseHtmlBody($body, &$description, &$litpic, &$keywords, $dtype = ''
             $sp->SetSource($subject, $cfg_soft_lang);
             $sp->StartAnalysis();
             $titleindexs = preg_replace("/#p#|#e#/", '', $sp->GetFinallyIndex());
-            $sp->SetSource(Html2Text($message), $cfg_soft_lang);
             $sp->StartAnalysis();
-            $allindexs = preg_replace("/#p#|#e#/", '', $sp->GetFinallyIndex());
-            if (is_array($allindexs) && is_array($titleindexs)) {
+            if (is_array($titleindexs)) {
                 foreach ($titleindexs as $k => $v) {
                     if (strlen($keywords.$k) >= 60) {
                         break;
                     } else {
-                        if (strlen($k) <= 2 || $length == 3) continue;
-                        $keywords .= $k.',';
-                    }
-                }
-                foreach ($allindexs as $k => $v) {
-                    if (strlen($keywords.$k) >= 60) {
-                        break;
-                    } else if (!in_array($k, $titleindexs)) {
-                        if (strlen($k) <= 2 || $length == 3) continue;
-                        $keywords .= $k.',';
+                        if (strlen($k) <= 6 || $length == 3) continue;
+                        $keywords .= ($keywords == '' ? "{$k}" : ",{$k}");
                     }
                 }
             }

From 8ab43947d69ee3ab81c3504da093419a96e8663a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8F=99=E8=BF=B0=E3=80=81=E5=88=AB=E7=A6=BB?=
 <93301500+xushubieli@users.noreply.github.com>
Date: Thu, 27 Mar 2025 17:54:45 +0800
Subject: [PATCH 2/7] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=87=E6=A1=A3?=
 =?UTF-8?q?=E8=87=AA=E5=8A=A8alt=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/apps/diy.php           | 2 ++
 src/system/extend.func.php | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/apps/diy.php b/src/apps/diy.php
index 63ecf5b6..4c806a79 100755
--- a/src/apps/diy.php
+++ b/src/apps/diy.php
@@ -98,6 +98,8 @@ if ($action == 'post') {
                 require_once(DEDEINC.'/libraries/mail.class.php');
                 $smtp = new smtp($cfg_smtp_server, $cfg_smtp_port, true, $cfg_smtp_usermail, $cfg_smtp_password);
                 $smtp->debug = false;
+                //除了cfg_adminemail接收邮件外,自定义发送其他指定邮件,恢复注释代码使用
+                //$cfg_smtp_usermail2 = "admin@qq.com";
                 $smtp->sendmail($cfg_adminemail, $cfg_webname, $cfg_smtp_usermail, $mailtitle, $mailbody, $mailtype);
             } else {
                 @mail($cfg_adminemail, $mailtitle, $mailbody, $headers);
diff --git a/src/system/extend.func.php b/src/system/extend.func.php
index 57053ca0..dcbb8e0e 100755
--- a/src/system/extend.func.php
+++ b/src/system/extend.func.php
@@ -58,6 +58,7 @@ function obtainalt($newalt)
 {
     global $dsql, $id, $aid;
     $myid = isset($id) ? $id : $aid;
+    $title = isset($row['title']) ? $row['title'] : '';
     $row = $dsql->GetOne("SELECT title FROM `#@__archives` WHERE id='$myid'");
     //图片注释自动为标题
     $newalt = str_ireplace(array('alt=""', 'alt=\'\'', 'title=""', 'title=\'\''), "", $newalt);
@@ -65,6 +66,7 @@ function obtainalt($newalt)
     //去掉图片宽度和高度
     $newalt = preg_replace("/style=\"width\:(.*)\"/", "", $newalt);
     //去掉结尾
+    $newalt = str_ireplace("  ", " ", $newalt);
     $newalt = str_ireplace(" /", "", $newalt);
     return $newalt;
 }

From 17af505ddd117841e130fb2c657cb45dd953dcc5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8F=99=E8=BF=B0=E3=80=81=E5=88=AB=E7=A6=BB?=
 <93301500+xushubieli@users.noreply.github.com>
Date: Thu, 27 Mar 2025 18:02:45 +0800
Subject: [PATCH 3/7] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BC=98=E5=8C=96?=
 =?UTF-8?q?=E6=B3=A8=E9=87=8A=E8=AF=B4=E6=98=8E?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/apps/diy.php    | 2 +-
 src/apps/search.php | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/apps/diy.php b/src/apps/diy.php
index 4c806a79..380b7158 100755
--- a/src/apps/diy.php
+++ b/src/apps/diy.php
@@ -66,7 +66,7 @@ if ($action == 'post') {
                 }
             }
         }
-        //判断$name是否输入中文包括繁体则提交失败,$name改成您表单字段标识,恢复注释代码使用
+        //判断$name是否输入违禁词,在后台-系统设置:禁用关键词添加,$name改成您表单字段标识,恢复注释代码使用
         /*if ($name != '' && preg_match("#".$cfg_notallowstr."#i", $name)) {
             ShowMsg("您输入的信息存在违禁,请重新填写", "-1");
             exit();
diff --git a/src/apps/search.php b/src/apps/search.php
index 4bb81ac9..eac84fbd 100755
--- a/src/apps/search.php
+++ b/src/apps/search.php
@@ -56,6 +56,7 @@ if (empty($typeid)) {
 $typeid = intval($typeid);
 $keyword = addslashes(cn_substr($keyword, 30));
 $typeid = intval($typeid);
+//判断关键词是否输入违禁词,在后台-系统设置:禁用关键词添加
 if ($keyword != '' && ($cfg_notallowstr != '' && preg_match("#".$cfg_notallowstr."#i", $keyword))) {
     ShowMsg("您输入的关键词存在违禁,请重新填写", "-1");
     exit();

From fa2c7b3ad2beaa5c8c8e3263d91a6961a32c4e0d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8F=99=E8=BF=B0=E3=80=81=E5=88=AB=E7=A6=BB?=
 <93301500+xushubieli@users.noreply.github.com>
Date: Thu, 27 Mar 2025 19:34:53 +0800
Subject: [PATCH 4/7] =?UTF-8?q?=E5=90=8C=E6=AD=A5bs=E6=8F=90=E7=A4=BA?=
 =?UTF-8?q?=E6=A1=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/system/dedealert.func.php      | 2 +-
 src/system/helpers/code.helper.php | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/system/dedealert.func.php b/src/system/dedealert.func.php
index a686cf1f..dcd82f68 100644
--- a/src/system/dedealert.func.php
+++ b/src/system/dedealert.func.php
@@ -17,7 +17,7 @@ define('ALERT_WARNING', 5);
 define('ALERT_INFO', 6);
 define('ALERT_LIGHT', 7);
 define('ALERT_DARK', 8);
-define("ALERT_TPL", '<div style="position:relative;padding:0.75rem 1.25rem;margin-bottom:1rem;width:auto;font-size:14px;color:~color~;background:~background~;border-color:~border~;border:1px solid transparent;border-radius:0.5rem">~content~</div>');
+define("ALERT_TPL", '<div style="padding:1rem"><div style="position:relative;padding:0.75rem 1.25rem;font-size:14px;color:~color~;background:~background~;border-color:~border~;border:1px solid transparent;border-radius:0.5rem">~content~</div></div>');
 //$content:文档,$type:alert类型
 function DedeAlert($content, $type = ALERT_PRIMARY, $isHTML = false)
 {
diff --git a/src/system/helpers/code.helper.php b/src/system/helpers/code.helper.php
index 61f77f9b..e22c0d0d 100644
--- a/src/system/helpers/code.helper.php
+++ b/src/system/helpers/code.helper.php
@@ -437,7 +437,7 @@ function checkCode($code)
 function htmlErrors($errors = null)
 {
     if ($errors) {
-        $errorsHTML = "<div style='width:98%;margin:1rem auto;color:#842029;background:#f8d7da;border-color:#842029;position:relative;padding:0.75rem 1.25rem;border:1px solid transparent;border-radius:0.5rem'>";
+        $errorsHTML = "<div style='padding:1rem'><div style='position:relative;padding:0.75rem 1.25rem;font-size:14px;color:#842029;background:#f8d7da;border-color:#842029;border:1px solid transparent;border-radius:0.5rem'>";
         $errorsHTML .= '内嵌脚本缺失,请添加该函数:';
         $errorsHTML .= '<dl>';
         foreach ($errors as $error) {
@@ -447,7 +447,7 @@ function htmlErrors($errors = null)
             $errorsHTML .= '<dd>'.$error['name'].'</dd>';
         }
         $errorsHTML .= '</dl>';
-        $errorsHTML .= "</div>\r\n";
+        $errorsHTML .= "</div></div>";
         echo $errorsHTML;
     }
 }

From be3ed2af02ddf3a968efba68976da3d53e427117 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8F=99=E8=BF=B0=E3=80=81=E5=88=AB=E7=A6=BB?=
 <93301500+xushubieli@users.noreply.github.com>
Date: Thu, 27 Mar 2025 19:57:13 +0800
Subject: [PATCH 5/7] Update code.helper.php

---
 src/system/helpers/code.helper.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/system/helpers/code.helper.php b/src/system/helpers/code.helper.php
index e22c0d0d..1414e96c 100644
--- a/src/system/helpers/code.helper.php
+++ b/src/system/helpers/code.helper.php
@@ -438,7 +438,7 @@ function htmlErrors($errors = null)
 {
     if ($errors) {
         $errorsHTML = "<div style='padding:1rem'><div style='position:relative;padding:0.75rem 1.25rem;font-size:14px;color:#842029;background:#f8d7da;border-color:#842029;border:1px solid transparent;border-radius:0.5rem'>";
-        $errorsHTML .= '内嵌脚本缺失,请添加该函数:';
+        $errorsHTML .= '<p>内嵌脚本缺失,请添加该函数:</p>';
         $errorsHTML .= '<dl>';
         foreach ($errors as $error) {
             if ($error['line']) {

From 69766c1e202d8db9024a2e41c40d60e138857cfe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8F=99=E8=BF=B0=E3=80=81=E5=88=AB=E7=A6=BB?=
 <93301500+xushubieli@users.noreply.github.com>
Date: Thu, 27 Mar 2025 20:35:33 +0800
Subject: [PATCH 6/7] =?UTF-8?q?=E8=B0=83=E6=95=B4tag=E6=A0=87=E7=AD=BE?=
 =?UTF-8?q?=E8=B0=83=E7=94=A8=E4=BC=AA=E9=9D=99=E6=80=81=E9=97=AE=E9=A2=98?=
 =?UTF-8?q?=EF=BC=8C=E5=9B=BE=E7=89=87=E8=87=AA=E5=8A=A8alt=E5=8A=9F?=
 =?UTF-8?q?=E8=83=BD=E9=9D=99=E6=80=81=E5=8F=91=E5=B8=83=E6=8F=90=E7=A4=BA?=
 =?UTF-8?q?=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/admin/ai_dialog.php       |  4 +---
 src/system/extend.func.php    | 27 ++++++++++++++-------------
 src/system/taglib/tag.lib.php |  2 +-
 3 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/src/admin/ai_dialog.php b/src/admin/ai_dialog.php
index 60842fb8..a69e5112 100644
--- a/src/admin/ai_dialog.php
+++ b/src/admin/ai_dialog.php
@@ -63,9 +63,7 @@ if (!empty($noeditor)) {
                         ?>
                     </select>
                 </div>
-                <div class="form-group">
-                    <button type="button" id="btnAIAction" class="btn btn-success btn-sm">确定</button>
-                </div>
+                <button type="button" id="btnAIAction" class="btn btn-success btn-sm">确定</button>
             </div>
         </div>
         <script>
diff --git a/src/system/extend.func.php b/src/system/extend.func.php
index dcbb8e0e..6e3cbb58 100755
--- a/src/system/extend.func.php
+++ b/src/system/extend.func.php
@@ -22,19 +22,21 @@ if (!function_exists('obtaintheme')) {
     }
 }
 //标签调用[field:id function='obtaintags(@me,3)'/]3表示调用文档3个标签
-if (!function_exists('obtaintags')) {
-    function obtaintags($aid, $num = 3)
-    {
-        global $dsql, $cfg_cmspath;
-        $tags = '';
-        $query = "SELECT * FROM `#@__taglist` WHERE aid='$aid' LIMIT $num";
-        $dsql->Execute('tag', $query);
-        while($row = $dsql->GetArray('tag')) {
+function obtaintags($aid, $num = 3)
+{
+    global $dsql, $cfg_cmspath, $cfg_rewrite;
+    $tags = '';
+    $query = "SELECT * FROM `#@__taglist` WHERE aid='$aid' LIMIT $num";
+    $dsql->Execute('tag', $query);
+    while ($row = $dsql->GetArray('tag')) {
+        if ($cfg_rewrite == 'Y') {
+            $link = $cfg_cmspath."/tags/{$row['tid']}";
+        } else {
             $link = $cfg_cmspath."/apps/tags.php?/{$row['tid']}";
-            $tags .= ($tags == '' ? "<a href='{$link}'>{$row['tag']}</a>" : "、<a href='{$link}'>{$row['tag']}</a>");
         }
-        return $tags;
+        $tags .= ($tags == '' ? "<a href=\"{$link}\">{$row['tag']}</a>" : "、<a href=\"{$link}\">{$row['tag']}</a>");
     }
+    return $tags;
 }
 //提取文档多图片[field:body function='obtainimgs(@me,3)'/]3表示调用文档3张图片,则附加字段需添加body字段调用channelid='模型id' addfields='字段1,字段2'
 if (!function_exists('obtainimgs')) {
@@ -44,10 +46,10 @@ if (!function_exists('obtainimgs')) {
         $imgsrc_arr = array_unique($matches[3]);
         $i = 0;
         $result = '';
-        foreach($imgsrc_arr as $imgsrc)
+        foreach ($imgsrc_arr as $imgsrc)
         {
             if ($i == $num) break;
-            $result .= "<img src=\"$imgsrc\">";
+            $result .= "<img src=\"{$imgsrc}\">";
             $i++;
         }
         return $result;
@@ -58,7 +60,6 @@ function obtainalt($newalt)
 {
     global $dsql, $id, $aid;
     $myid = isset($id) ? $id : $aid;
-    $title = isset($row['title']) ? $row['title'] : '';
     $row = $dsql->GetOne("SELECT title FROM `#@__archives` WHERE id='$myid'");
     //图片注释自动为标题
     $newalt = str_ireplace(array('alt=""', 'alt=\'\'', 'title=""', 'title=\'\''), "", $newalt);
diff --git a/src/system/taglib/tag.lib.php b/src/system/taglib/tag.lib.php
index 4b062bcc..bec6a6a5 100755
--- a/src/system/taglib/tag.lib.php
+++ b/src/system/taglib/tag.lib.php
@@ -11,7 +11,7 @@ if (!defined('DEDEINC')) exit ('dedebiz');
  */
 function lib_tag(&$ctag, &$refObj)
 {
-    global $dsql, $envs, $cfg_cmsurl, $cfg_tags_dir ,$cfg_rewrite;
+    global $dsql, $envs, $cfg_cmsurl, $cfg_tags_dir, $cfg_rewrite;
     $attlist = "row|30,sort|new,getall|0,typeid|0,ishtml|0";
     FillAttsDefault($ctag->CAttribute->Items, $attlist);
     extract($ctag->CAttribute->Items, EXTR_SKIP);

From 23b84eaf790d1ca32cd374a7275e0f7869798a94 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8F=99=E8=BF=B0=E3=80=81=E5=88=AB=E7=A6=BB?=
 <93301500+xushubieli@users.noreply.github.com>
Date: Thu, 27 Mar 2025 20:49:36 +0800
Subject: [PATCH 7/7] Update extend.func.php

---
 src/system/extend.func.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/system/extend.func.php b/src/system/extend.func.php
index 6e3cbb58..ff7b2c03 100755
--- a/src/system/extend.func.php
+++ b/src/system/extend.func.php
@@ -38,7 +38,7 @@ function obtaintags($aid, $num = 3)
     }
     return $tags;
 }
-//提取文档多图片[field:body function='obtainimgs(@me,3)'/]3表示调用文档3张图片,则附加字段需添加body字段调用channelid='模型id' addfields='字段1,字段2'
+//提取文档多图片[field:body function='obtainimgs(@me,3)'/]3表示调用文档3张图片,例如:文档模型body字段,列表附加字段添加body,dede:arclist标签调用添加channelid='1' addfields='body'
 if (!function_exists('obtainimgs')) {
     function obtainimgs($string, $num)
     {
@@ -71,7 +71,7 @@ function obtainalt($newalt)
     $newalt = str_ireplace(" /", "", $newalt);
     return $newalt;
 }
-//联动单筛选{dede:php}obtainfilter(模型id,类型,'字段1,字段2');{/dede:php}类型表示前台展现方式对应case值
+//联动单筛选{dede:php}obtainfilter(模型id,类型,'字段1,字段2');{/dede:php}类型表示前台展现方式,对应case值,例如:文档模型style字段radio选项卡类型,列表附加字段类别添加style,标签调用{dede:php}obtainfilter(1,1,'style');{/dede:php}
 function obtainfilter($channelid, $type = 1, $fieldsnamef = '', $defaulttid = 0, $toptid = 0, $loadtype = 'autofield')
 {
     global $tid, $dsql, $id, $aid;