From 8814c3dedfcfbbe70ccfcfd10a9fb8a54ac9d6b8 Mon Sep 17 00:00:00 2001 From: Skywt2003 Date: Fri, 3 Dec 2021 14:39:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=20CSS=20&=20?= =?UTF-8?q?=E6=97=A7=E6=96=87=E8=AE=BE=E7=BD=AE=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions.php | 13 ++++++------- header.php | 1 + homepage.php | 1 + post.php | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/functions.php b/functions.php index 8c727dc..9d5807d 100644 --- a/functions.php +++ b/functions.php @@ -21,6 +21,9 @@ function themeConfig($form) { $notificationIcon = new Typecho_Widget_Helper_Form_Element_Text('notificationIcon', NULL, NULL, '网站公告图标', '显示在首页网站公告信息框前的 FontAwesome 图标代码,留空则不显示'); $form->addInput($notificationIcon); + $oldPosts = new Typecho_Widget_Helper_Form_Element_Text('oldPosts', NULL, '365', '文章有效期', '单位:天。在此天数之前发布的文章将会显示「这是一篇旧文」的提示。留空则不显示'); + $form->addInput($oldPosts); + $commentsNotice = new Typecho_Widget_Helper_Form_Element_Text('commentsNotice', NULL, NULL, '评论区公告', '显示在评论区,留空则不显示'); $form->addInput($commentsNotice); @@ -30,15 +33,11 @@ function themeConfig($form) { $headerCode = new Typecho_Widget_Helper_Form_Element_Textarea('headerCode', NULL, NULL, '头部代码', '在头部添加的 HTML 代码,可以插入 JavsScript'); $form->addInput($headerCode); - $footerCode = new Typecho_Widget_Helper_Form_Element_Textarea('footerCode', NULL, NULL, '页脚代码', '在页脚添加的 HTML 代码,可以插入 JavsScript代码'); + $footerCode = new Typecho_Widget_Helper_Form_Element_Textarea('footerCode', NULL, NULL, '页脚代码', '在页脚添加的 HTML 代码,可以插入 JavsScript 代码'); $form->addInput($footerCode); - $oldPosts = new Typecho_Widget_Helper_Form_Element_Radio('oldPosts', - array('able' => '启用', - 'disable' => '禁用', - ), - 'disable', '是否显示旧文提示', '启用则会在一年前发布的文章页面显示“这是一篇旧文”'); - $form->addInput($oldPosts); + $cunstomCSS = new Typecho_Widget_Helper_Form_Element_Textarea('cunstomCSS', NULL, NULL, '自定义 CSS', '加入自定义的 CSS 代码'); + $form->addInput($cunstomCSS); } function themeFields($layout) { diff --git a/header.php b/header.php index cc8143e..675ad5c 100644 --- a/header.php +++ b/header.php @@ -53,6 +53,7 @@ options->headerCode(); ?> + header(); ?> diff --git a/homepage.php b/homepage.php index a2c65fd..5fa6431 100644 --- a/homepage.php +++ b/homepage.php @@ -53,6 +53,7 @@ $this->need('functions.php'); // 不知道为啥,似乎模版页面不会自 options->headerCode(); ?> + header(); ?> diff --git a/post.php b/post.php index d1660bd..00848a8 100644 --- a/post.php +++ b/post.php @@ -27,7 +27,7 @@
date->timeStamp)); $date2=date_create(date('c')); $days=date_diff($date1,$date2); ?> - options->oldPosts == 'able' && $days->format('%a') > 365): ?> + options->oldPosts != '' && $days->format('%a') > $this->options->oldPosts): ?>