master
Aevann1 2021-10-07 05:13:38 +02:00
parent 9d4bf9cbc2
commit c026ddc3d3
9 changed files with 19 additions and 19 deletions

View File

@ -237,7 +237,7 @@ def api_comment(v):
file=request.files["file"]
if not file.content_type.startswith('image/'): return {"error": "That wasn't an image!"}, 400
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(8)}.gif'
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(2)}.gif'
file.save(name)
url = request.host_url[:-1] + process_image(name)
@ -635,7 +635,7 @@ def edit_comment(cid, v):
file=request.files["file"]
if not file.content_type.startswith('image/'): return {"error": "That wasn't an image!"}, 400
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(8)}.gif'
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(2)}.gif'
file.save(name)
url = request.host_url[:-1] + process_image(name)

View File

@ -487,7 +487,7 @@ def thumbnail_thread(pid):
db.close()
return
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(8)}.gif'
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(2)}.gif'
with open(name, "wb") as file:
for chunk in image_req.iter_content(1024):
@ -797,7 +797,7 @@ def submit_post(v):
), 403
if file.content_type.startswith('image/'):
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(8)}.gif'
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(2)}.gif'
file.save(name)
new_post.url = request.host_url[:-1] + process_image(name)

View File

@ -112,7 +112,7 @@ def settings_profile_post(v):
if request.headers.get("Authorization"): return {"error": f"Image files only"}, 400
else: return render_template("settings_profile.html", v=v, error=f"Image files only."), 400
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(8)}.gif'
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(2)}.gif'
file.save(name)
url = request.host_url[:-1] + process_image(name)
@ -506,13 +506,13 @@ def settings_images_profile(v):
file = request.files["profile"]
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(8)}.gif'
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(2)}.gif'
file.save(name)
highres = request.host_url[:-1] + process_image(name)
if not highres: abort(400)
name2 = name.replace('.gif', '_resized.gif')
name2 = name.replace('.gif', 'r.gif')
copyfile(name, name2)
imageurl = request.host_url[:-1] + process_image(name2, True)
@ -537,7 +537,7 @@ def settings_images_banner(v):
file = request.files["banner"]
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(8)}.gif'
name = f'/hostedimages/{int(time.time())}{secrets.token_urlsafe(2)}.gif'
file.save(name)
imageurl = request.host_url[:-1] + process_image(name)

View File

@ -33,7 +33,7 @@
{% if v %}
{% include "award_modal.html" %}
<script src="/assets/js/comments_v.js?v=13"></script>
<script src="/assets/js/comments_v.js?v=14"></script>
{% endif %}
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.8/dist/clipboard.min.js"></script>
@ -221,7 +221,7 @@
{% if c.parent_comment_id and not standalone and level<=7 %}<a href="#comment-{{ c.parent_comment_id }}-only" class="text-muted ml-2"><i class="fas fa-reply fa-sm fa-fw fa-flip-horizontal mr-1"></i>{{ c.parent_comment.author.username }}</a>{% endif %}
<span id="timestamp-{{c.id}}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="" class="time-stamp">&nbsp;{{c.age_string}}</span>
<span id="timestamp-{{c.id}}" data-bs-toggle="tooltip" data-bs-placement="bottom" class="time-stamp">&nbsp;{{c.age_string}}</span>
{% if c.edited_utc %}
<span class="time-edited"><span>&#183;</span> <span class="font-italic">Edited {{c.edited_string}}</span></span>
{% endif %}

View File

@ -1,4 +1,4 @@
<script src="/assets/js/emoji_modal.js?v=11"></script>
<script src="/assets/js/emoji_modal.js?v=12"></script>
<style>
a.emojitab {

View File

@ -96,7 +96,7 @@
<div><img loading="lazy" src="{{v.profile_url}}" class="profile-pic-35"></div>
<div class="text-left pl-2">
<div style="color: #{{v.namecolor}}" class="text-small font-weight-bold {% if v.patron %}patron{% endif %}"><span {% if v.patron %}class="patron" style="background-color:#{{v.namecolor}};"{% endif %}>{{v.username}}</span></div>
<div class="text-small-extra text-purple"><i class="fad fa-coins mr-1"></i><span id="user-coins-amount">{{v.coins}}</span> {{'COINS_NAME' | app_config}}</div>
<div class="text-small-extra text-purple"><img class="mr-1 ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" height="13" src="https://rdrama.net/hostedimages/1633568379t0VccrnK3_o.gif" data-bs-original-title="Dramacoins" aria-label="Dramacoins"><span id="user-coins-amount">{{v.coins}}</span> {{'COINS_NAME' | app_config}}</div>
</div>
</div>
</a>

View File

@ -52,7 +52,7 @@
{% if 'rdrama' not in request.host %}
{% if v %}
<script src="/assets/js/comments_v.js?v=13"></script>
<script src="/assets/js/comments_v.js?v=14"></script>
{% include "award_modal.html" %}
{% include "emoji_modal.html" %}
{% include "gif_modal.html" %}
@ -300,10 +300,10 @@
{% if p.author.verified %}<i class="fas fa-badge-check align-middle ml-1" style="color:{% if p.author.id == 541 %}#62ca56{% else %}#1DA1F2{% endif %}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{p.author.verified}}"></i>
{% endif %}
<a {% if v %}href="{{p.author.url}}"{% else %}href="/logged_out{{p.author.url}}"{% endif %} style="color: #{{p.author.namecolor}}; font-weight: bold;" class="user-name"><img loading="lazy" src="{{p.author.profile_url}}" class="profile-pic-25 mr-2"/><span {% if p.author.patron and not p.distinguish_level %}class="patron" style="background-color:#{{p.author.namecolor}};"{% elif p.distinguish_level and 'rdrama' in request.host %}class="mod"{% endif %}>{{p.author.username}}</span></a>{% if p.author.customtitle %}&nbsp;<bdi style="color: #{{p.author.titlecolor}}">&nbsp;{% if p.author.quadrant %}<img loading="lazy" height="20" src="/assets/images/PCM/quadrants/{{p.author.quadrant}}.webp">{% endif %}{{p.author.customtitle | safe}}</bdi>{% endif %}
<span data-bs-toggle="tooltip" data-bs-placement="bottom" id="timestamp" title="">&nbsp;{{p.age_string}}</span>
<span data-bs-toggle="tooltip" data-bs-placement="bottom" id="timestamp">&nbsp;{{p.age_string}}</span>
({% if p.realurl(v) %}<a href="/search/posts/?q=domain%3A{{p.domain}}&sort=new&t=all" {% if not v or v.newtabexternal %}target="_blank"{% endif %}>{{p.domain}}</a>{% else %}text post{% endif %})
{% if p.edited_utc %}&nbsp;&nbsp;Edited <span data-bs-toggle="tooltip" data-bs-placement="bottom" id="edited_timestamp" title="">{{p.edited_string}}</span>{% endif %}
{% if p.edited_utc %}&nbsp;&nbsp;Edited <span data-bs-toggle="tooltip" data-bs-placement="bottom" id="edited_timestamp">{{p.edited_string}}</span>{% endif %}
&nbsp;&nbsp;{{p.views}} views
</div>
{% if p.active_flags %}

View File

@ -141,10 +141,10 @@
{% if p.author.verified %}<i class="fas fa-badge-check align-middle ml-1" style="color:{% if p.author.id == 541 %}#62ca56{% else %}#1DA1F2{% endif %}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{p.author.verified}}"></i>
{% endif %}
<a {% if v %}href="{{p.author.url}}"{% else %}href="/logged_out{{p.author.url}}"{% endif %} style="color: #{{p.author.namecolor}}; font-weight: bold;" class="user-name"><img loading="lazy" src="{{p.author.profile_url}}" class="profile-pic-25 mr-2"/><span {% if p.author.patron and not p.distinguish_level %}class="patron" style="background-color:#{{p.author.namecolor}};"{% elif p.distinguish_level and 'rdrama' in request.host %}class="mod"{% endif %}>{{p.author.username}}</span></a>{% if p.author.customtitle %}<bdi style="color: #{{p.author.titlecolor}}">&nbsp;&nbsp;{% if p.author.quadrant %}<img loading="lazy" height="20" src="/assets/images/PCM/quadrants/{{p.author.quadrant}}.webp">{% endif %}{{p.author.customtitle | safe}}</bdi>{% endif %}
<span data-bs-toggle="tooltip" data-bs-placement="bottom" id="timestamp-{{p.id}}" title="">&nbsp;{{p.age_string}}</span>
<span data-bs-toggle="tooltip" data-bs-placement="bottom" id="timestamp-{{p.id}}">&nbsp;{{p.age_string}}</span>
&nbsp;
({% if p.realurl(v) %}<a href="/search/posts/?q=domain%3A{{p.domain}}&sort=new&t=all" target="_blank">{{p.domain}}</a>{% else %}text post{% endif %})
{% if p.edited_utc %}&nbsp;&nbsp;Edited <span data-bs-toggle="tooltip" data-bs-placement="bottom" id="edited_timestamp-{{p.id}}" title="">{{p.edited_string}}</span>{% endif %}
{% if p.edited_utc %}&nbsp;&nbsp;Edited <span data-bs-toggle="tooltip" data-bs-placement="bottom" id="edited_timestamp-{{p.id}}">{{p.edited_string}}</span>{% endif %}
&nbsp;&nbsp;{{p.views}} views
</div>

View File

@ -138,7 +138,7 @@
{% if u.customtitle %}<p class="font-weight-bolder" style="color: #{{u.titlecolor}}">{% if u.quadrant %}<img loading="lazy" height="20" src="/assets/images/PCM/quadrants/{{u.quadrant}}.webp">{% endif %}{{u.customtitle | safe}}</p>{% endif %}
<div class="font-weight-bolder">
<span id="profile-coins-amount">{{u.coins}}</span>
&nbsp;<img data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{'COINS_NAME' | app_config}}" height="20" src="https://rdrama.net/assets/images/emojis/marseybux.webp">&nbsp;&nbsp;
<img class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{'COINS_NAME' | app_config}}" height="20" src="https://rdrama.net/assets/images/emojis/marseycoin.webp">&nbsp;&nbsp;
{% if u.stored_subscriber_count >=1 and not u.is_nofollow %}<a href="/@{{u.username}}/followers">{{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}</a>&nbsp;&nbsp; {% endif %}
joined <span data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{u.created_datetime}}">{{u.created_date}}</span>
@ -395,7 +395,7 @@
<div class="font-weight-normal">
<span id="profile-coins-amount-mobile" class="font-weight-bold">{{u.coins}}</span>
&nbsp;<img data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{'COINS_NAME' | app_config}}" height="15" src="https://rdrama.net/assets/images/emojis/marseybux.webp">&nbsp;&nbsp;
<img class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{'COINS_NAME' | app_config}}" height="15" src="https://rdrama.net/assets/images/emojis/marseycoin.webp">&nbsp;&nbsp;
{% if u.stored_subscriber_count >=1 and not u.is_nofollow %}<a href="/@{{u.username}}/followers" class="font-weight-bold">{{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}</a>&nbsp;&nbsp; {% endif %}
{% if "pcm" in request.host %}
<br>Based count: {{u.basedcount}}