From 1c4bfa66e6448bb201b70170a88242953fb8aa28 Mon Sep 17 00:00:00 2001
From: Luffy <52o@qq52o.cn>
Date: Wed, 24 Sep 2025 11:29:35 +0800
Subject: [PATCH] Sync news item layout and style
---
include/layout.inc | 12 ++++++------
styles/theme-base.css | 9 ++++++---
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/include/layout.inc b/include/layout.inc
index 83efa1c6bb..17f76b8fd4 100644
--- a/include/layout.inc
+++ b/include/layout.inc
@@ -111,9 +111,9 @@ function print_image($file, $alt = false, $align = false, $extras = false,
// Shortcut to usual news image printing (right floating
// image from the news dir with an alt and an URL)
-function news_image($URL, $image, $alt, $print = true)
+function news_image($URL, $image, $alt, $print = true, $align = 'right')
{
- $str = "" . make_image("news/$image", $alt, "right") . "";
+ $str = "" . make_image("news/$image", $alt, $align) . "";
if ($print) {
echo $str;
}
@@ -372,7 +372,7 @@ function print_news($news, $dog, $max = 5, $return = false) {
$image = "";
if (isset($item["newsImage"])) {
- $image = news_image($item["newsImage"]["link"], $item["newsImage"]["content"], $item["newsImage"]["title"], false);
+ $image = news_image($item["newsImage"]["link"], $item["newsImage"]["content"], $item["newsImage"]["title"], false, '');
}
$id = parse_url($item["id"]);
@@ -405,12 +405,12 @@ function print_news($news, $dog, $max = 5, $return = false) {
echo <<
-
- {$image}
+
-
+
{$image}
{$item["content"]}
diff --git a/styles/theme-base.css b/styles/theme-base.css
index 59b4ad6329..d6f7263cdf 100644
--- a/styles/theme-base.css
+++ b/styles/theme-base.css
@@ -1413,7 +1413,8 @@ aside.tips div.inner {
/* }}} */
/* {{{ News */
-.newsentry header h2 {
+.newsentry header h2,
+.newsItem header h2 {
margin:0;
}
.newsentry {
@@ -1427,7 +1428,8 @@ aside.tips div.inner {
float: right;
opacity: 0.8;
}
-.newsentry header time {
+.newsentry header time,
+.newsItem header time {
float:right;
line-height:3rem;
}
@@ -1436,7 +1438,8 @@ aside.tips div.inner {
line-height: 1.7rem;
}
-.newsentry .newsimage a {
+.newsentry .newsimage a,
+.newsItem .newsImage a {
float: right;
border: 0;
padding: 10px;