From 6fc5673e9aa6cdbe29c96605780ec1dbe3dd8aa5 Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Tue, 15 Jul 2025 17:29:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E5=85=AC=E5=91=8A=E9=A1=B5=E9=9D=A2=E5=92=8C=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E6=A0=BC=E5=BC=8F=E5=8C=96=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增历史公告页面,显示所有公告并按发布时间倒序排列 - 在公告页面添加查看历史公告的链接 - 添加文件大小格式化函数,改进下载文件大小显示 - 修复文件路径处理逻辑,增强路径解析的可靠性 - 更新配置文件中的敏感信息 --- history_announcements.php | 148 ++++++++++++++++++++++++++++++++++++++ index.php | 1 + version_list.php | 62 +++++++++++++++- 3 files changed, 210 insertions(+), 1 deletion(-) create mode 100644 history_announcements.php diff --git a/history_announcements.php b/history_announcements.php new file mode 100644 index 0000000..c4e539c --- /dev/null +++ b/history_announcements.php @@ -0,0 +1,148 @@ +swal("错误", "数据库连接失败", "error");'; + exit; +} + +// 查询所有公告,按发布时间倒序 +$sql = "SELECT id, title, content, created_at FROM announcements ORDER BY created_at DESC"; +$result = $conn->query($sql); + +?> + + + + + + + 历史公告 - <?php echo APP_STORE_NAME; ?> + + + + + + + + + + + + + + + +
+

历史公告

+ + num_rows > 0): ?> +
+ fetch_assoc()): ?> +
+

+

+
+
+ +
+ +
+ 暂无历史公告记录。 +
+ +
+ + + + \ No newline at end of file diff --git a/index.php b/index.php index 7be5ea0..f8a4483 100644 --- a/index.php +++ b/index.php @@ -101,6 +101,7 @@ $announcement = $announcementResult && $announcementResult->num_rows > 0 ? $anno

+

查看所有历史公告

diff --git a/version_list.php b/version_list.php index 6f5ef39..4131a78 100644 --- a/version_list.php +++ b/version_list.php @@ -1,6 +1,23 @@ = 1073741824) { + return number_format($bytes / 1073741824, 2) . ' GB'; + } elseif ($bytes >= 1048576) { + return number_format($bytes / 1048576, 2) . ' MB'; + } elseif ($bytes >= 1024) { + return number_format($bytes / 1024, 2) . ' KB'; + } elseif ($bytes > 0) { + return $bytes . ' B'; + } else { + return '0 B'; + } +} + + // 验证App ID if (!isset($_GET['id']) || !is_numeric($_GET['id'])) { header('Location: index.php?error=无效的App ID'); @@ -125,7 +142,50 @@ while ($row = $result->fetch_assoc()) {