nows/index.php

92 lines
2.7 KiB
PHP
Raw Normal View History

2023-11-25 15:18:09 +08:00
<?php
2023-11-25 20:48:00 +08:00
error_reporting(0);
2023-11-25 15:18:09 +08:00
ob_start();
session_start();
require("data.php");
require("track.php");
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
2023-11-26 12:13:40 +08:00
<title>mi鸡汤</title>
<meta name="description" content="mihomo游戏鸡汤">
<meta name="keywords" content="米哈游, mihoyo, 原神, 崩铁, 崩坏:星穹铁道, 鸡汤">
<link rel="icon" href="/favicon.ico" id="page_favionc">
2023-11-25 15:18:09 +08:00
<link href="./css/min.css" rel="stylesheet">
</head>
<body>
<div class="top-wrap" style="position: absolute; top: 1vh;width: 100%;z-index: 999">
<div class="container">
<div class="row" style="margin-top: 30px;">
2023-11-25 21:08:33 +08:00
<div class="col" style="display: flex; align-items: center;">
2023-11-26 12:13:40 +08:00
<a href="/"><img src="./img/logo.png"></a>
2023-11-25 15:18:09 +08:00
</div>
2023-11-25 21:08:33 +08:00
<div class="col" style="display: flex; align-items: center; justify-content: flex-end;">
<div class="float-right" style="margin: 10px;">
2023-11-25 16:00:25 +08:00
<a class="btn btn-primary btn-filled btn-xs" href="https://git.loliquq.cn/earthjasonlin/nows/issues/new?template=.github%2fISSUE_TEMPLATE%2fnew.yml">提交句子</a>
2023-11-25 15:18:09 +08:00
</div>
2023-11-25 21:08:33 +08:00
<div class="float-right" style="margin: 10px;">
<a class="btn btn-primary btn-filled btn-xs" href="https://git.loliquq.cn/earthjasonlin/nows/wiki">API文档</a>
</div>
2023-11-25 15:18:09 +08:00
</div>
</div>
</div>
</div>
<div class="main-wrapper" style="position: relative; top: -6vh;">
<div class="container main-sentence justify-content-center text-center">
<?php
//查询随机一条记录
$sql = "SELECT * FROM soul ORDER BY RAND() LIMIT 1";
$result = mysqli_query($conn, $sql);
2023-11-26 08:11:18 +08:00
$id;
2023-11-25 15:18:09 +08:00
while ($row = mysqli_fetch_assoc($result)) {
2023-11-26 08:11:18 +08:00
$id = $row["id"];
2023-11-25 15:18:09 +08:00
?>
<div id="sentence" style="font-size: 2rem;">
<?php echo $row["title"] ?>
</div>
<?php
if ($row["author"] != NULL) {
?>
<div id="author" style="font-size: 1.5rem;">
2023-11-25 17:41:02 +08:00
——<?php echo $row["author"] ?>
</div>
<?php
}
if ($row["from"] != NULL) {
?>
<div id="from" style="font-size: 1.5rem; color: dimgray;">
<i><?php echo $row["from"] ?></i>
2023-11-25 15:18:09 +08:00
</div>
<?php
}
}
?>
</div>
</div>
<div class="foot-1" style="position: absolute; bottom: 7vh;width: 100%;">
<div class="container">
<div class="row">
<div class="col text-center">
<span class="btn btn-primary btn-filled btn-xs"><a class="btn btn-primary btn-filled btn-xs" href="/">再来一句</a></span>
</div>
</div>
2023-11-26 08:11:18 +08:00
<div class="row">
<div class="col text-center">
<span style="color:#fff;"><?php echo "id.", $id, " ver.", substr(shell_exec('git rev-parse HEAD'), 0, 10); ?></span>
</div>
</div>
2023-11-25 15:18:09 +08:00
</div>
</div>
</body>
</html>