2026第一次上传
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -7,3 +7,5 @@ mirrors/*
|
|||||||
blueprint/kami_views.py
|
blueprint/kami_views.py
|
||||||
templates/kami/*
|
templates/kami/*
|
||||||
static/upload/*
|
static/upload/*
|
||||||
|
templates/message/*
|
||||||
|
blueprint/massage_views.py
|
||||||
@@ -10,6 +10,10 @@ def get_owp_db_conn():
|
|||||||
conn.row_factory = sqlite3.Row
|
conn.row_factory = sqlite3.Row
|
||||||
return conn
|
return conn
|
||||||
|
|
||||||
|
def get_message_db_conn():
|
||||||
|
conn = sqlite3.connect('/var/open-ww3-project-ww3-tw/databases/sqlite/message.db')
|
||||||
|
conn.row_factory = sqlite3.Row
|
||||||
|
return conn
|
||||||
|
|
||||||
blog_bp = Blueprint('blog', __name__)
|
blog_bp = Blueprint('blog', __name__)
|
||||||
|
|
||||||
@@ -43,11 +47,13 @@ def posts_list():
|
|||||||
@blog_bp.route('/posts/<int:posts_id>/')
|
@blog_bp.route('/posts/<int:posts_id>/')
|
||||||
def show_posts_id(posts_id):
|
def show_posts_id(posts_id):
|
||||||
conn = get_owp_db_conn()
|
conn = get_owp_db_conn()
|
||||||
|
conn_message = get_message_db_conn()
|
||||||
sql_posts = "SELECT * FROM posts WHERE status = 1 AND id = ?"
|
sql_posts = "SELECT * FROM posts WHERE status = 1 AND id = ?"
|
||||||
sql_message = "SELECT * FROM messages WHERE posts_id = ?"
|
|
||||||
posts = conn.execute(sql_posts, (posts_id,)).fetchone()
|
posts = conn.execute(sql_posts, (posts_id,)).fetchone()
|
||||||
message = conn.execute(sql_message, (posts_id,)).fetchall()
|
sql_message = "SELECT * FROM messages WHERE posts_id = ?"
|
||||||
|
message = conn_message.execute(sql_message, (posts_id,)).fetchall()
|
||||||
conn.close()
|
conn.close()
|
||||||
|
conn_message.close()
|
||||||
if posts is None:
|
if posts is None:
|
||||||
return f'未找到该文章{posts_id}<title>未找到该文章{posts_id}</title>', 404
|
return f'未找到该文章{posts_id}<title>未找到该文章{posts_id}</title>', 404
|
||||||
return render_template('blog/posts.html', posts=posts, message=message[::-1])
|
return render_template('blog/posts.html', posts=posts, message=message[::-1])
|
||||||
@@ -111,3 +117,7 @@ def upload():
|
|||||||
img_files = '/var/open-ww3-project-ww3-tw/static/upload/img/'
|
img_files = '/var/open-ww3-project-ww3-tw/static/upload/img/'
|
||||||
images = [img for img in os.listdir(img_files) if img.endswith(('.png', '.jpg', '.jpeg', '.gif'))]
|
images = [img for img in os.listdir(img_files) if img.endswith(('.png', '.jpg', '.jpeg', '.gif'))]
|
||||||
return render_template('blog/upload.html', images=images)
|
return render_template('blog/upload.html', images=images)
|
||||||
|
|
||||||
|
@blog_bp.route('/message/')
|
||||||
|
def messages():
|
||||||
|
return render_template('message/home.html')
|
||||||
@@ -58,6 +58,7 @@ def new():
|
|||||||
|
|
||||||
@study_bp.route('/posts/<int:posts_id>/edit', methods=('GET', 'POST'))
|
@study_bp.route('/posts/<int:posts_id>/edit', methods=('GET', 'POST'))
|
||||||
def edit_posts_id(posts_id):
|
def edit_posts_id(posts_id):
|
||||||
|
posts = get_posts(posts_id)
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
title = request.form['title']
|
title = request.form['title']
|
||||||
content = request.form['content']
|
content = request.form['content']
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
<html>
|
{# 引入base #}
|
||||||
<head>
|
{% extends 'blog/extension/base.html' %}
|
||||||
<!--meta http-equiv="refresh" content="2.0;url={{ url_for('blog.home') }}"-->
|
|
||||||
<title>关于</title>
|
{# 引入标题 #}
|
||||||
<meta charset="utf-8" lang="zh-CN">
|
{% block title %}关于{% endblock %}
|
||||||
</head>
|
|
||||||
<body>
|
{% include 'blog/include/head.html' %}
|
||||||
<a href="{{ url_for('blog.home') }}">返回首页</a>__<a href="{{ url_for('blog.sitemap') }}">网页地图</a>
|
{% block content %}
|
||||||
<hr>
|
{% include 'blog/include/navbar.html' %}
|
||||||
本站建立于大概2025年8月前后<br>
|
<br>
|
||||||
|
<a href="{{ url_for('blog.home') }}">返回首页</a>__<a href="{{ url_for('blog.sitemap') }}">网页地图</a>
|
||||||
|
<hr id="hr_2">
|
||||||
|
本站建立于大概2025年8月前后<br>
|
||||||
差不多是个人博客多次重建后的成果<br>
|
差不多是个人博客多次重建后的成果<br>
|
||||||
如今我已经成长很多<br>
|
如今我已经成长很多<br>
|
||||||
<br>
|
<br>
|
||||||
@@ -15,17 +18,16 @@
|
|||||||
<p>2025.12.22</p>
|
<p>2025.12.22</p>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<hr>
|
<hr id="hr_2">
|
||||||
忘记写了
|
忘记写了
|
||||||
<br>
|
<br>
|
||||||
所以暂时就不写了
|
所以暂时就不写了
|
||||||
<p>2025.08.05</p>
|
<p>2025.08.05</p>
|
||||||
<p>over</p>
|
<p>over</p>
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
a {
|
#hr_2 {
|
||||||
text-decoration: none;
|
border: 0.3px solid black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
{% endblock %}
|
||||||
@@ -8,7 +8,9 @@
|
|||||||
{# 这里存放写入模板的数据 #}
|
{# 这里存放写入模板的数据 #}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
|
{% block move %}
|
||||||
|
{# 这里存放更多模板的数据 #}
|
||||||
|
{% endblock %}
|
||||||
{% include 'blog/include/footer.html' %}
|
{% include 'blog/include/footer.html' %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -40,20 +40,26 @@
|
|||||||
文章如下↓
|
文章如下↓
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
{% for posts in posts %}
|
<div id="posts_list">
|
||||||
文章id:{{ posts['id'] }}
|
{% for posts in posts %}
|
||||||
<br>
|
文章id:{{ posts['id'] }}
|
||||||
标题: {{ posts['title'] }}
|
<br>
|
||||||
<br>
|
标题: {{ posts['title'] }}
|
||||||
日期: {{ posts['date'].replace('.', '-')}}
|
<br>
|
||||||
<a href="{{ url_for('blog.posts_list') }}{{ posts['id'] }}">页面跳转</a>
|
日期: {{ posts['date'].replace('.', '-')}}
|
||||||
<br>
|
<a href="{{ url_for('blog.posts_list') }}{{ posts['id'] }}">页面跳转</a>
|
||||||
<br>
|
<br>
|
||||||
{% endfor %}
|
<br>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- css 部分 -->
|
<!-- css 部分 -->
|
||||||
<style>
|
<style>
|
||||||
|
#posts_list {
|
||||||
|
height: 300px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
#posts {
|
#posts {
|
||||||
margin: -400px 0 0 60%;
|
margin: -400px 0 0 60%;
|
||||||
}
|
}
|
||||||
@@ -86,3 +92,24 @@
|
|||||||
|
|
||||||
</style>
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block move %}
|
||||||
|
<div id="class">
|
||||||
|
<h1></h1>
|
||||||
|
<h1>更多</h1>
|
||||||
|
my plan
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
essay
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
#class {
|
||||||
|
margin: 0 0 0 0;
|
||||||
|
margin-left: 5%;
|
||||||
|
width: 90%;
|
||||||
|
height: 640px;
|
||||||
|
background-color: #93B9FFA4;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
{% endblock %}
|
||||||
@@ -11,11 +11,11 @@
|
|||||||
<a href="https://jvav.1win.eu.org/" style="color: rgb(188, 188, 255);">jvav</a>
|
<a href="https://jvav.1win.eu.org/" style="color: rgb(188, 188, 255);">jvav</a>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
© 2025 | open-ww3-poject for ww3.tw
|
© 2025-2026 | open-ww3-poject for ww3.tw
|
||||||
<br>
|
<br>
|
||||||
<a href="https://wiki.ww3.tw/doku.php?id=zh_cn:skimrme" style="color: rgb(188, 188, 255);">关于站长</a>
|
<a href="https://wiki.ww3.tw/doku.php?id=zh_cn:skimrme" style="color: rgb(188, 188, 255);">关于站长</a>
|
||||||
<a href="{{ url_for('blog.sitemap') }}" style="color: rgb(188, 188, 255);">网页地图</a>
|
<a href="{{ url_for('blog.sitemap') }}" style="color: rgb(188, 188, 255);">网页地图</a>
|
||||||
<a href="#" style="color: rgb(188, 188, 255);">留言小角</a>
|
<a href="{{ url_for('blog.messages') }}" style="color: rgb(188, 188, 255);">留言小角</a>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
联系:
|
联系:
|
||||||
@@ -30,4 +30,11 @@
|
|||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
暂不提供
|
暂不提供
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
备案区:
|
||||||
|
<br>
|
||||||
|
<a href="https://icp.hentioe.dev/sites/20257900" target="_blank">喵ICP备20257900号</a>
|
||||||
|
<br>
|
||||||
|
<a href="https://icp.redcha.cn/beian/ICP-2026010278.html" title="茶ICP备2026010278号" target="_blank">茶ICP备2026010278号</a>
|
||||||
</footer>
|
</footer>
|
||||||
@@ -1,37 +1,12 @@
|
|||||||
<!DOCTYPE id="html" html>
|
{# 引入base #}
|
||||||
<html>
|
{% extends 'blog/extension/base.html' %}
|
||||||
<head>
|
|
||||||
<link rel="icon" type="image/x-icon" href="https://ww3.tw/blog/icon/original.ico">
|
{# 引入标题 #}
|
||||||
<title>文章列表</title> <!-- 标题 -->
|
{% block title %}文章列表{% endblock %}
|
||||||
</head>
|
|
||||||
<body id="wallpaper" >
|
{% include 'blog/include/head.html' %}
|
||||||
<!-- 背景 -->
|
|
||||||
<div id="div_1">
|
{# 随机变换图床api #}
|
||||||
<a href='{{ url_for("blog.home") }}' style='background-color: rgba(147, 185, 255, 0)'>返回首页</a>
|
|
||||||
<center id="center_2"><b><h2>全部文章</h2></b></center>
|
|
||||||
<br>
|
|
||||||
<div id="posts_list">文章如下↓</div>
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
<div id='content'>
|
|
||||||
{% for posts in posts %}
|
|
||||||
<div id="posts_bian_kuang">
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
文章id:{{ posts['id'] }}
|
|
||||||
<br>
|
|
||||||
文章标题:{{ posts['title'] }}
|
|
||||||
<br>
|
|
||||||
<a href="{{ url_for('blog.posts_list') }}{{ posts['id'] }}">页面跳转</a>__{{ posts['date'] }}
|
|
||||||
</div>
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
{# 随机变换图床api #}
|
|
||||||
{% set wallpaper_apis =[
|
{% set wallpaper_apis =[
|
||||||
'https://www.loliapi.com/acg/pc/',
|
'https://www.loliapi.com/acg/pc/',
|
||||||
'https://api.sretna.cn/api/pc.php',
|
'https://api.sretna.cn/api/pc.php',
|
||||||
@@ -41,60 +16,39 @@
|
|||||||
'https://api.r10086.com/樱道随机图片api接口.php?图片系列=猫娘1',
|
'https://api.r10086.com/樱道随机图片api接口.php?图片系列=猫娘1',
|
||||||
'https://api.mtyqx.cn/tapi/random.php'] %}
|
'https://api.mtyqx.cn/tapi/random.php'] %}
|
||||||
{% set wallpaper = wallpaper_apis | random %}
|
{% set wallpaper = wallpaper_apis | random %}
|
||||||
</html>
|
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
{% include 'blog/include/navbar.html' %}
|
||||||
|
<center><b><h2>全部文章</h2></b></center>
|
||||||
|
文章如下↓
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<div style="overflow: auto; height: 460px; width: 900px;">
|
||||||
|
{% for posts in posts %}
|
||||||
|
<br>
|
||||||
|
文章id:{{ posts['id'] }}
|
||||||
|
<br>
|
||||||
|
文章标题:{{ posts['title'] }}
|
||||||
|
<br>
|
||||||
|
<a href="{{ url_for('blog.posts_list') }}{{ posts['id'] }}">页面跳转</a>__{{ posts['date'].replace('.', '-') }}
|
||||||
|
<br>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
<style>
|
||||||
|
#content{
|
||||||
|
/* background-image: url('{{ wallpaper }}'); */
|
||||||
|
background-size: cover;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
<style>
|
.div123content {
|
||||||
#center_2 {
|
background-color: blue;
|
||||||
width: 100%;
|
width: auto;
|
||||||
height: 40px;
|
height: 300px;
|
||||||
background-color: rgba(255, 255, 255, 0.415);
|
overflow: auto;
|
||||||
text-align: center;
|
}
|
||||||
margin: -55px 0 0 0;
|
</style>
|
||||||
}
|
{% endblock %}
|
||||||
#posts_list {
|
|
||||||
width: 90px;
|
|
||||||
height: 30px;
|
|
||||||
background-color: rgba(255, 255, 255, 0.415);
|
|
||||||
}
|
|
||||||
#posts_bian_kuang {
|
|
||||||
width: 600px;
|
|
||||||
height: 200px;
|
|
||||||
background-color: rgba(255, 255, 255, 0.415);
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
html {
|
|
||||||
margin: 0 0 0 0;
|
|
||||||
}
|
|
||||||
#wallpaper {
|
|
||||||
background-image: url('{{ wallpaper }}');
|
|
||||||
background-size: cover;
|
|
||||||
background-repeat: no-repeat; /*禁止平铺*/
|
|
||||||
background-size: 100% 100%; /*图片占满100%*/
|
|
||||||
margin: 0; /* 外边框为0 */
|
|
||||||
/*padding: 0;*/
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#div_1 {
|
|
||||||
height: 100%;
|
|
||||||
color: rgb(0, 0, 0);
|
|
||||||
font-size: 19px;
|
|
||||||
background-color: rgba(169, 169, 169, 0.212);
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
#content {
|
|
||||||
/* up、right、down、left */
|
|
||||||
margin: 0px 0px 0px 100px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#wallpaper_url {
|
|
||||||
color: rgba(255, 0, 0, 0.354);
|
|
||||||
/* up、right、down、left */
|
|
||||||
margin: 20% 0px 0px 75%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<title>{{ posts['title'] }}</title>
|
<title>{{ posts['title'] }}</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<a href="../">返回上级</a>
|
<a href="/blog">返回主页</a>
|
||||||
<br>
|
<br>
|
||||||
<h1>{{ posts['title'] }}</h1>
|
<h1>{{ posts['title'] }}</h1>
|
||||||
<br>
|
<br>
|
||||||
@@ -27,4 +27,7 @@
|
|||||||
body {
|
body {
|
||||||
background-color: rgb(175, 223, 255);
|
background-color: rgb(175, 223, 255);
|
||||||
}
|
}
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user