From 71743a3bfc43ab9738dc76db9fc6dab239a655fb Mon Sep 17 00:00:00 2001 From: iro84657 Date: Mon, 9 May 2022 01:26:02 -0400 Subject: [PATCH] Remove special cases based on SITE_NAME --- files/helpers/const.py | 186 +++++++++---------------- files/helpers/slots.py | 3 +- files/routes/admin.py | 38 ----- files/routes/comments.py | 113 --------------- files/routes/discord.py | 3 - files/routes/front.py | 4 +- files/routes/posts.py | 64 +-------- files/routes/static.py | 101 +------------- files/routes/subs.py | 4 - files/routes/users.py | 12 +- files/templates/admin/admin_home.html | 7 - files/templates/admin/awards.html | 4 +- files/templates/default.html | 14 +- files/templates/emoji_modal.html | 12 -- files/templates/errors/patron.html | 2 +- files/templates/header.html | 53 ++----- files/templates/home.html | 10 -- files/templates/marseys.html | 29 ++-- files/templates/settings.html | 2 +- files/templates/settings2.html | 2 +- files/templates/settings_profile.html | 93 +------------ files/templates/settings_security.html | 8 +- files/templates/submission.html | 183 ------------------------ files/templates/submit.html | 4 +- 24 files changed, 103 insertions(+), 848 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index 2fff24a26..263954bdd 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -28,86 +28,66 @@ AJ_REPLACEMENTS = { ' TO ': " TOO ", } -if SITE_NAME == 'Cringetopia': - SLURS = { - "retarded": "neurodivergent", - "retard": "neurodivergent", - "faggotry": "cute twinkry", - "faggot": "cute twink", - "n1gger": "πŸ€", - "nlgger": "πŸ€", - "nigger": "πŸ€", - "uss liberty incident": "tragic accident aboard the USS Liberty", - "lavon affair": "Lavon Misunderstanding", - "i hate marsey": "i love marsey", - "autistic": "neurodivergent", - "holohoax": "i tried to claim the Holocaust didn't happen because I am a pencil-dicked imbecile and the word filter caught me lol", - "i hate carp": "i love Carp", - "heil hitler": "hello kitty", +SLURS = { + "retarded": "r-slurred", + "retard": "r-slur", + "gayfag": "gaystrag", + "poorfag": "poorstrag", + "richfag": "richstrag", + "newfag": "newstrag", + "oldfag": "oldstrag", + "faggotry": "cute twinkry", + "faggot": "cute twink", + "pedophile": "libertarian", + "kill yourself": "keep yourself safe", + "n1gger": "BIPOC", + "nlgger": "BIPOC", + "nigger": "BIPOC", + "steve akins": "penny verity oaken", + "trannie": "πŸš‚πŸšƒπŸšƒ", + "tranny": "πŸš‚πŸšƒπŸšƒ", + "troon": "πŸš‚πŸšƒπŸšƒ", + "nonewnormal": "HorseDewormerAddicts", + "kikery": "https://sciencedirect.com/science/article/abs/pii/S016028960600033X", + "kike": "https://sciencedirect.com/science/article/abs/pii/S016028960600033X", + "latinos": "latinx", + "latino": "latinx", + "latinas": "latinx", + "latina": "latinx", + "hispanics": "latinx", + "hispanic": "latinx", + "uss liberty incident": "tragic accident aboard the USS Liberty", + "lavon affair": "Lavon Misunderstanding", + "shylock": "Israeli friend", + "mohammad": "Prophet Mohammad (PBUH)", + "muhammad": "Prophet Mohammad (PBUH)", + "i hate marsey": "i love marsey", + "dancing israelis": "i love Israel", + "sodomite": "total dreamboat", + "pajeet": "sexy Indian dude", + "landlord": "landchad", + "tenant": "renthog", + "renter": "rentoid", + "autistic": "neurodivergent", + "holohoax": "i tried to claim the Holocaust didn't happen because I am a pencil-dicked imbecile and the word filter caught me lol", + "groomercord": "discord (actually a pretty cool service)", + "pedocord": "discord (actually a pretty cool service)", + "i hate carp": "i love Carp", + "manlet": "little king", + "gamer": "g*mer", + "journalist": "journ*list", + "journalism": "journ*lism", + "wuhan flu": "SARS-CoV-2 syndemic", + "china flu": "SARS-CoV-2 syndemic", + "china virus": "SARS-CoV-2 syndemic", + "kung flu": "SARS-CoV-2 syndemic", + "elon musk": "rocket daddy", + "fake and gay": "fake and straight", - " fag ": " cute twink ", - } -else: - SLURS = { - "retarded": "r-slurred", - "retard": "r-slur", - "gayfag": "gaystrag", - "poorfag": "poorstrag", - "richfag": "richstrag", - "newfag": "newstrag", - "oldfag": "oldstrag", - "faggotry": "cute twinkry", - "faggot": "cute twink", - "pedophile": "libertarian", - "kill yourself": "keep yourself safe", - "n1gger": "BIPOC", - "nlgger": "BIPOC", - "nigger": "BIPOC", - "steve akins": "penny verity oaken", - "trannie": "πŸš‚πŸšƒπŸšƒ", - "tranny": "πŸš‚πŸšƒπŸšƒ", - "troon": "πŸš‚πŸšƒπŸšƒ", - "nonewnormal": "HorseDewormerAddicts", - "kikery": "https://sciencedirect.com/science/article/abs/pii/S016028960600033X", - "kike": "https://sciencedirect.com/science/article/abs/pii/S016028960600033X", - "latinos": "latinx", - "latino": "latinx", - "latinas": "latinx", - "latina": "latinx", - "hispanics": "latinx", - "hispanic": "latinx", - "uss liberty incident": "tragic accident aboard the USS Liberty", - "lavon affair": "Lavon Misunderstanding", - "shylock": "Israeli friend", - "mohammad": "Prophet Mohammad (PBUH)", - "muhammad": "Prophet Mohammad (PBUH)", - "i hate marsey": "i love marsey", - "dancing israelis": "i love Israel", - "sodomite": "total dreamboat", - "pajeet": "sexy Indian dude", - "landlord": "landchad", - "tenant": "renthog", - "renter": "rentoid", - "autistic": "neurodivergent", - "holohoax": "i tried to claim the Holocaust didn't happen because I am a pencil-dicked imbecile and the word filter caught me lol", - "groomercord": "discord (actually a pretty cool service)", - "pedocord": "discord (actually a pretty cool service)", - "i hate carp": "i love Carp", - "manlet": "little king", - "gamer": "g*mer", - "journalist": "journ*list", - "journalism": "journ*lism", - "wuhan flu": "SARS-CoV-2 syndemic", - "china flu": "SARS-CoV-2 syndemic", - "china virus": "SARS-CoV-2 syndemic", - "kung flu": "SARS-CoV-2 syndemic", - "elon musk": "rocket daddy", - "fake and gay": "fake and straight", - - " rapist ": " male feminist ", - " pedo ": " libertarian ", - " kys ": " keep yourself safe ", - " fag ": " cute twink ", + " rapist ": " male feminist ", + " pedo ": " libertarian ", + " kys ": " keep yourself safe ", + " fag ": " cute twink ", } single_words = "|".join([slur.lower() for slur in SLURS.keys()]) @@ -615,38 +595,9 @@ AWARDS = { }, } -if SITE_NAME == 'PCM': - PCM_AWARDS = { - "croag": { - "kind": "croag", - "title": "Croag", - "description": "Summons Croag on the post.", - "icon": "fas fa-head-side", - "color": "text-gold", - "price": 500 - }, - "toe": { - "kind": "toe", - "title": "Toe Hype", - "description": "Summons Blade's toe on the post.", - "icon": "fas fa-socks", - "color": "text-blue", - "price": 500 - }, - "crab": { - "kind": "crab", - "title": "Crab", - "description": "Rave time!", - "icon": "fas fa-crab", - "color": "text-danger", - "price": 4000 - } - } - AWARDS = {**PCM_AWARDS, **AWARDS} - AWARDS2 = deepcopy(AWARDS) for k, val in AWARDS.items(): - if val['description'] == '???' and not (k == 'ghost' and SITE_NAME == 'PCM'): AWARDS2.pop(k) + if val['description'] == '???': AWARDS2.pop(k) if SITE == 'pcmemes.net' and k in ('ban','pizzashill','marsey','bird','grass','chud'): AWARDS2.pop(k) @@ -682,8 +633,7 @@ NOTIFIED_USERS = { FORTUNE_REPLIES = ('Your fortune: Allah Wills It','Your fortune: Inshallah, Only Good Things Shall Come To Pass','Your fortune: Allah Smiles At You This Day','Your fortune: Your Bussy Is In For A Blasting','Your fortune: You Will Be Propositioned By A High-Tier Twink','Your fortune: Repent, You Have Displeased Allah And His Vengeance Is Nigh','Your fortune: Reply Hazy, Try Again','Your fortune: lmao you just lost 100 coins','Your fortune: Yikes 😬','Your fortune: You Will Be Blessed With Many Black Bulls','Your fortune: NEETmax, The Day Is Lost If You Venture Outside','Your fortune: A Taste Of Jannah Awaits You Today','Your fortune: Watch Your Back','Your fortune: Outlook good','Your fortune: Godly Luck','Your fortune: Good Luck','Your fortune: Bad Luck','Your fortune: Good news will come to you by mail','Your fortune: Very Bad Luck','Your fortune: キタ━━━━━━(οΎŸβˆ€οΎŸ)━━━━━━ !!!!','Your fortune: Better not tell you now','Your fortune: You will meet a dark handsome stranger','Your fortune: οΌˆγ€€Β΄_ゝ`οΌ‰οΎŒο½°οΎ','Your fortune: Excellent Luck','Your fortune: Average Luck') -if SITE_NAME == 'rDrama': patron = 'Paypig' -else: patron = 'Patron' +patron = 'Patron' REDDIT_NOTIFS = { 'idio3': IDIO_ID, @@ -717,16 +667,10 @@ marseys_const = [x[0] for x in db.query(Marsey.name).filter(Marsey.name!='chudse marseys_const2 = marseys_const + ['chudsey','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9','exclamationpoint','period','questionmark'] db.close() -if SITE_NAME == 'PCM': - valid_username_chars = 'a-zA-Z0-9_\-А-я' - valid_username_regex = re.compile("^[a-zA-Z0-9_\-А-я]{3,25}$", flags=re.A) - mention_regex = re.compile('(^|\s|

)@(([a-zA-Z0-9_\-А-я]){3,25})', flags=re.A) - mention_regex2 = re.compile('

@(([a-zA-Z0-9_\-А-я]){3,25})', flags=re.A) -else: - valid_username_chars = 'a-zA-Z0-9_\-' - valid_username_regex = re.compile("^[a-zA-Z0-9_\-]{3,25}$", flags=re.A) - mention_regex = re.compile('(^|\s|

)@(([a-zA-Z0-9_\-]){1,25})', flags=re.A) - mention_regex2 = re.compile('

@(([a-zA-Z0-9_\-]){1,25})', flags=re.A) +valid_username_chars = 'a-zA-Z0-9_\-' +valid_username_regex = re.compile("^[a-zA-Z0-9_\-]{3,25}$", flags=re.A) +mention_regex = re.compile('(^|\s|

)@(([a-zA-Z0-9_\-]){1,25})', flags=re.A) +mention_regex2 = re.compile('

@(([a-zA-Z0-9_\-]){1,25})', flags=re.A) valid_password_regex = re.compile("^.{8,100}$", flags=re.A) diff --git a/files/helpers/slots.py b/files/helpers/slots.py index c9083c49a..02ad2a874 100644 --- a/files/helpers/slots.py +++ b/files/helpers/slots.py @@ -4,8 +4,7 @@ from .const import * command_word = "!slots" casino_word = "!slotsmb" -if SITE_NAME == 'rDrama': minimum_bet = 100 -else: minimum_bet = 10 +minimum_bet = 10 maximum_bet = INFINITY payout_to_symbols = { 2: ["πŸ‘£", "πŸ€", "🌈", "⭐️"], diff --git a/files/routes/admin.py b/files/routes/admin.py index d1c2f5858..4618b51d1 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -132,42 +132,6 @@ def merge_all(v, id): return redirect(user.url) - -if SITE_NAME == 'PCM': - @app.get('/admin/sidebar') - @admin_level_required(3) - def get_sidebar(v): - - try: - with open(f'files/templates/sidebar_{SITE_NAME}.html', 'r', encoding="utf-8") as f: sidebar = f.read() - except: - sidebar = None - - return render_template('admin/sidebar.html', v=v, sidebar=sidebar) - - - @app.post('/admin/sidebar') - @limiter.limit("1/second;30/minute;200/hour;1000/day") - @admin_level_required(3) - def post_sidebar(v): - - text = request.values.get('sidebar', '').strip() - - with open(f'files/templates/sidebar_{SITE_NAME}.html', 'w+', encoding="utf-8") as f: f.write(text) - - with open(f'files/templates/sidebar_{SITE_NAME}.html', 'r', encoding="utf-8") as f: sidebar = f.read() - - ma = ModAction( - kind="change_sidebar", - user_id=v.id, - ) - g.db.add(ma) - - g.db.commit() - - return render_template('admin/sidebar.html', v=v, sidebar=sidebar, msg='Sidebar edited successfully!') - - @app.post("/@/make_admin") @admin_level_required(3) def make_admin(v, username): @@ -401,8 +365,6 @@ def remove_meme_admin(v, username): @limiter.limit("1/day") @admin_level_required(3) def monthly(v): - if SITE_NAME == 'rDrama' and v.id != AEVANN_ID: abort (403) - data = {'access_token': GUMROAD_TOKEN} emails = [x['email'] for x in requests.get(f'https://api.gumroad.com/v2/products/{GUMROAD_ID}/subscribers', data=data, timeout=5).json()["subscribers"]] diff --git a/files/routes/comments.py b/files/routes/comments.py index 2df0cbc40..3326bab47 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -82,7 +82,6 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None): if not pid: if comment.parent_submission: pid = comment.parent_submission - elif SITE_NAME == 'rDrama': pid = 6489 elif request.host == 'pcmemes.net': pid = 2487 else: pid = 1 @@ -487,118 +486,6 @@ def api_comment(v): g.db.add(n) - if SITE_NAME == 'rDrama' and len(c.body) >= 1000 and "<" not in body and "" not in body_html: - - body = random.choice(LONGPOST_REPLIES) - - - if body.startswith('β–Ό'): - body = body[1:] - vote = CommentVote(user_id=LONGPOSTBOT_ID, - vote_type=-1, - comment_id=c.id, - real = True - ) - g.db.add(vote) - c.downvotes = 1 - - - - body_html2 = sanitize(body) - - c2 = Comment(author_id=LONGPOSTBOT_ID, - parent_submission=parent_submission, - parent_comment_id=c.id, - level=level+1, - is_bot=True, - body_html=body_html2, - top_comment_id=c.top_comment_id, - ghost=parent_post.ghost - ) - - g.db.add(c2) - - longpostbot = g.db.query(User).filter_by(id = LONGPOSTBOT_ID).one_or_none() - longpostbot.comment_count += 1 - longpostbot.coins += 1 - g.db.add(longpostbot) - - g.db.flush() - - n = Notification(comment_id=c2.id, user_id=v.id) - g.db.add(n) - - - if SITE_NAME == 'rDrama' and random.random() < 0.001: - - body = "zoz" - body_html2 = sanitize(body) - - - - - c2 = Comment(author_id=ZOZBOT_ID, - parent_submission=parent_submission, - parent_comment_id=c.id, - level=level+1, - is_bot=True, - body_html=body_html2, - top_comment_id=c.top_comment_id, - ghost=parent_post.ghost, - distinguish_level=6 - ) - - g.db.add(c2) - g.db.flush() - n = Notification(comment_id=c2.id, user_id=v.id) - g.db.add(n) - - - - - - body = "zle" - body_html2 = sanitize(body) - - - - c3 = Comment(author_id=ZOZBOT_ID, - parent_submission=parent_submission, - parent_comment_id=c2.id, - level=level+2, - is_bot=True, - body_html=body_html2, - top_comment_id=c.top_comment_id, - ghost=parent_post.ghost, - distinguish_level=6 - ) - - g.db.add(c3) - g.db.flush() - - body = "zozzle" - body_html2 = sanitize(body) - - - c4 = Comment(author_id=ZOZBOT_ID, - parent_submission=parent_submission, - parent_comment_id=c3.id, - level=level+3, - is_bot=True, - body_html=body_html2, - top_comment_id=c.top_comment_id, - ghost=parent_post.ghost, - distinguish_level=6 - ) - - g.db.add(c4) - - zozbot = g.db.query(User).filter_by(id = ZOZBOT_ID).one_or_none() - zozbot.comment_count += 3 - zozbot.coins += 3 - g.db.add(zozbot) - - if not v.shadowbanned: notify_users = NOTIFY_USERS(body, v) diff --git a/files/routes/discord.py b/files/routes/discord.py index 2160e6ede..947176cf9 100644 --- a/files/routes/discord.py +++ b/files/routes/discord.py @@ -17,9 +17,6 @@ def join_discord(v): if v.shadowbanned: return {"error": "Internal server error"} - if SITE_NAME == 'rDrama' and v.admin_level < 2 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()) state=generate_hash(f"{now}+{v.id}+discord") diff --git a/files/routes/front.py b/files/routes/front.py index 1460124ee..175f81c1c 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -176,11 +176,11 @@ def front_all(v, sub=None, subdomain=None): if v: defaultsorting = v.defaultsorting - if sub or SITE_NAME != 'rDrama': defaulttime = 'all' + defaulttime = 'all' else: defaulttime = v.defaulttime else: defaultsorting = "new" - if sub or SITE_NAME != 'rDrama': defaulttime = 'all' + defaulttime = 'all' else: defaulttime = defaulttimefilter sort=request.values.get("sort", defaultsorting) diff --git a/files/routes/posts.py b/files/routes/posts.py index 94181cf52..0b6bd1fc5 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -20,8 +20,7 @@ from shutil import copyfile from sys import stdout -if SITE_NAME == 'PCM': snappyquotes = [] -else: snappyquotes = [f':#{x}:' for x in marseys_const2] +snappyquotes = [f':#{x}:' for x in marseys_const2] if path.exists(f'snappy_{SITE_NAME}.txt'): with open(f'snappy_{SITE_NAME}.txt', "r", encoding="utf-8") as f: @@ -703,67 +702,6 @@ def thumbnail_thread(pid): db.add(post) db.commit() - if SITE_NAME == 'rDrama': - for t in ("submission","comment"): - word = random.choice(('rdrama','marsey')) - - try: - data = requests.get(f'https://api.pushshift.io/reddit/{t}/search?html_decode=true&q={word}&size=1', timeout=5).json()["data"] - except: break - - for i in data: - - if i["subreddit"] == 'PokemonGoRaids': continue - - body_html = f'''

New site mention: https://old.reddit.com{i["permalink"]}?context=89

''' - - existing_comment = db.query(Comment.id).filter_by(author_id=NOTIFICATIONS_ID, parent_submission=None, body_html=body_html).one_or_none() - if existing_comment: break - - new_comment = Comment(author_id=NOTIFICATIONS_ID, - parent_submission=None, - body_html=body_html, - distinguish_level=6 - ) - db.add(new_comment) - db.flush() - - new_comment.top_comment_id = new_comment.id - - - admins = db.query(User).filter(User.admin_level > 0).all() - for admin in admins: - notif = Notification(comment_id=new_comment.id, user_id=admin.id) - db.add(notif) - - k,val = random.choice(tuple(REDDIT_NOTIFS.items())) - - try: - data = requests.get(f'https://api.pushshift.io/reddit/{t}/search?html_decode=true&q={k}&size=1', timeout=5).json()["data"] - except: break - - for i in data: - - body_html = f'''

New mention of you: https://old.reddit.com{i["permalink"]}?context=89

''' - - existing_comment = db.query(Comment.id).filter_by(author_id=NOTIFICATIONS_ID, parent_submission=None,body_html=body_html).one_or_none() - if existing_comment: break - - new_comment = Comment(author_id=NOTIFICATIONS_ID, - parent_submission=None, - body_html=body_html, - distinguish_level=6 - ) - - db.add(new_comment) - db.flush() - - new_comment.top_comment_id = new_comment.id - - - notif = Notification(comment_id=new_comment.id, user_id=val) - db.add(notif) - if SITE == 'pcmemes.net': for t in ("submission","comment"): diff --git a/files/routes/static.py b/files/routes/static.py index 73d291ef2..7892ca06c 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -37,22 +37,13 @@ def logged_out(old = ""): @app.get("/marseys") @auth_required def marseys(v): - if SITE_NAME == 'rDrama': - marseys = g.db.query(Marsey, User).join(User, User.id==Marsey.author_id) - sort = request.values.get("sort", "usage") - if sort == "usage": marseys = marseys.order_by(Marsey.count.desc(), User.username) - else: marseys = marseys.order_by(User.username, Marsey.count.desc()) - else: - marseys = g.db.query(Marsey).order_by(Marsey.count.desc()) + marseys = g.db.query(Marsey).order_by(Marsey.count.desc()) return render_template("marseys.html", v=v, marseys=marseys) @app.get("/marsey_list") @cache.memoize(timeout=600, make_name=make_name) def marsey_list(): - if SITE_NAME == 'rDrama': - marseys = [f"{x.name} : {y} {x.tags}" for x, y in g.db.query(Marsey, User.username).join(User, User.id==Marsey.author_id).order_by(Marsey.count.desc())] - else: - marseys = [f"{x.name} : {x.tags}" for x in g.db.query(Marsey).order_by(Marsey.count.desc())] + marseys = [f"{x.name} : {x.tags}" for x in g.db.query(Marsey).order_by(Marsey.count.desc())] return str(marseys).replace("'",'"') @@ -112,94 +103,6 @@ def participation_stats(v): "users who posted, commented, or voted in the past 7 days": len(active_users), } - - if SITE_NAME == 'rDrama': - furries1 = g.db.query(User.id).filter(User.house.like('Furry%')).count() - femboys1 = g.db.query(User.id).filter(User.house.like('Femboy%')).count() - vampires1 = g.db.query(User.id).filter(User.house.like('Vampire%')).count() - racists1 = g.db.query(User.id).filter(User.house.like('Racist%')).count() - - furries2 = g.db.query(func.sum(User.truecoins)).filter(User.house.like('Furry%')).scalar() - femboys2 = g.db.query(func.sum(User.truecoins)).filter(User.house.like('Femboy%')).scalar() - vampires2 = g.db.query(func.sum(User.truecoins)).filter(User.house.like('Vampire%')).scalar() - racists2 = g.db.query(func.sum(User.truecoins)).filter(User.house.like('Racist%')).scalar() - - stats2 = {"House furry members": furries1, - "House femboy members": femboys1, - "House vampire members": vampires1, - "House racist members": racists1, - "House furry total truescore": furries2, - "House femboy total truescore": femboys2, - "House vampire total truescore": vampires2, - "House racist total truescore": racists2, - } - - stats.update(stats2) - - ids = (NOTIFICATIONS_ID, AUTOJANNY_ID, SNAPPY_ID, LONGPOSTBOT_ID, ZOZBOT_ID) - bots = g.db.query(User).filter(User.id.in_(ids)) - - for u in bots: - g.db.add(u) - - if u.patron_utc and u.patron_utc < time.time(): - u.patron = 0 - u.patron_utc = 0 - send_repeatable_notification(u.id, "Your paypig status has expired!") - if u.discord_id: remove_role(v, "1") - - if u.unban_utc and u.unban_utc < time.time(): - u.is_banned = 0 - u.unban_utc = 0 - u.ban_evade = 0 - send_repeatable_notification(u.id, "You have been unbanned!") - - if u.agendaposter and u.agendaposter < time.time(): - u.agendaposter = 0 - send_repeatable_notification(u.id, "Your chud theme has expired!") - badge = u.has_badge(28) - if badge: g.db.delete(badge) - - if u.flairchanged and u.flairchanged < time.time(): - u.flairchanged = None - send_repeatable_notification(u.id, "Your flair lock has expired. You can now change your flair!") - badge = u.has_badge(96) - if badge: g.db.delete(badge) - - if u.marseyawarded and u.marseyawarded < time.time(): - u.marseyawarded = None - send_repeatable_notification(u.id, "Your marsey award has expired!") - badge = u.has_badge(98) - if badge: g.db.delete(badge) - - if u.longpost and u.longpost < time.time(): - u.longpost = None - send_repeatable_notification(u.id, "Your pizzashill award has expired!") - badge = u.has_badge(97) - if badge: g.db.delete(badge) - - if u.bird and u.bird < time.time(): - u.bird = None - send_repeatable_notification(u.id, "Your bird site award has expired!") - badge = u.has_badge(95) - if badge: g.db.delete(badge) - - if u.progressivestack and u.progressivestack < time.time(): - u.progressivestack = None - send_repeatable_notification(u.id, "Your progressive stack has expired!") - badge = u.has_badge(94) - if badge: g.db.delete(badge) - - if u.rehab and u.rehab < time.time(): - u.rehab = None - send_repeatable_notification(u.id, "Your rehab has finished!") - badge = u.has_badge(109) - if badge: g.db.delete(badge) - - if u.deflector and u.deflector < time.time(): - u.deflector = None - send_repeatable_notification(u.id, "Your deflector has expired!") - g.db.commit() return render_template("admin/content_stats.html", v=v, title="Content Statistics", data=stats) diff --git a/files/routes/subs.py b/files/routes/subs.py index 98a0e3dea..c90a90d68 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -223,8 +223,6 @@ def remove_mod(v, sub): @app.get("/create_sub") @is_not_permabanned def create_sub(v): - if SITE_NAME == 'rDrama' and v.admin_level < 3: abort(403) - if request.host == 'rdrama.net': cost = 0 else: num = v.subs_created + 1 @@ -238,8 +236,6 @@ def create_sub(v): @app.post("/create_sub") @is_not_permabanned def create_sub2(v): - if SITE_NAME == 'rDrama' and v.admin_level < 3: abort(403) - name = request.values.get('name') if not name: abort(400) name = name.strip().lower() diff --git a/files/routes/users.py b/files/routes/users.py index 8e2d1336e..694bb2bd1 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -509,16 +509,8 @@ def leaderboard(v): if pos11[1] < 25 and v not in (x[0] for x in users11): pos11 = (26, pos11[1]) - if SITE_NAME == 'rDrama': - 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() - if pos12: pos12 = (pos12[1],pos12[2]) - else: pos12 = (users12.count()+1, 0) - users12 = users12.limit(25).all() - else: - users12 = None - pos12 = None + users12 = None + pos12 = None try: pos13 = [x[0].id for x in users13].index(v.id) diff --git a/files/templates/admin/admin_home.html b/files/templates/admin/admin_home.html index c92491309..40044a316 100644 --- a/files/templates/admin/admin_home.html +++ b/files/templates/admin/admin_home.html @@ -51,13 +51,6 @@
  • Daily Stat Chart
  • -{% if SITE_NAME == 'PCM' %} -

    Configuration

    - -{% endif %} - {% if v.admin_level > 2 %}
    
     	
    diff --git a/files/templates/admin/awards.html b/files/templates/admin/awards.html index 114e46b94..de4d3448f 100644 --- a/files/templates/admin/awards.html +++ b/files/templates/admin/awards.html @@ -63,7 +63,5 @@
    
    -	{% if SITE_NAME != 'rDrama' or v.id == AEVANN_ID %}
    -		
    Grant Monthly Marseybux
    - {% endif %} +
    Grant Monthly Marseybux
    {% endblock %} \ No newline at end of file diff --git a/files/templates/default.html b/files/templates/default.html index 352cc4139..bc9b2777b 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -52,18 +52,6 @@ {% endif %} - {% if SITE_NAME == 'rDrama' %} - - {% endif %} - @@ -239,7 +227,7 @@ - + {% block Banner %} {% if '@' not in request.path %} diff --git a/files/templates/emoji_modal.html b/files/templates/emoji_modal.html index 0ccee1646..fe4da8134 100644 --- a/files/templates/emoji_modal.html +++ b/files/templates/emoji_modal.html @@ -8,13 +8,6 @@ - - {% if SITE_NAME == 'Cringetopia' %} - - {% endif %} - @@ -62,11 +55,6 @@
    - {% if SITE_NAME == 'Cringetopia' %} -
    -
    -
    - {% endif %}
    diff --git a/files/templates/errors/patron.html b/files/templates/errors/patron.html index 5460092a5..1d88a8c5f 100644 --- a/files/templates/errors/patron.html +++ b/files/templates/errors/patron.html @@ -12,7 +12,7 @@
    :#marseymerchant:

    401 Not Authorized

    -

    This page is only available to {% if SITE_NAME == 'rDrama' %}paypigs{% else %}patrons{% endif %}:

    +

    This page is only available to patrons:

    {{config('GUMROAD_LINK')}}
    diff --git a/files/templates/header.html b/files/templates/header.html index 949b88374..07e352c8a 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -1,38 +1,23 @@