199 lines
6.5 KiB
PHP
199 lines
6.5 KiB
PHP
<!-- 主页 -->
|
|
<html>
|
|
<head>
|
|
<title>首页 | ww3</title>
|
|
<meta charset="utf-8" lang="zh-CN">
|
|
<link rel="icon" type="image/x-icon" href="./icon/original.ico">
|
|
<!-- 引入页面蓝图css -->
|
|
<link rel="stylesheet" type="text/css" href="./src/css/main.css">
|
|
</head>
|
|
<body>
|
|
<div id="app-canvas">
|
|
|
|
<header>
|
|
<h1 style="margin: 80px 0 0 0; color:aqua;">open-ww3-project</h1>
|
|
</header>
|
|
<!-- 导航栏 -->
|
|
<div id="navbar1">
|
|
<table border="0" style="background-color: rgba(147, 185, 255, 0.644);">
|
|
<tbody>
|
|
<tr>
|
|
<td id="td_navbar_40px"><b><a href="https://ww3.tw/" id="url_">首页</a></b></td>
|
|
<td id="td_navbar_40px"><b><a href="https://ww3.tw/blog/about/" id="url_">关于</a></b></td>
|
|
<td id="td_navbar_40px"><b><a href="https://ww3.tw/blog/post/" id="url_">文章</a></b></td>
|
|
<td id="td_navbar_75px"><b><a href="https://ww3.tw/jumping-message/" id="url_">弹幕留言</a></b></td>
|
|
<td id="td_navbar_78px"><b><a href="https://ww3.tw/short-url/" id="url_">短链生成</a></b></td>
|
|
<td id="td_navbar_52px"><b><a href="https://gitea.ww3.tw/skimrme/" id="url_">gitea</a></b></td>
|
|
<td id="td_navbar_160px"><b><a href="https://ww3.tw/docker-registry/" id="url_">docker-registry</a></b></td>
|
|
<td id="td_navbar_40px"><b><a href="https://api.ww3.tw/" id="url_">api</a></b></td>
|
|
<td id="td_navbar_40px"><b><a href="https://wiki.ww3.tw/" id="url_">wiki</a></b></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- 导航栏 -->
|
|
<div id="content-area">
|
|
<!--div>
|
|
<img id="open-ww3-project-img" width="10%" src="../src/img/open-ww3-project.png" alt="open-ww3-project-img">
|
|
</div-->
|
|
<!-- 屑站日志 -->
|
|
<h3 style="margin: 70px 0 30px -50px;">屑站日志:<br></h3>
|
|
<div id="logs">
|
|
<font size="3.2">
|
|
<table border="0">
|
|
<tbody>
|
|
<?php
|
|
// 引入数据库 sqlite
|
|
include "./logs.php.text";
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
</font>
|
|
</div>
|
|
<!-- 屑站日志 -->
|
|
|
|
<div id="post_content">
|
|
<?php
|
|
//include "post/index.php";
|
|
// 设定数据库路径
|
|
$db_path = '/var/www/owp/open-ww3-project-ww3-tw/databases/sqlite/owp.db';
|
|
|
|
try {
|
|
// 连接数据库
|
|
$db = new SQLite3($db_path);
|
|
// 连接成功输出连接成功
|
|
echo "<!--数据库连接成功-->";
|
|
// 如果连接成功,但是内部状态有问题
|
|
if ($db->lastErrorCode() !==0) {
|
|
// 依旧显示为连接失败
|
|
die("数据库连接失败");
|
|
}
|
|
|
|
// 内容区
|
|
// 执行sql命令 查询表单
|
|
$select_id_date_title_from_posts_btos /*查询posts表单中的id date title id从大到小排列*/ = $db->query('SELECT id, date, title FROM posts ORDER BY id DESC'); // 执行查询posts表单中的id date title id从大到小排列的命令
|
|
// 循环 写入
|
|
|
|
echo "<center><b><h2>全部文章</h2></b></center>";
|
|
echo "<br>";
|
|
echo "文章如下↓";
|
|
echo "<br>";
|
|
echo "<br>";
|
|
|
|
while ($row = $select_id_date_title_from_posts_btos->fetchArray(SQLITE3_ASSOC)) {
|
|
|
|
echo "文章id: " . $row['id'] . "<br>";
|
|
echo $row['date'] . " " . "文章标题: " . $row['title'] . "<br>";
|
|
echo "<a href='https://ww3.tw/blog/post/s/?id=" . $row['id'] . "'>页面跳转</a><br><br>";
|
|
}
|
|
|
|
|
|
|
|
// 关闭数据库连接
|
|
$db->close();
|
|
|
|
// 捕获php报错
|
|
} catch (Exception $e) {
|
|
// 依旧显示为连接失败
|
|
die("数据库连接失败");
|
|
// 关闭数据库连接
|
|
$db->close();
|
|
}
|
|
?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</body>
|
|
</html>
|
|
|
|
|
|
|
|
<!-- css 部分 -->
|
|
<style>
|
|
#navbar1 {
|
|
margin: -160px 0 100px -30px;
|
|
}
|
|
#url_
|
|
{
|
|
text-decoration: none;
|
|
color: rgb(0, 0, 0);
|
|
font-size: 18.8px;
|
|
}
|
|
#td_navbar_40px
|
|
{
|
|
width: 40px;
|
|
}
|
|
|
|
#td_navbar_52px
|
|
{
|
|
width: 52px;;
|
|
}
|
|
|
|
#td_navbar_78px
|
|
{
|
|
width: 78px;
|
|
}
|
|
|
|
#td_navbar_160px
|
|
{
|
|
width: 160px;
|
|
}
|
|
|
|
/* 日志 */
|
|
#logs
|
|
{
|
|
height: 220px;
|
|
width: 450px;
|
|
overflow: auto;
|
|
background: #ffffffbc;
|
|
/* up、right、down、left */
|
|
margin: 115px 0px 0px -280px;
|
|
}
|
|
|
|
#td_logs
|
|
{
|
|
width: 75px;
|
|
padding-top: 1.8px;
|
|
vertical-align: top;
|
|
}
|
|
|
|
#td_logs_content
|
|
{
|
|
color: rgb(132, 132, 132);
|
|
padding-left: 10px;
|
|
padding-bottom: 5px;
|
|
}
|
|
/* 日志 */
|
|
|
|
/* 文章 */
|
|
#post_content
|
|
{
|
|
/*text-align: center;*/
|
|
height: 500px;
|
|
width: 490px;
|
|
color: rgb(202, 202, 202);
|
|
text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
|
|
background-color: rgba(27, 27, 27, 0.010);
|
|
overflow: auto;
|
|
font-size: 19px;
|
|
/* up、right、down、left */
|
|
margin: 40px 0 0 0;
|
|
}
|
|
|
|
/* 图标 */
|
|
#open-ww3-pro1ject-img
|
|
{
|
|
overflow: auto;
|
|
/* up、right、down、left */
|
|
margin: 0 0 0 0;
|
|
}
|
|
</style>
|
|
|
|
|
|
<!-- js 部分-->
|
|
<script src="./src/js/main.js"> 引入js页面蓝图 </script>
|
|
|