歡迎!
歡迎加入星海市!本伺服器是圍繞MTR模組的建築服,採用問卷審核制。玩法以創造模式為主,伺服器設有WorldEdit插件。
本伺服器由LDior Studio運營,服主為小黃鐵粉和LDior。本服群號為:763812891。
請想要加入伺服器的玩家填寫問卷,仔細閱讀問卷中的須知,我們將通過審核列表內公布結果。之後,請用通過截圖聯繫管理員領取密碼。
綜合信息
在線工具
友情連結
測試
<!DOCTYPE html> <html>
<head>
<title>吃掉小鹿乃-排行榜</title> <meta item="description" content="來看神仙" /> <meta charset="utf-8" /> <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0" /> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<?php
@require 'conn.php';
//最大显示页数
$max_pages = 9;
$lbtype = isset($_GET['lbtype']) ? $_GET['lbtype'] : 'day';
//每页显示数量
$num = 30;
$CurrentPage = isset($_GET['page']) && is_numeric($_GET['page']) ? $_GET['page'] : 1;
$CurrentUser = $_GET['name'];
$offset = ($CurrentPage - 1) * $num;
if ($lbtype == 'day') {
$title = "日";
$cond = "to_days(time) = to_days(now())";
}
if ($lbtype == 'week') {
$title = "周";
$cond = "DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= date(time)";
}
if ($lbtype == 'month') {
$title = "月";
$cond = "DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= date(time)";
}
?>
<nav aria-label="breadcrumb">
</nav>
排行榜(<?php echo $title; ?>榜)
<a href="?lbtype=day<?php echo $CurrentUser ? "&name=" . $CurrentUser : "" ?>"><button type="button" class="btn btn-outline-secondary btn-sm">日榜</button></a> <a href="?lbtype=week<?php echo $CurrentUser ? "&name=" . $CurrentUser : "" ?>"><button type="button" class="btn btn-outline-secondary btn-sm">周榜</button></a> <a href="?lbtype=month<?php echo $CurrentUser ? "&name=" . $CurrentUser : "" ?>"><button type="button" class="btn btn-outline-secondary btn-sm">月榜</button></a>
tips:大家不要作弊哦~ฅ'ω'ฅ♪
<?php
$rank = $offset;
$filtercond = " ORDER BY score DESC limit ?,?;";
$data_sql = "SELECT * FROM " . $ranking . " where " . $cond . $filtercond;
if ($data_stmt = $link->prepare($data_sql)) {
$data_stmt->bind_param("ii", $offset, $num);
$data_stmt->execute();
$data_stmt->store_result();
$data_stmt->bind_result($id, $score, $name, $time, $system, $area, $message, $attempts);
while ($data_stmt->fetch()) {
$rank += 1;
echo "<a href='#' class='list-group-item list-group-item-action'>" . $rank . "位 " . $name . "
" . $time . "SCORE: " . $score . " TRY: " . $attempts . " -" . $system . " -" . $area . "
" . ($message ? $message : "这个人很懒什么也没留下") . "</a>";
}
$data_stmt->close();
}
?>
<nav aria-label="Page navigation example" style="margin-bottom:3em;">
-
<?php
$rows_sql = "SELECT count(*) FROM " . $ranking . " where " . $cond;
$rows_data = mysqli_query($link, $rows_sql);
$rows = mysqli_fetch_row($rows_data)[0];
$rows = $rows > $num * $max_pages ? $num * $max_pages : $rows;
$total = ceil($rows / $num);
if ($total > 1) {
if ($CurrentPage > 1) {
echo "
- <a class='page-link' href='?lbtype=" . $lbtype . "&page=" . ($CurrentPage - 1) . ($CurrentUser ? "&name=" . $CurrentUser : "") . "' aria-label='Previous'></a> "; } for ($p = 1; $p <= $total; $p++) { echo "
- <a class='page-link' href='?lbtype=" . $lbtype . "&page=" . $p . ($CurrentUser ? "&name=" . $CurrentUser : "") . "'>" . $p . "</a> "; } if ($total > $CurrentPage) { echo "
- <a class='page-link' href='?lbtype=" . $lbtype . "&page=" . ($CurrentPage + 1) . ($CurrentUser ? "&name=" . $CurrentUser : "") . "' aria-label='Next'></a> "; } } ?>
</nav>
<footer class='fixed-bottom container'>
<?php
if ($CurrentUser) {
//查询当前名字历史记录
$score_sql = "SELECT score,time,attempts FROM " . $ranking . " where name=?";
$score_stmt = $link->prepare($score_sql);
$score_stmt->bind_param("s", $CurrentUser);
$score_stmt->bind_result($score, $time, $attempts);
$score_stmt->execute();
if ($score_stmt->fetch()) {
echo $CurrentUser . " 的最高记录 已上传" . $attempts . "次
" . "SCORE:" . $score . " " . $time;
} else {
echo "没有找到 " . $CurrentUser . " 的记录(或被过滤)";
}
$score_stmt->close();
} else {
echo "小提示:你玩前还没有填名字";
}
$link->close();
?>
</footer>
</body>
</html>