2.1 版本文件

This commit is contained in:
2026-08-14 10:55:06 +08:00
commit a3434ec620
67 changed files with 12559 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
<?php
// 前台公告中心
require __DIR__ . '/includes/init.php';
$pageTitle = '公告中心';
$list = db()->query(
'SELECT * FROM ' . tn('announcements') . ' WHERE status = 1 ORDER BY pinned DESC, created_at DESC'
)->fetchAll();
require 'includes/header.php';
?>
<section class="section">
<h2 class="sec-title"><i class="fas fa-bullhorn"></i> 公告中心</h2>
<?php if (empty($list)): ?>
<p class="empty">暂无公告。</p>
<?php else: ?>
<div class="ann-list">
<?php foreach ($list as $a):
$excerpt = mb_substr(preg_replace('/\s+/', ' ', $a['content']), 0, 90);
if (mb_strlen($a['content']) > 90) $excerpt .= '…';
?>
<article class="ann-card">
<a class="ann-card-link" href="announcement?id=<?= (int)$a['id'] ?>">
<div class="ann-head">
<h3 class="ann-title"><?= h($a['title']) ?></h3>
<?php if (!empty($a['pinned'])): ?><span class="ann-pin"><i class="fas fa-thumbtack"></i> 置顶</span><?php endif; ?>
</div>
<div class="ann-time"><i class="far fa-clock"></i> <?= date('Y-m-d H:i', strtotime($a['created_at'])) ?></div>
<p class="ann-excerpt"><?= h($excerpt) ?></p>
<span class="ann-read">查看详情 <i class="fas fa-chevron-right"></i></span>
</a>
</article>
<?php endforeach; ?>
</div>
<?php endif; ?>
</section>
<?php require 'includes/footer.php'; ?>