From 5cd5778ab73d173c3c5d8581aaea98e8465eb519 Mon Sep 17 00:00:00 2001 From: Luffy Date: Wed, 1 Oct 2025 13:52:31 +0800 Subject: [PATCH] Sync news item layout and style (#1451) --- 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 83efa1c6b..17f76b8fd 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}
+
+

{$item["title"]}

-
+
{$image}
{$item["content"]}
diff --git a/styles/theme-base.css b/styles/theme-base.css index 59b4ad632..d6f7263cd 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;