pages also display members icons

QUICK GIVE ME CUSTOM HTML INCLUDING IMAGES IDEAS RN (it might end up being that they use external sources or we manual edit html files in production. hmm)
This commit is contained in:
cube
2026-03-18 02:57:54 +00:00
parent 7c6aabb1aa
commit 620f4be9fb
2 changed files with 24 additions and 3 deletions

View File

@@ -48,5 +48,7 @@ def page(mid):
db = get_db()
member = db.execute("SELECT * FROM member WHERE id=(?)",(mid,)).fetchone()
blog = db.execute("SELECT * FROM blog WHERE member_id=(?) ORDER BY created DESC",(mid,)).fetchall()
icon = db.execute("SELECT icon_location FROM icons WHERE id=(?)",(member[6],)).fetchone()
all_icons = db.execute("SELECT icon_location FROM icons WHERE member_id=(?)",(mid,)).fetchall()
return render_template('page.html', member=member, blog=blog)
return render_template('page.html', member=member, blog=blog, icon=icon, all_icons=all_icons)

View File

@@ -3,9 +3,20 @@
{% block content %}
{% if icon %}
<img class="icon" src="{{ url_for('static', filename='icons/'+icon[0]) }}">
{% else %}
<img class="icon" src="{{ url_for('static', filename='any.jpg') }}">
{% endif %}
<div class="title">{{member[3]}}</div>
<div class="maintext">
{{member[5]}}
</div>
<br class="clear" />
{% if blog|length > 0 %}
<div class="heading big">{{member[3]}}'s blog</div>
<div id="blog">
{% for post in blog %}
<div class="post">
<div class="title">{{post[3]}}</div>
@@ -15,7 +26,15 @@
</div>
</div>
{% endfor %}
</div>
{% endif %}
{% if all_icons|length > 0 %}
<div class="heading big">{{member[3]}}'s icons</div>
{% for i in all_icons %}
<img class="icon" src="{{ url_for('static', filename='icons/'+i[0]) }}">
{% endfor %}
{% endif %}
{% endblock %}