diff --git a/files/helpers/const.py b/files/helpers/const.py index b51a548d0a..88693f2cef 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -292,7 +292,7 @@ elif SITE == 'pcmemes.net': LOTTERY_TICKET_COST = 12 LOTTERY_SINK_RATE = -8 elif SITE == 'watchpeopledie.co': - WELCOME_MSG = """Hi, you! Welcome to WatchPeopleDie.co, this really cool site where you can go to watch people die. I'm @CLiTPEELER! If you have any questions about how things work here, or suggestions on how to make them work better than they already do, definitely slide on into my DMs (no fat chicks).\nThere's an enormously robust suite of fun features we have here and we're always looking for more to add. Way, way too many to go over in an automated welcome message. And you're probably here for the videos of people dying more than any sort of weird, paradoxical digital community aspect anyway, so I won't bore you with a tedious overview of them. Just head on over to [your settings page](https://watchpeopledie.co/settings/profile) and have a look at some of the basic profile stuff, at least. You can change your profile picture, username, flair, colors, banners, bio, profile anthem (autoplaying song on your page, like it's MySpace or some shit, hell yeah), CSS, all sorts of things.\nOr you can just go back to the main feed and carry on with watching people die. That's what the site is for, after all. Have fun!\nThough, while I have your attention (realistically I probably don't; this is quite a lot of text) - if you'd like to fund WPD's continued existence in the face of commercial and governmental censors, it would be really cool if you'd stop by our [Gumroad page](https://wpd.gumroad.com/l/WPD) and consider contributing some paltry sum each month to help us pay for hosting. *But only if you want*. **We do not serve ads. We will never serve ads. We do not sell data. We will never sell data. We do not paywall ANY usage of the site. We will never paywall ANY usage of the site.** Any and all contributions are strictly voluntary and should only be because you'd like to help the site continue to grow and thrive.\nAnyway, in closing, WPD is entirely open source. We don't really need new full-time coders or anything, but if you'd like to take a look at our repo - or even submit a PR to change, fix, or add some things - go right ahead! We are on [GitHub](https://github.com/Aevann1/rDrama).\nWell, that's all. Thanks again for signing up. It's an automated message and all, but I really do mean that. Thank you, specifically. I love you. Romantically. Deeply. Passionately.\nHave fun!""" + WELCOME_MSG = """Hi, you! Welcome to WatchPeopleDie.co, this really cool site where you can go to watch people die. I'm @CLiTPEELER! If you have any questions about how things work here, or suggestions on how to make them work better than they already do, definitely slide on into my DMs (no fat chicks).\nThere's an enormously robust suite of fun features we have here and we're always looking for more to add. Way, way too many to go over in an automated welcome message. And you're probably here for the videos of people dying more than any sort of weird, paradoxical digital community aspect anyway, so I won't bore you with a tedious overview of them. Just head on over to [your settings page](https://watchpeopledie.co/settings/profile) and have a look at some of the basic profile stuff, at least. You can change your profile picture, username, flair, colors, banners, bio, profile anthem (autoplaying song on your page, like it's MySpace or some shit, hell yeah), CSS, all sorts of things.\nOr you can just go back to the main feed and carry on with watching people die. That's what the site is for, after all. Have fun!\nThough, while I have your attention (realistically I probably don't; this is quite a lot of text) - if you'd like to fund WPD's continued existence in the face of commercial and governmental censors, it would be really cool if you'd stop by our [Kofi page](https://ko-fi.com/wpdco/tiers) and consider contributing some paltry sum each month to help us pay for hosting. *But only if you want*. **We do not serve ads. We will never serve ads. We do not sell data. We will never sell data. We do not paywall ANY usage of the site. We will never paywall ANY usage of the site.** Any and all contributions are strictly voluntary and should only be because you'd like to help the site continue to grow and thrive.\nAnyway, in closing, WPD is entirely open source. We don't really need new full-time coders or anything, but if you'd like to take a look at our repo - or even submit a PR to change, fix, or add some things - go right ahead! We are on [GitHub](https://github.com/Aevann1/rDrama).\nWell, that's all. Thanks again for signing up. It's an automated message and all, but I really do mean that. Thank you, specifically. I love you. Romantically. Deeply. Passionately.\nHave fun!""" FEATURES['PATRON_ICONS'] = True @@ -1026,7 +1026,6 @@ def is_safe_url(url): hosts = "|".join(approved_embed_hosts).replace('.','\.') SITE_NAME = environ.get("SITE_NAME").strip() -GUMROAD_LINK = environ.get("GUMROAD_LINK", "https://marsey1.gumroad.com/l/rdrama").strip() HCAPTCHA_SITEKEY = environ.get("HCAPTCHA_SITEKEY","").strip() HCAPTCHA_SECRET = environ.get("HCAPTCHA_SECRET","").strip() SPAM_SIMILARITY_THRESHOLD = float(environ.get("SPAM_SIMILARITY_THRESHOLD", 0.5)) @@ -1035,6 +1034,7 @@ SPAM_SIMILAR_COUNT_THRESHOLD = int(environ.get("SPAM_SIMILAR_COUNT_THRESHOLD", 1 COMMENT_SPAM_SIMILAR_THRESHOLD = float(environ.get("COMMENT_SPAM_SIMILAR_THRESHOLD", 0.5)) COMMENT_SPAM_COUNT_THRESHOLD = int(environ.get("COMMENT_SPAM_COUNT_THRESHOLD", 10)) DESCRIPTION = environ.get("DESCRIPTION", "rdrama.net caters to drama in all forms such as: Real life, videos, photos, gossip, rumors, news sites, Reddit, and Beyond™. There isn't drama we won't touch, and we want it all!").strip() +GUMROAD_LINK = environ.get("GUMROAD_LINK", "https://marsey1.gumroad.com/l/rdrama").strip() GUMROAD_TOKEN = environ.get("GUMROAD_TOKEN", "").strip() GUMROAD_ID = environ.get("GUMROAD_ID", "rdrama").strip() DEFAULT_THEME = environ.get("DEFAULT_THEME", "midnight").strip() diff --git a/files/routes/comments.py b/files/routes/comments.py index f154d3a161..c9ae52659c 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -261,7 +261,7 @@ def comment(v): Comment.parent_comment_id == parent_comment_id, Comment.parent_submission == parent_submission, Comment.body_html == body_html - ).one_or_none() + ).first() if existing: return {"error": f"You already made that comment: /comment/{existing.id}"}, 409 if parent.author.any_block_exists(v) and v.admin_level < 2: diff --git a/files/routes/users.py b/files/routes/users.py index 265aa0e07e..071db4ce80 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -703,7 +703,7 @@ def message2(v, username): body_html = sanitize(message) - if not (SITE == 'rdrama.net' and message == '!withdrawall' and user.id == 12732): + if not (SITE == 'rdrama.net' and user.id == 12732): existing = g.db.query(Comment.id).filter(Comment.author_id == v.id, Comment.sentto == user.id, Comment.body_html == body_html, @@ -1390,7 +1390,7 @@ def kofi(): if verification_token != KOFI_TOKEN: abort(400) id = data['kofi_transaction_id'] - created_utc = int(time.mktime(time.strptime(data['timestamp'].split('.')[0], "%Y-%m-%dT%H:%M:%S"))) + created_utc = int(time.mktime(time.strptime(data['timestamp'].split('.')[0], "%Y-%m-%dT%H:%M:%SZ"))) type = data['type'] amount = int(float(data['amount'])) email = data['email'] diff --git a/files/routes/votes.py b/files/routes/votes.py index bb17cadf9a..513f3572f2 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -34,20 +34,6 @@ def vote_info_get(v, link): downs = g.db.query(CommentVote).filter_by(comment_id=thing_id, vote_type=-1 ).order_by(CommentVote.created_utc).all() - if v.admin_level: - up_ids = [x[0] for x in g.db.query(CommentVote.user_id).filter_by(comment_id=thing_id, vote_type=1).order_by(CommentVote.created_utc).all()] - total_ups = g.db.query(func.sum(User.truecoins)).filter(User.id.in_(up_ids)).scalar() - total_ups = format(total_ups, ",") if total_ups else '0' - patrons_ups = g.db.query(User).filter(User.id.in_(up_ids), User.patron > 0).count() - - return render_template("votes.html", - v=v, - thing=thing, - ups=ups, - downs=downs, - total_ups=total_ups, - patrons_ups=patrons_ups) - else: abort(400) return render_template("votes.html", diff --git a/files/templates/errors/patron.html b/files/templates/errors/patron.html index 69efff7db5..e1d726fdb9 100644 --- a/files/templates/errors/patron.html +++ b/files/templates/errors/patron.html @@ -14,7 +14,11 @@
This page is only available to {% if SITE_NAME == 'rDrama' %}paypigs{% else %}patrons{% endif %}:
{% if FEATURES['PROCOINS'] -%} - {{GUMROAD_LINK}} + {% if KOFI_LINK %} + {{KOFI_LINK}} + {% else %} + {{GUMROAD_LINK}} + {% endif %} {%- endif %} diff --git a/files/templates/expanded_image_modal.html b/files/templates/expanded_image_modal.html index d6c00d25fe..65b6d1d73e 100644 --- a/files/templates/expanded_image_modal.html +++ b/files/templates/expanded_image_modal.html @@ -6,7 +6,7 @@ -Upvotes: {{ups | length}}
Downvotes: {{downs | length}}
-{% if v.admin_level and (total_ups and patrons_ups) %} -Total Truescore: {{total_ups}}
-Total Paypigs: {{patrons_ups}}
-{% endif %} -