diff --git a/.gitignore b/.gitignore index db01f67..4ef1ad2 100755 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,6 @@ databases/* mirrors/* blueprint/kami_views.py templates/kami/* -static/upload/* \ No newline at end of file +static/upload/* +templates/message/* +blueprint/massage_views.py \ No newline at end of file diff --git a/blueprint/blog_views.py b/blueprint/blog_views.py index f3c1dc1..880adc4 100755 --- a/blueprint/blog_views.py +++ b/blueprint/blog_views.py @@ -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//') 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}未找到该文章{posts_id}', 404 return render_template('blog/posts.html', posts=posts, message=message[::-1]) @@ -110,4 +116,8 @@ def upload(): return '上传成功' 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) \ No newline at end of file + return render_template('blog/upload.html', images=images) + +@blog_bp.route('/message/') +def messages(): + return render_template('message/home.html') \ No newline at end of file diff --git a/blueprint/study_views.py b/blueprint/study_views.py index c7365f3..75564f5 100755 --- a/blueprint/study_views.py +++ b/blueprint/study_views.py @@ -58,6 +58,7 @@ def new(): @study_bp.route('/posts//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'] diff --git a/templates/blog/about.html b/templates/blog/about.html index f5a0b0b..2412b19 100755 --- a/templates/blog/about.html +++ b/templates/blog/about.html @@ -1,13 +1,16 @@ - - - - 关于 - - - - 返回首页__网页地图 -
- 本站建立于大概2025年8月前后
+{# 引入base #} +{% extends 'blog/extension/base.html' %} + +{# 引入标题 #} +{% block title %}关于{% endblock %} + +{% include 'blog/include/head.html' %} +{% block content %} + {% include 'blog/include/navbar.html' %} +
+ 返回首页__网页地图 +
+ 本站建立于大概2025年8月前后
差不多是个人博客多次重建后的成果
如今我已经成长很多

@@ -15,17 +18,16 @@

2025.12.22



-
+
忘记写了
所以暂时就不写了

2025.08.05

over

- - \ No newline at end of file + +{% endblock %} \ No newline at end of file diff --git a/templates/blog/extension/base.html b/templates/blog/extension/base.html index 0790a70..68b4a46 100644 --- a/templates/blog/extension/base.html +++ b/templates/blog/extension/base.html @@ -8,7 +8,9 @@ {# 这里存放写入模板的数据 #} {% endblock %} - + {% block move %} + {# 这里存放更多模板的数据 #} + {% endblock %} {% include 'blog/include/footer.html' %} diff --git a/templates/blog/home.html b/templates/blog/home.html index 98d6cec..b3aa7fe 100644 --- a/templates/blog/home.html +++ b/templates/blog/home.html @@ -40,20 +40,26 @@ 文章如下↓

- {% for posts in posts %} - 文章id:{{ posts['id'] }} -
- 标题: {{ posts['title'] }} -
- 日期: {{ posts['date'].replace('.', '-')}} - 页面跳转 -
-
- {% endfor %} +
+ {% for posts in posts %} + 文章id:{{ posts['id'] }} +
+ 标题: {{ posts['title'] }} +
+ 日期: {{ posts['date'].replace('.', '-')}} + 页面跳转 +
+
+ {% endfor %} +
+{% endblock %} + +{% block move %} +
+

+

更多

+ my plan +
+
+ essay +
+ + {% endblock %} \ No newline at end of file diff --git a/templates/blog/include/footer.html b/templates/blog/include/footer.html index 21f5081..d65f15a 100644 --- a/templates/blog/include/footer.html +++ b/templates/blog/include/footer.html @@ -11,11 +11,11 @@ jvav
- © 2025 | open-ww3-poject for ww3.tw + © 2025-2026 | open-ww3-poject for ww3.tw
关于站长 网页地图 - 留言小角 + 留言小角

联系: @@ -30,4 +30,11 @@

暂不提供 +
+
+ 备案区: +
+ 喵ICP备20257900号 +
+ 茶ICP备2026010278号 \ No newline at end of file diff --git a/templates/blog/list.html b/templates/blog/list.html index 55bc55a..5f1dae4 100755 --- a/templates/blog/list.html +++ b/templates/blog/list.html @@ -1,37 +1,12 @@ - - - - - 文章列表 - - - -
- 返回首页 -

全部文章

-
-
文章如下↓
-
-
-
-
- {% for posts in posts %} -
-
-
- 文章id:{{ posts['id'] }} -
- 文章标题:{{ posts['title'] }} -
- 页面跳转__{{ posts['date'] }} -
-
-
- {% endfor %} -
-
- - {# 随机变换图床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 %} - +{% block content %} + {% include 'blog/include/navbar.html' %} +

全部文章

+ 文章如下↓ +
+
+
+ {% for posts in posts %} +
+ 文章id:{{ posts['id'] }} +
+ 文章标题:{{ posts['title'] }} +
+ 页面跳转__{{ posts['date'].replace('.', '-') }} +
+ {% endfor %} +
+ +{% 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%; - } - \ No newline at end of file diff --git a/templates/blog/posts.html b/templates/blog/posts.html index cb52eef..b03b5a0 100755 --- a/templates/blog/posts.html +++ b/templates/blog/posts.html @@ -4,7 +4,7 @@ {{ posts['title'] }} - 返回上级 + 返回主页

{{ posts['title'] }}


@@ -27,4 +27,7 @@ body { background-color: rgb(175, 223, 255); } + a { + text-decoration: none; + } \ No newline at end of file