木漏茶室源码下载中心
整站 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/followers.php
3.3 KB · 发布包 v6.25.232
<?php
/**
* 关注 / 粉丝列表
*/
require_login();
$me = current_user();
$uid = (int) input('id', (int) $me['id']);
$user = user_by_id($uid);
if (!$user) { render_header('用户不存在'); empty_state('没有找到这位茶客'); render_footer(); return; }
$tab = input('tab') === 'following' ? 'following' : 'followers';
if ($_SERVER['REQUEST_METHOD'] === 'POST' && input('act') === 'follow') {
check_csrf();
$target = (int) input('target');
if ($target > 0 && $target !== (int) $me['id']) {
$on = follow_toggle((int) $me['id'], 'user', $target);
if ($on) { notification_insert($target, (int) $me['id'], 'follow', (int) $me['id'], display_name($me) . ' 关注了你', page_url('user', ['id' => (int) $me['id']])); }
flash($on ? '已关注' : '已取消关注');
}
redirect(page_url('followers', ['id' => $uid, 'tab' => $tab]));
}
$rows = $tab === 'followers'
? DB::all('SELECT u.*, f.created_at AS follow_at FROM ' . DB::table('follows') . ' f INNER JOIN ' . DB::table('users') . ' u ON u.id = f.follower_id WHERE f.target_type = ? AND f.target_id = ? AND u.status = 1 ORDER BY f.id DESC LIMIT 100', ['user', $uid])
: DB::all('SELECT u.*, f.created_at AS follow_at FROM ' . DB::table('follows') . ' f INNER JOIN ' . DB::table('users') . ' u ON u.id = f.target_id WHERE f.follower_id = ? AND f.target_type = ? AND u.status = 1 ORDER BY f.id DESC LIMIT 100', [$uid, 'user']);
$GLOBALS['PAGE'] = 'followers';
render_header(($tab === 'followers' ? '关注 ' . display_name($user) . ' 的人' : display_name($user) . ' 关注的人'));
?>
<section class="panel">
<div class="panel-head row">
<div><h2 class="section-title"><?= e(display_name($user)) ?></h2><p class="muted">关注关系会同步显示在用户主页。</p></div>
<a class="btn-mini" href="<?= e(page_url('user', ['id' => $uid])) ?>">返回主页</a>
</div>
<div class="tabs-row">
<a class="chip <?= $tab === 'followers' ? 'on' : '' ?>" href="<?= e(page_url('followers', ['id' => $uid, 'tab' => 'followers'])) ?>">关注 TA 的人</a>
<a class="chip <?= $tab === 'following' ? 'on' : '' ?>" href="<?= e(page_url('followers', ['id' => $uid, 'tab' => 'following'])) ?>">TA 关注的人</a>
</div>
<?php if (!$rows): ?>
<?php empty_state('这里还是空的', '关注喜欢的茶客,动态就会出现在首页「关注」'); ?>
<?php else: ?>
<div class="user-grid">
<?php foreach ($rows as $u): $following = follow_is((int) $me['id'], 'user', (int) $u['id']); ?>
<div class="user-cell">
<a class="uc-avatar" href="<?= e(page_url('user', ['id' => $u['id']])) ?>"><?= avatar_img($u, 'uc-img') ?></a>
<a class="uc-name" href="<?= e(page_url('user', ['id' => $u['id']])) ?>"><?= e(display_name($u)) ?></a>
<?php if ((int) $u['id'] !== (int) $me['id']): ?>
<form method="post" class="inline-form">
<?= csrf_field() ?><input type="hidden" name="act" value="follow"><input type="hidden" name="target" value="<?= (int) $u['id'] ?>">
<button class="btn-mini <?= $following ? 'ghost' : '' ?>" type="submit"><?= $following ? '已关注' : '关注' ?></button>
</form>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
</section>
<?php render_footer(); ?>