首页

来自星海市轨道交通建设 · 2024年10月
LDior留言 | 贡献2022年1月23日 (日) 11:26的版本

欢迎!

欢迎加入星海市!本服务器是围绕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
   $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>