master
Aevann1 2022-01-24 22:04:23 +02:00
parent 60750d6fc2
commit dedb9bbaa0
7 changed files with 8 additions and 8 deletions

View File

@ -433,7 +433,7 @@ class User(Base):
def profile_url(self):
if self.agendaposter: return f"{SITE_FULL}/static/assets/images/defaultpictures/agendaposter/{random.randint(1, 51)}.webp?a=1008"
if self.profileurl: return self.profileurl
if SITE_NAME == 'rdrama.net': return f"{SITE_FULL}/static/assets/images/defaultpictures/{random.randint(1, 150)}.webp?a=1008"
if SITE_NAME == 'Drama': return f"{SITE_FULL}/static/assets/images/defaultpictures/{random.randint(1, 150)}.webp?a=1008"
return f"{SITE_FULL}/static/assets/images/default-profile-pic.webp?a=1008"
@lazy

View File

@ -175,7 +175,7 @@ def club_ban(v, username):
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@admin_level_required(2)
def make_meme_admin(v, username):
if request.host == 'pcmemes.net' or (SITE_NAME == 'rdrama.net' and v.admin_level > 2) or (request.host != 'rdrama.net' and request.host != 'pcmemes.net'):
if request.host == 'pcmemes.net' or (SITE_NAME == 'Drama' and v.admin_level > 2) or (request.host != 'rdrama.net' and request.host != 'pcmemes.net'):
user = get_user(username)
if not user: abort(404)
user.admin_level = 1
@ -188,7 +188,7 @@ def make_meme_admin(v, username):
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@admin_level_required(2)
def remove_meme_admin(v, username):
if request.host == 'pcmemes.net' or (SITE_NAME == 'rdrama.net' and v.admin_level > 2) or (request.host != 'rdrama.net' and request.host != 'pcmemes.net'):
if request.host == 'pcmemes.net' or (SITE_NAME == 'Drama' and v.admin_level > 2) or (request.host != 'rdrama.net' and request.host != 'pcmemes.net'):
user = get_user(username)
if not user: abort(404)
user.admin_level = 0

View File

@ -17,7 +17,7 @@ def join_discord(v):
if v.shadowbanned: return {"error": "Internal server error"}
if SITE_NAME == 'rdrama.net' and v.admin_level == 0 and v.patron == 0 and v.truecoins < 150:
if SITE_NAME == 'Drama' and v.admin_level == 0 and v.patron == 0 and v.truecoins < 150:
return "You must receive 150 upvotes/downvotes from other users before being able to join the Discord server."
now=int(time.time())

View File

@ -432,7 +432,7 @@ def themecolor(v):
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@auth_required
def gumroad(v):
if SITE_NAME == 'rdrama.net': patron = 'Paypig'
if SITE_NAME == 'Drama': patron = 'Paypig'
else: patron = 'Patron'
if not (v.email and v.is_activated):

View File

@ -342,7 +342,7 @@ def leaderboard(v):
else: pos11 = (users11.count()+1, 0)
users11 = users11.limit(25).all()
if SITE_NAME == 'rdrama.net':
if SITE_NAME == 'Drama':
sq = g.db.query(Marsey.author_id, func.count(Marsey.author_id).label("count"), func.rank().over(order_by=func.count(Marsey.author_id).desc()).label("rank")).group_by(Marsey.author_id).subquery()
users12 = g.db.query(User, sq.c.count).join(sq, User.id==sq.c.author_id).order_by(sq.c.count.desc())
pos12 = g.db.query(User.id, sq.c.rank, sq.c.count).join(sq, User.id==sq.c.author_id).filter(User.id == v.id).one_or_none()

View File

@ -216,7 +216,7 @@
{% if '@' not in request.path %}
{% if v %}
{% if SITE_NAME == 'rdrama.net' %}
{% if SITE_NAME == 'Drama' %}
{% set path = "assets/images/" + SITE_NAME + "/banners" %}
{% set image = "/static/" + path + "/" + listdir('files/' + path)|random() + '?a=20' %}

View File

@ -1,5 +1,5 @@
<nav class="shadow shadow-md fixed-top">
{% if SITE_NAME == 'rdrama.net' %}
{% if SITE_NAME == 'Drama' %}
<div id="srd" style="width: 100%; background-color: var(--primary); padding: 2px; text-align: center; font-weight: bold;white-space:nowrap">
<a style="color: white" class="text-small-mobile" href="https://reddit.com/r/SubredditDrama">💖🌈 welcome to rdrama.net: the official site for r/subredditdrama</a>
</div>