Compare commits

..

3 Commits

Author SHA1 Message Date
3d607d75f8 backup base dev 2026-03-23 09:53:39 +01:00
f5d8636f1d Correction for new blog system 2026-03-22 21:31:13 +01:00
0f84afc99a Forget query in new blog post 2026-03-22 20:59:36 +01:00
6 changed files with 10 additions and 10 deletions

Binary file not shown.

View File

@@ -61,7 +61,7 @@
</div>
<a href="/blog/public_unified/{{ article.author }}/{{ article.title_id }}"> <button> Lire la suite </button> </a>
<a href="{{ url_for('blog.viewArticle', username=article.author, title_id=article.title_id) }}"> <button> Lire la suite </button> </a>
</article>

View File

@@ -18,8 +18,8 @@
<item>
<title> {{ post.title }} </title>
<pubdate> {% if post.last_updated %} {{ post.last_updated }} {% else %} {{ post.time }} {% endif %} </pubdate>
<link> {{base_url}}/blog/{{ post.status }}/{{post.author}}/{{post.title_id}}</link>
<guid> {{base_url}}/blog/{{ post.status }}/{{post.author}}/{{post.title_id}}</guid>
<link> {{base_url}}/{{ url_for('blog.viewArticle', username=post.author, title_id=post.title_id) }}</link>
<guid> {{base_url}}/{{ url_for('blog.viewArticle', username=post.author, title_id=post.title_id) }} </guid>
<description>
{{ post.subtitle }}

View File

@@ -33,7 +33,7 @@
</small>
<div class="slug">
<p> {{ post.subtitle }} </p>
<p class="readmore"> <a style="margin-right:2rem;" href="/blog/{{ post.status }}/{{post.author}}/{{post.title_id}}"> Lire la suite... </a></p>
<p class="readmore"> <a style="margin-right:2rem;" href="{{ url_for('blog.viewArticle', username=post.author, title_id=post.title_id) }}"> Lire la suite... </a></p>
</div>
{% endfor %}
</div>

View File

@@ -38,7 +38,7 @@
</small>
<div class="slug">
<p> {{ post.subtitle }} </p>
<p class="readmore"> <a style="margin-right:2rem;" href="/blog/{{ post.status }}/{{post.author}}/{{post.title_id}}"> Lire la suite... </a></p>
<p class="readmore"> <a style="margin-right:2rem;" href="{{ url_for('blog.viewArticle', username=post.author, title_id=post.title_id) }}"> Lire la suite... </a></p>
</div>
{% endfor %}
</div>

View File

@@ -203,7 +203,7 @@ def view_internal():
id=0
if list_posts != None:
for post in list_posts:
posts = [dict(title_id=[0], title=post[1], subtitle=post[2], content=post[3], creation_date=post[4], last_updated=post[5], author=post[6], status=post[7] )] + posts
posts = [dict(title_id=post[0], title=post[1], subtitle=post[2], content=post[3], creation_date=post[4], last_updated=post[5], author=post[6], status=post[7] )] + posts
else:
return redirect(BASE_URL, code=404)
@@ -260,7 +260,7 @@ def viewauthorrss(author):
if list_posts != None:
last_build=last_article_date[0]
for post in list_posts:
posts=[dict(title_id[0], title=post[1], subtitle=post[2], content=markdown(post[3], extensions=MARKDOWN_EXT), creation_date=post[4],
posts=[dict(title_id=post[0], title=post[1], subtitle=post[2], content=markdown(post[3], extensions=MARKDOWN_EXT), creation_date=post[4],
author=post[5], status=post[6])] + posts
return render_template('blog_rss.xml',
@@ -285,7 +285,7 @@ def viewPrivateArticle(username, title_id):
content = markdown(post[3], extensions=MARKDOWN_EXT)
return render_template('blog.html', post_info=post_info, content=content)
else:
return redirect(url_for('blog'), code=404)
return redirect(url_for('login'), code=404)
@blog.route('/blog/public_unified/<username>/<title_id>', methods=['GET'])
@@ -294,7 +294,7 @@ def viewArticle(username, title_id):
user = '%s' % escape(username)
conn = sqlite3.connect(DATABASE) # Connexion à la base de donnée
cursor = conn.cursor() # Création de l'objet "curseur"
cursor.execute("""SELECT title_id, title, subtitle, content, creation_date, last_updated, author FROM Blog_posts WHERE author=? AND title=? AND status='public_unified' """, (user, title_id) )
cursor.execute("""SELECT title_id, title, subtitle, content, creation_date, last_updated, author FROM Blog_posts WHERE author=? AND title_id=? AND status='public_unified' """, (user, title_id) )
post = cursor.fetchone()
conn.close()
if post != None: