From f4b27f5b3f7792184d189089805ed557c22b567c Mon Sep 17 00:00:00 2001 From: Kaiyu Chen Date: Fri, 31 Mar 2023 17:37:06 +0100 Subject: add customise track URL for umami --- libs/Matcha.php | 4 ++-- libs/Options.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/Matcha.php b/libs/Matcha.php index 047150a..aa4e71c 100644 --- a/libs/Matcha.php +++ b/libs/Matcha.php @@ -411,8 +411,8 @@ class Matcha //附加信息 if (Helper::options()->footerInfo!='') echo ''; //umami - if (Helper::options()->umamiID!='') { - echo ''; + if (Helper::options()->umamiID!='' && Helper::options()->umamiURL!='') { + echo ''; } } diff --git a/libs/Options.php b/libs/Options.php index bacfe6c..80eb83e 100644 --- a/libs/Options.php +++ b/libs/Options.php @@ -59,6 +59,8 @@ function themeConfig($form) { $form->addInput($icpNum); $startDate = new Typecho_Widget_Helper_Form_Element_Text('startDate', NULL, date('Y-m-d'), _t('网站建立日期'), _t('用于显示在页脚的版权信息,以及计算网站建立时长,格式为 Y-m-d')); $form->addInput($startDate); + $umamiURL = new Typecho_Widget_Helper_Form_Element_Text('umamiURL', NULL, NULL, _t('umami Website URL'), _t('在这里填入对应域名的 Umami Track URL(如 https://analytics.umami.is/script.js ),留空则不开启功能')); + $form->addInput($umamiID); $umamiID = new Typecho_Widget_Helper_Form_Element_Text('umamiID', NULL, NULL, _t('umami Website ID'), _t('在这里填入对应域名的 Umami Website ID(如 9caf0ded-6e8e-409c-9ds4-231fe253a8ac ),留空则不开启功能')); $form->addInput($umamiID); -- cgit v1.2.3