From 9f8079845285250ded656ca5720cf2bb57d6b407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=AA=E5=AD=90?= Date: Fri, 27 Jun 2025 17:29:49 +0800 Subject: [PATCH] 1.0.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 兼容1.3.0 --- card.php | 2 +- index.php | 5 +++-- sidebar.php | 36 ++++++++++++++++++++++-------------- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/card.php b/card.php index c7e1ddf..21864b2 100644 --- a/card.php +++ b/card.php @@ -3,7 +3,7 @@ next()): ?> content, $this->cid); -$colors = ['bg-primary', 'bg-secondary', 'bg-success', 'bg-danger', 'bg-warning', 'bg-info', 'bg-transparent', 'bg-gradient']; +$colors = ['bg-primary', 'bg-secondary', 'bg-success', 'bg-danger', 'bg-warning', 'bg-info']; ?>
diff --git a/index.php b/index.php index 41aec30..6ee3726 100644 --- a/index.php +++ b/index.php @@ -4,7 +4,7 @@ * * @package Typecho Pouck Theme * @author 老孙博客 - * @version 1.0.1 + * @version 1.0.3 * @link http://www.imsun.org */ @@ -22,6 +22,7 @@ $this->need('sticky.php'); next()): ?> content, $this->cid); +$colors = ['bg-primary', 'bg-secondary', 'bg-success', 'bg-danger', 'bg-warning', 'bg-info']; ?>
@@ -34,7 +35,7 @@ $coverImage = getPostCover($this->content, $this->cid);

isSticky) && $this->isSticky): ?>stickyHtml; ?> categories as $category): ?> - + diff --git a/sidebar.php b/sidebar.php index 54c1814..1686d9a 100644 --- a/sidebar.php +++ b/sidebar.php @@ -110,7 +110,9 @@ if ($totalViews === null) $totalViews = 0; 'table.contents.authorId', 'table.contents.type', 'table.contents.status', - 'table.contents.commentsNum' + 'table.contents.commentsNum', + 'table.contents.order', + 'table.contents.template' ) ->from('table.contents') ->where('table.contents.type = ?', 'post') @@ -136,17 +138,23 @@ if ($totalViews === null) $totalViews = 0;
widget('Widget_Archive@post_' . $post['cid'], 'type=post'); try { - $post = $widget->filter($post); - if (empty($post['title']) || empty($post['slug'])) { - continue; // 跳过无效数据 - } - $post['title'] = htmlspecialchars($post['title']); - $post['slug'] = htmlspecialchars($post['slug']); - if (empty($post['permalink'])) { - $post['permalink'] = Typecho_Common::url($post['slug'], $this->options->index); + $widget->setArchiveProperty('cid', $post['cid']); + $widget->setArchiveProperty('title', $post['title']); + $widget->setArchiveProperty('slug', $post['slug']); + $widget->setArchiveProperty('created', $post['created']); + $widget->setArchiveProperty('authorId', $post['authorId']); + $widget->setArchiveProperty('type', $post['type']); + $widget->setArchiveProperty('status', $post['status']); + $widget->setArchiveProperty('commentsNum', $post['commentsNum']); + + // 生成正确链接 + $permalink = $widget->archiveUrl; + + if (empty($post['title']) || empty($permalink)) { + continue; } } catch (Exception $e) { continue; @@ -157,7 +165,7 @@ if ($totalViews === null) $totalViews = 0; + href="">

@@ -202,8 +210,8 @@ if ($totalViews === null) $totalViews = 0; have()): - // 定义可用的颜色类数组 -$colors = ['bg-primary', 'bg-secondary', 'bg-success', 'bg-danger', 'bg-warning', 'bg-info', 'bg-transparent', 'bg-gradient']; +// 定义可用的颜色类数组 +$colors = ['bg-primary', 'bg-secondary', 'bg-success', 'bg-danger', 'bg-warning', 'bg-info']; ?>