From 57e4bac347abd71ec36f8502faec70e557a5868d Mon Sep 17 00:00:00 2001 From: nicocatxzc <114812330+nicocatxzc@users.noreply.github.com> Date: Tue, 26 Nov 2024 22:24:09 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=A1=A8?= =?UTF-8?q?=E6=83=85=E8=AE=BE=E7=BD=AE=E6=B7=BB=E5=8A=A0=E8=AF=A6=E7=BB=86?= =?UTF-8?q?=E7=9A=84=E8=B7=AF=E5=BE=84=E4=BF=A1=E6=81=AF=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/functions.php b/functions.php index 80df4841..af1f9f75 100644 --- a/functions.php +++ b/functions.php @@ -1306,6 +1306,11 @@ function get_custom_smilies_list() return $custom_smilies_list; } + echo "
调试信息:
+- 表情目录设置为: $custom_smilies_dir
+- 实际读取的路径为: $custom_smilies_path
+
"; + $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($custom_smilies_path), RecursiveIteratorIterator::LEAVES_ONLY); foreach ($files as $file) { if ($file->isFile()) { From 3d6f1fe61d624cda9e4979df70ffabfaefcf963b Mon Sep 17 00:00:00 2001 From: nicocatxzc <114812330+nicocatxzc@users.noreply.github.com> Date: Wed, 27 Nov 2024 11:49:13 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E9=A1=B5=E5=88=A4=E6=96=AD=EF=BC=8C=E4=BB=85=E5=9C=A8=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=A1=B5=E8=B0=83=E7=94=A8=E6=89=8D=E4=BC=9A=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E8=B0=83=E8=AF=95=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index af1f9f75..3112ab27 100644 --- a/functions.php +++ b/functions.php @@ -1306,10 +1306,10 @@ function get_custom_smilies_list() return $custom_smilies_list; } - echo "
调试信息:
+    if (is_admin()) {echo "
调试信息:
 - 表情目录设置为: $custom_smilies_dir
 - 实际读取的路径为: $custom_smilies_path
-
"; +
";}; $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($custom_smilies_path), RecursiveIteratorIterator::LEAVES_ONLY); foreach ($files as $file) { From 4a05c7a93cc929cb01f10d92636487c26b65496c Mon Sep 17 00:00:00 2001 From: nicocatxzc <114812330+nicocatxzc@users.noreply.github.com> Date: Wed, 27 Nov 2024 19:24:22 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E8=BE=93=E5=87=BA=E9=83=A8=E5=88=86=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8B=B1=E8=AF=AD=E8=B0=83=E8=AF=95=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions.php | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/functions.php b/functions.php index 3112ab27..dd1ee3fa 100644 --- a/functions.php +++ b/functions.php @@ -1306,11 +1306,6 @@ function get_custom_smilies_list() return $custom_smilies_list; } - if (is_admin()) {echo "
调试信息:
-- 表情目录设置为: $custom_smilies_dir
-- 实际读取的路径为: $custom_smilies_path
-
";}; - $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($custom_smilies_path), RecursiveIteratorIterator::LEAVES_ONLY); foreach ($files as $file) { if ($file->isFile()) { @@ -1357,8 +1352,31 @@ function update_custom_smilies_list() delete_transient("custom_smilies_list"); $custom_smilies_list = get_custom_smilies_list(); $much = count($custom_smilies_list); - echo '自定义表情列表更新完成!总共有' . $much . '个表情。'; - } + $custom_smilies_dir = iro_opt('smilies_dir'); + $custom_smilies_path = wp_get_upload_dir()['basedir'] . $custom_smilies_dir; + echo '自定义表情列表更新完成!总共有' . $much . '个表情。
'; + echo 'Custom smilies updated!Total' . $much . '.'; + echo "
调试信息:
+        - 表情目录设置为: $custom_smilies_dir
+        - 实际读取的路径为: $custom_smilies_path
+        Debug info:
+        - Smilies path set is: $custom_smilies_dir
+        - The directory actually read is: $custom_smilies_path
+        
+

以下图片已被收录至自定义表情中(The following images have been included in the custom emoticons):

"; + } + if (!empty($custom_smilies_list)) { + echo ''; + } else { + echo '

没有任何图片被加入表情包中。

'; + } } update_custom_smilies_list(); From 0690f050a2a437ac254c537775997685ab06d6a3 Mon Sep 17 00:00:00 2001 From: nicocatxzc <114812330+nicocatxzc@users.noreply.github.com> Date: Wed, 27 Nov 2024 19:52:12 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions.php b/functions.php index dd1ee3fa..65193fdc 100644 --- a/functions.php +++ b/functions.php @@ -1375,7 +1375,7 @@ function update_custom_smilies_list() } echo ''; } else { - echo '

没有任何图片被加入表情包中。

'; + echo '

没有任何图片被加入表情包中(No emoticons found)。

'; } } update_custom_smilies_list();