2026第一次上传

This commit is contained in:
2026-01-04 15:00:40 +08:00
parent 8373794f11
commit 24dc04287e
9 changed files with 130 additions and 122 deletions

4
.gitignore vendored
View File

@@ -6,4 +6,6 @@ databases/*
mirrors/*
blueprint/kami_views.py
templates/kami/*
static/upload/*
static/upload/*
templates/message/*
blueprint/massage_views.py

View File

@@ -10,6 +10,10 @@ def get_owp_db_conn():
conn.row_factory = sqlite3.Row
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__)
@@ -43,11 +47,13 @@ def posts_list():
@blog_bp.route('/posts/<int:posts_id>/')
def show_posts_id(posts_id):
conn = get_owp_db_conn()
conn_message = get_message_db_conn()
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()
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_message.close()
if posts is None:
return f'未找到该文章{posts_id}<title>未找到该文章{posts_id}</title>', 404
return render_template('blog/posts.html', posts=posts, message=message[::-1])
@@ -110,4 +116,8 @@ def upload():
return '上传成功<meta http-equiv="refresh" content="1.2;url=https://ww3.tw/blog/upload/">'
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'))]
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')

View File

@@ -58,6 +58,7 @@ def new():
@study_bp.route('/posts/<int:posts_id>/edit', methods=('GET', 'POST'))
def edit_posts_id(posts_id):
posts = get_posts(posts_id)
if request.method == "POST":
title = request.form['title']
content = request.form['content']

View File

@@ -1,13 +1,16 @@
<html>
<head>
<!--meta http-equiv="refresh" content="2.0;url={{ url_for('blog.home') }}"-->
<title>关于</title>
<meta charset="utf-8" lang="zh-CN">
</head>
<body>
<a href="{{ url_for('blog.home') }}">返回首页</a>__<a href="{{ url_for('blog.sitemap') }}">网页地图</a>
<hr>
本站建立于大概2025年8月前后<br>
{# 引入base #}
{% extends 'blog/extension/base.html' %}
{# 引入标题 #}
{% block title %}关于{% endblock %}
{% include 'blog/include/head.html' %}
{% block content %}
{% include 'blog/include/navbar.html' %}
<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>
@@ -15,17 +18,16 @@
<p>2025.12.22</p>
<br>
<br>
<hr>
<hr id="hr_2">
忘记写了
<br>
所以暂时就不写了
<p>2025.08.05</p>
<p>over</p>
</body>
</html>
<style>
a {
text-decoration: none;
#hr_2 {
border: 0.3px solid black;
}
</style>
</style>
{% endblock %}

View File

@@ -8,7 +8,9 @@
{# 这里存放写入模板的数据 #}
{% endblock %}
</div>
{% block move %}
{# 这里存放更多模板的数据 #}
{% endblock %}
{% include 'blog/include/footer.html' %}
</body>
</html>

View File

@@ -40,20 +40,26 @@
文章如下↓
<br>
<br>
{% for posts in posts %}
文章id:{{ posts['id'] }}
<br>
标题: {{ posts['title'] }}
<br>
日期: {{ posts['date'].replace('.', '-')}}
<a href="{{ url_for('blog.posts_list') }}{{ posts['id'] }}">页面跳转</a>
<br>
<br>
{% endfor %}
<div id="posts_list">
{% for posts in posts %}
文章id:{{ posts['id'] }}
<br>
标题: {{ posts['title'] }}
<br>
日期: {{ posts['date'].replace('.', '-')}}
<a href="{{ url_for('blog.posts_list') }}{{ posts['id'] }}">页面跳转</a>
<br>
<br>
{% endfor %}
</div>
</div>
<!-- css 部分 -->
<style>
#posts_list {
height: 300px;
overflow: auto;
}
#posts {
margin: -400px 0 0 60%;
}
@@ -84,5 +90,26 @@
/* 日志 */
</style>
{% 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 %}

View File

@@ -11,11 +11,11 @@
<a href="https://jvav.1win.eu.org/" style="color: rgb(188, 188, 255);">jvav</a>
</div>
<hr>
© 2025 | open-ww3-poject for ww3.tw
© 2025-2026 | open-ww3-poject for ww3.tw
<br>
<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="#" style="color: rgb(188, 188, 255);">留言小角</a>
<a href="{{ url_for('blog.messages') }}" style="color: rgb(188, 188, 255);">留言小角</a>
<br>
<br>
联系:
@@ -30,4 +30,11 @@
<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>

View File

@@ -1,37 +1,12 @@
<!DOCTYPE id="html" html>
<html>
<head>
<link rel="icon" type="image/x-icon" href="https://ww3.tw/blog/icon/original.ico">
<title>文章列表</title> <!-- 标题 -->
</head>
<body id="wallpaper" >
<!-- 背景 -->
<div id="div_1">
<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 #}
{# 引入base #}
{% extends 'blog/extension/base.html' %}
{# 引入标题 #}
{% block title %}文章列表{% endblock %}
{% include 'blog/include/head.html' %}
{# 随机变换图床api #}
{% set wallpaper_apis =[
'https://www.loliapi.com/acg/pc/',
'https://api.sretna.cn/api/pc.php',
@@ -41,60 +16,39 @@
'https://api.r10086.com/樱道随机图片api接口.php?图片系列=猫娘1',
'https://api.mtyqx.cn/tapi/random.php'] %}
{% 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>
#center_2 {
width: 100%;
height: 40px;
background-color: rgba(255, 255, 255, 0.415);
text-align: center;
margin: -55px 0 0 0;
}
#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);
}
.div123content {
background-color: blue;
width: auto;
height: 300px;
overflow: auto;
}
</style>
{% endblock %}
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>

View File

@@ -4,7 +4,7 @@
<title>{{ posts['title'] }}</title>
</head>
<body>
<a href="../">返回上级</a>
<a href="/blog">返回主页</a>
<br>
<h1>{{ posts['title'] }}</h1>
<br>
@@ -27,4 +27,7 @@
body {
background-color: rgb(175, 223, 255);
}
a {
text-decoration: none;
}
</style>