木漏茶室源码下载中心
整站 PHP 源码:可浏览文件、复制路径、下载单文件或打包 ZIP。
发布版本 v6.25.232
升级后自动生成独立源码包,下载中心只发送这份冻结包
已排除 config.php / 用户数据 / 上传文件 / 升级备份
COMMUNITY DEPLOYMENTS
已经跑起来的木漏茶室
从源码下载中心下载、完成安装并回传验证的站外站点。每个站点只计 1 次部署下载量;已记录站点会实时读取名称、版本、Logo 与在线状态,本机、内网和证书异常站点无法完成回传。
实时检测
2
个站点已部署
木
木漏茶室
mlcs.xnn.lol · v6.25.232
访问 ↗
2026.11.21
在线
木
木漏茶室
mlcs.nbnb.mom · v6.25.232
访问 ↗
2026.11.20
在线
已展示全部 2 个站点。
pages/announcements.php
3.7 KB · 发布包 v6.25.232
<?php
/**
* 公告列表
*/
$me = current_user();
if ($_SERVER['REQUEST_METHOD'] === 'POST' && input('act') === 'delete') {
if (!$me || !is_admin($me)) {
http_response_code(403);
exit('只有管理员和超级管理员可以删除公告');
}
check_csrf();
$id = (int) input('id');
if ($id > 0 && announcement_by_id($id)) {
DB::delete('announcements', 'id = ?', [$id]);
flash('公告已删除');
} else {
flash('公告不存在或已被删除', 'err');
}
redirect(page_url('announcements'));
}
$kind = trim((string) input('kind', ''));
$where = 'a.status = 1';
$params = [];
if ($kind !== '' && array_key_exists($kind, announcement_kinds())) {
$where .= ' AND a.kind = ?';
$params[] = $kind;
}
$rows = DB::all('SELECT a.*, u.nickname, u.username, u.avatar, u.verified, u.verify_style, u.verify_title, u.role, u.is_official
FROM ' . DB::table('announcements') . ' a
LEFT JOIN ' . DB::table('users') . ' u ON u.id = a.author_id
WHERE ' . $where . ' ORDER BY a.id DESC LIMIT 200', $params);
$GLOBALS['PAGE'] = 'announcements';
render_header('公告列表');
?>
<section class="notice-page">
<div class="notice-page-head">
<span class="hero-kicker">NOTICE</span>
<h1>公告列表</h1>
<p>共 <?= count($rows) ?> 条公告 · 弹窗公告与滚动横幅公告都在这里</p>
</div>
<div class="notice-filter">
<a class="chip <?= $kind === '' ? 'on' : '' ?>" href="<?= e(page_url('announcements')) ?>">全部</a>
<?php foreach (announcement_kinds() as $key => $label): ?>
<a class="chip <?= $kind === $key ? 'on' : '' ?>" href="<?= e(page_url('announcements', ['kind' => $key])) ?>"><?= e($label) ?></a>
<?php endforeach; ?>
</div>
</section>
<section class="notice-list">
<?php if (!$rows): ?>
<?php empty_state('还没有公告', '茶室暂时没有新的消息'); ?>
<?php else: ?>
<?php foreach ($rows as $r): ?>
<?php $author = announcement_author($r); ?>
<article class="notice-card">
<div class="notice-card-head">
<div class="notice-author">
<?php if ($author): ?><?= verified_avatar_html($author, 'notice-avatar', 'notice-avatar-wrap') ?><?php endif; ?>
<div>
<strong><?= e(display_name($author) ?: '管理员') ?></strong>
<?php if ($author): ?><?= verify_badge($author, true) ?><?php endif; ?>
<span><?= $author && is_official_account($author) ? '官方固定账号 · ' : '' ?><?= e($author ? username_visible($author) : '') ?> · <?= e($r['created_at']) ?></span>
</div>
</div>
<span class="announcement-kind-pill"><?= e(announcement_kind_label($r['kind'])) ?></span>
</div>
<h2><?= e($r['title']) ?></h2>
<p class="notice-excerpt"><?= e(announcement_excerpt($r, 120)) ?></p>
<div class="notice-card-actions">
<a class="btn-mini" href="<?= e(page_url('announcement', ['id' => (int) $r['id']])) ?>">查看详情</a>
<?php if ($me && is_admin($me)): ?>
<a class="btn-mini ghost" href="<?= e(page_url('admin', ['s' => 'announcements', 'id' => (int) $r['id']])) ?>">修改</a>
<form method="post" class="inline-form" data-confirm="确定删除这条公告?">
<?= csrf_field() ?>
<input type="hidden" name="act" value="delete">
<input type="hidden" name="id" value="<?= (int) $r['id'] ?>">
<button class="btn-mini danger" type="submit">删除</button>
</form>
<?php endif; ?>
</div>
</article>
<?php endforeach; ?>
<?php endif; ?>
</section>
<?php render_footer(); ?>