From 05a83e5879a56ac29c0a05e1c6a6ccde9dc8087c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=AA=E5=AD=90?= Date: Thu, 26 Jun 2025 19:35:46 +0800 Subject: [PATCH] 1.0.1 --- .gitignore | 1 + README.MD | 1 + card.php | 65 +++++++++++++++++++ comments.php | 71 ++++++++++++++++++++- footer.php | 2 +- functions.php | 7 ++- index.php | 6 +- page-talks.php | 166 +++++++++++++++++++++++++++++++++++++++++++++++++ post.php | 4 +- sidebar.php | 6 +- 10 files changed, 318 insertions(+), 11 deletions(-) create mode 100644 .gitignore create mode 100644 page-talks.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/README.MD b/README.MD index 7ff1c9f..c4a8400 100644 --- a/README.MD +++ b/README.MD @@ -18,6 +18,7 @@ 2. 在后台管理界面启用该主题。 3. 根据需要自定义主题设置。 4. 主题部分功能需要安装插件`Puock`。项目地址: [Puock Plugin](https://github.com/jkjoy/typecho-plugin-puock) +5. 友情链接功能需要使用插件`Links`。项目地址: [Links Plugin](https://file.imsun.org/upload/2025-06/Links-1.2.7.zip),首页友情链接需要在`友链分类`中添加分类`home`。 ### 主题配置 diff --git a/card.php b/card.php index e69de29..0e61b4b 100644 --- a/card.php +++ b/card.php @@ -0,0 +1,65 @@ + +
+next()): ?> +content, $this->cid); +?> + + +
\ No newline at end of file diff --git a/comments.php b/comments.php index 303a04a..819f0d9 100644 --- a/comments.php +++ b/comments.php @@ -224,4 +224,73 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/footer.php b/footer.php index b3647a0..35444d6 100644 --- a/footer.php +++ b/footer.php @@ -13,7 +13,7 @@ diff --git a/functions.php b/functions.php index ce06c8c..7676475 100644 --- a/functions.php +++ b/functions.php @@ -297,7 +297,7 @@ function get_permalink($cid) { $post['type'] = 'post'; // 确保类型为文章 $post = Typecho_Widget::widget('Widget_Abstract_Contents')->filter($post); // 使用文章对象的 permalink 方法生成链接 - return $post['permalink']; + return $post['permalink'] ?? ''; } catch (Exception $e) { // 出现异常时使用最简单的方式 $options = Helper::options(); @@ -678,7 +678,10 @@ function getBrowsersInfo ($userAgent) { * @return mixed|void */ function pregMatch($reg, $sourceData) { - if (preg_match($reg, $sourceData, $mat)) return $mat[1]; + if (preg_match($reg, $sourceData, $mat)) { + return $mat[1] ?? ''; + } +return ''; } /** diff --git a/index.php b/index.php index 6afed68..41aec30 100644 --- a/index.php +++ b/index.php @@ -4,7 +4,7 @@ * * @package Typecho Pouck Theme * @author 老孙博客 - * @version 1.0 + * @version 1.0.1 * @link http://www.imsun.org */ @@ -17,6 +17,7 @@ $this->need('sticky.php');
+options->listmodel): ?>
next()): ?> have()):
+ +need('card.php'); ?> +
diff --git a/page-talks.php b/page-talks.php new file mode 100644 index 0000000..0bb3f73 --- /dev/null +++ b/page-talks.php @@ -0,0 +1,166 @@ + +need('header.php'); ?> + -need('comments.php'); ?> - +need('comments.php'); ?> options->articlefoot): ?>
options->articlefoot(); ?>
+ need('sidebar.php'); ?> need('footer.php'); ?> \ No newline at end of file diff --git a/sidebar.php b/sidebar.php index f70d4a7..54c1814 100644 --- a/sidebar.php +++ b/sidebar.php @@ -167,7 +167,6 @@ if ($totalViews === null) $totalViews = 0; - options->sidebarBlock) && in_array('ShowRecentComments', $this->options->sidebarBlock)): ?> options->sidebarBlock) && in_array('ShowTags', $this->options->sidebarBlock)): ?> have()): // 定义可用的颜色类数组 - $colors = ['bg-primary', 'bg-secondary', 'bg-success', 'bg-danger', 'bg-warning', 'bg-info']; +$colors = ['bg-primary', 'bg-secondary', 'bg-success', 'bg-danger', 'bg-warning', 'bg-info', 'bg-transparent', 'bg-gradient']; ?>
@@ -226,6 +225,5 @@ if ($tags->have()):
-
\ No newline at end of file