From 4d7652218f4fd48c82f79560cd9f054ecd504ad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=AA=E5=AD=90?= Date: Tue, 25 Mar 2025 15:59:13 +0800 Subject: [PATCH] 0.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 判断文章是否是memos分类,如果是则显示memos分类的样式 --- module/postlist.php | 145 +++++++++++++++++++++++++------------------- 1 file changed, 81 insertions(+), 64 deletions(-) diff --git a/module/postlist.php b/module/postlist.php index 6fc8b18..e76850f 100644 --- a/module/postlist.php +++ b/module/postlist.php @@ -1,66 +1,83 @@ next()): ?> -
-
-

- - title() ?> - created) < 60*60*24*3): ?> - - - - - - -

-
- fields->summary){ - echo $this->fields->summary; - } else { - $this->excerpt(180); - }?> -
-
- - - - - - - - - category(','); ?> - - - - - - - commentsNum('0 ', '1 ', '%d '); ?> -
-
- cid); - $cover = $this->fields->cover; - $imageToDisplay = !empty($cover) ? $cover : $firstImage; - if($imageToDisplay): + categories; + $memosMid = $this->options->memos; // 获取主题设置中的说说分类 mid + $isMemos = false; + + // 检查当前文章是否属于说说分类 + foreach ($categories as $category) { + if ($category['mid'] == $memosMid) { + $isMemos = true; + break; + } + } + + // 根据是否为说说分类使用不同的显示模板 + if ($isMemos): ?> - - <?php $this->title() ?> - - -
- \ No newline at end of file +
+ +
+ +
+
+

+ + title() ?> + created) < 60*60*24*3): ?> + + + + + +

+
+ fields->summary){ + echo $this->fields->summary; + } else { + $this->excerpt(180); + }?> +
+
+ + + + category(','); ?> + + + + + + commentsNum('0 ', '1 ', '%d '); ?> +
+
+ cid); + $cover = $this->fields->cover; + $imageToDisplay = !empty($cover) ? $cover : $firstImage; + if($imageToDisplay): + ?> + + <?php $this->title() ?> + + +
+ + \ No newline at end of file