forked from rDrama/rDrama
1
0
Fork 0

Merge branch 'frost' of https://github.com/Aevann1/rDrama into frost

master
Aevann1 2022-09-14 09:52:29 +00:00
commit 156bdfbc6c
17 changed files with 30 additions and 37 deletions

View File

@ -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()

View File

@ -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:

View File

@ -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']

View File

@ -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",

View File

@ -14,7 +14,11 @@
<h1 class="h5">401 Not Authorized</h1>
<p class="text-muted">This page is only available to {% if SITE_NAME == 'rDrama' %}paypigs{% else %}patrons{% endif %}:</p>
{% if FEATURES['PROCOINS'] -%}
{% if KOFI_LINK %}
<a rel="nofollow noopener noreferrer" href="{{KOFI_LINK}}">{{KOFI_LINK}}</a>
{% else %}
<a rel="nofollow noopener noreferrer" href="{{GUMROAD_LINK}}">{{GUMROAD_LINK}}</a>
{% endif %}
{%- endif %}
</div>
</div>

View File

@ -6,7 +6,7 @@
<div style="height:10vh" data-bs-dismiss="modal"></div>
<a href="/" rel="nofollow noopener noreferrer" target="_blank" id="desktop-expanded-image-wrap-link">
<img loading="lazy" alt="expanded image" referrerpolicy="no-referrer" src="" class="img-fluid rounded" id="desktop-expanded-image" style="min-width: 250px;min-width: max(250px,50vw)">
<img loading="lazy" alt="expanded image" referrerpolicy="no-referrer" src="" class="img-fluid rounded" id="desktop-expanded-image" style="min-width: 250px;min-width: min(250px,50vw)">
</a>
<div style="height:10vh" data-bs-dismiss="modal"></div>

View File

@ -225,8 +225,12 @@
<a class="dropdown-item" href="{{v.url}}"><i class="fas fa-user-circle fa-fw mr-3"></i>My profile</a>
<a class="dropdown-item" href="/settings"><i class="fas fa-cog fa-fw mr-3"></i>Settings</a>
{% if FEATURES['PROCOINS'] %}
{% if KOFI_LINK %}
<a class="dropdown-item" rel="nofollow noopener noreferrer" href="{{KOFI_LINK}}"><i class="fas fa-dollar-sign fa-fw mr-3"></i>Donate</a>
{% else %}
<a class="dropdown-item" rel="nofollow noopener noreferrer" href="{{GUMROAD_LINK}}"><i class="fas fa-dollar-sign fa-fw mr-3"></i>Donate</a>
{% endif %}
{% endif %}
<button class="dropdown-item copy-link" data-clipboard-text="{{SITE_FULL}}/signup?ref={{v.username}}"><i class="fas fa-user-friends fa-fw mr-3"></i>Invite friends</button>
@ -292,8 +296,12 @@
</li>
{% if FEATURES['PROCOINS'] %}
{% if KOFI_LINK %}
<a class="nav-item nav-link" rel="nofollow noopener noreferrer" href="{{KOFI_LINK}}"><i class="fas fa-dollar-sign fa-fw mr-3"></i>Donate</a>
{% else %}
<a class="nav-item nav-link" rel="nofollow noopener noreferrer" href="{{GUMROAD_LINK}}"><i class="fas fa-dollar-sign fa-fw mr-3"></i>Donate</a>
{% endif %}
{% endif %}
{% if not g.webview %}
<li class="nav-item">

View File

@ -20,11 +20,6 @@
<p><b>Upvotes: </b>{{ups | length}}</p>
<p><b>Downvotes: </b>{{downs | length}}</p>
{% if v.admin_level and (total_ups and patrons_ups) %}
<p><b>Total Truescore: </b>{{total_ups}}</p>
<p><b>Total Paypigs: </b>{{patrons_ups}}</p>
{% endif %}
<h2>Upvotes</h2>
<div class="overflow-x-auto">
<table class="table table-striped mb-5">