summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEltrac Koalar <hi@guhub.cn>2022-11-26 10:25:15 +0800
committerEltrac Koalar <hi@guhub.cn>2022-11-26 10:25:15 +0800
commitb501f1b8bab0127f7ea91b52d6ffbc438293b151 (patch)
treecc97d3b9905c09561830ab80c8538484759dc13e
parent350695cbe586a9a761a069aa3c6fe5838429bacf (diff)
🦶 新增:页脚可自定义额外信息
同时将字数统计和不算子统计整合在一起
-rw-r--r--libs/Matcha.php16
-rw-r--r--libs/Options.php10
2 files changed, 13 insertions, 13 deletions
diff --git a/libs/Matcha.php b/libs/Matcha.php
index 3d44de0..616b5d9 100644
--- a/libs/Matcha.php
+++ b/libs/Matcha.php
@@ -357,26 +357,22 @@ class Matcha
*/
static public function footerInfo()
{
+ echo '<br />';
//字数统计
if (Helper::options()->EnableWordsCounter=='able') {
-
- echo '<br />';
- echo '一共书写了';
+ echo '书写了 ';
WordsCounter_Plugin::allOfCharacters();
- echo '字';
- }
- //备案号
- if (Helper::options()->icpNum!='') {
- echo '<br />';
- echo '<a rel="nofollow" href="http://beian.miit.gov.cn"> '.Helper::options()->icpNum.' </a>';
+ echo ' 字';
}
//不蒜子统计
if (Helper::options()->EnableBusuanzi=='able') {
- echo '<br />';
+ if (Helper::options()->EnableWordsCounter=='able') echo ' · ';
echo '<span id="busuanzi_value_site_pv">......</span> 次访问 ·
<span id="busuanzi_value_site_uv">......</span> 位访客 ';
echo '<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>';
}
+ //附加信息
+ if (Helper::options()->footerInfo!='') echo '<div class="footer-info">'.Helper::options()->footerInfo.'</div>';
}
/**
diff --git a/libs/Options.php b/libs/Options.php
index 0d3a014..6cb7596 100644
--- a/libs/Options.php
+++ b/libs/Options.php
@@ -169,15 +169,19 @@ function themeConfig($form) {
* 自定义 & 开发者设置
*/
//自定义时间显示
- $timeFormat = new Typecho_Widget_Helper_Form_Element_Text('timeFormat', NULL, NULL, _t('<h2>开发者设置</h2> 自定义时间格式'), _t('
+ $timeFormat = new Typecho_Widget_Helper_Form_Element_Text('timeFormat', NULL, NULL, _t('<h2>自定义</h2> 自定义时间格式'), _t('
<p class="description">留空则默认采用人性化时间(即“昨天、前天、几天前”),若不想要使用人性化时间则在此填入 PHP 时间格式,例如:<code>Y-m-d G:i:s</code></p>'));
$form->addInput($timeFormat);
+ //自定义页脚附加信息
+ $footerInfo = new Typecho_Widget_Helper_Form_Element_Text('footerInfo', NULL, NULL, _t('页脚附加信息'), _t('
+ <p class="description">将会在显示在 footer 标签结束之前,即页脚版权信息和不算子统计之后,可以在这里写入备案信息等附加内容</p>'));
+ $form->addInput($footerInfo);
//自定义 head
- $customHead = new Typecho_Widget_Helper_Form_Element_Textarea('customHead', NULL, NULL, _t('自定义 head 头部信息'), _t('
+ $customHead = new Typecho_Widget_Helper_Form_Element_Textarea('customHead', NULL, NULL, _t('自定义 head 头部'), _t('
<p class="description">将会输出在 head 标签结束之前,通常用于引入 css 文件。</p>'));
$form->addInput($customHead);
//自定义 footer
- $customFooter = new Typecho_Widget_Helper_Form_Element_Textarea('customFooter', NULL, NULL, _t('自定义 footer 页脚信息'), _t('
+ $customFooter = new Typecho_Widget_Helper_Form_Element_Textarea('customFooter', NULL, NULL, _t('自定义 footer 页脚'), _t('
<p class="description">将会输出在 body 标签结束之前,通常用于引入 js 文件。</p>'));
$form->addInput($customFooter);
//自定义 pjax 回调函数