forked from rDrama/rDrama
1
0
Fork 0

Merge branch 'frost' into dasher

master
kek7198 2021-12-23 13:03:21 -06:00
commit d5701ee315
22 changed files with 184 additions and 124 deletions

View File

@ -1,6 +1,3 @@
<!-- aevann i swear to fuck -->
<!-- written by @Q for free -->
<!-- Joan made some changes to simplify things -->
The providers ("we", "us", "our") of the service provided by this web site ("rDrama.net") are not responsible for any user-generated content and accounts. Content submitted express the views of their author only.<br><br>
You agree to not use rDrama.net to submit or link to any content which violates any laws. You are entirely responsible for the content of, and any harm resulting from, that content or your conduct.<br><br>

View File

@ -8,6 +8,7 @@ from flask_limiter import Limiter
from flask_compress import Compress
from flask_limiter.util import get_ipaddr
from flask_mail import Mail
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy import *
@ -15,8 +16,7 @@ import gevent
from werkzeug.middleware.proxy_fix import ProxyFix
import redis
app = Flask(__name__, template_folder='templates')
app = Flask(__name__, template_folder='./templates')
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=3)
app.url_map.strict_slashes = False
app.jinja_env.cache = {}
@ -24,7 +24,6 @@ app.jinja_env.auto_reload = True
import faulthandler
faulthandler.enable()
app.config["SITE_NAME"]=environ.get("SITE_NAME").strip()
app.config["COINS_NAME"]=environ.get("COINS_NAME").strip()
app.config["GUMROAD_LINK"]=environ.get("GUMROAD_LINK", "https://marsey1.gumroad.com/l/tfcvri").strip()
@ -36,13 +35,14 @@ app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 86400
app.config["SESSION_COOKIE_NAME"] = "session_" + environ.get("SITE_NAME").strip().lower()
app.config["VERSION"] = "1.0.0"
app.config['MAX_CONTENT_LENGTH'] = 8 * 1024 * 1024
app.config["SESSION_COOKIE_SECURE"] = True
app.config["SESSION_COOKIE_SECURE"] = bool(int(environ.get("FORCE_HTTPS", 1)))
app.config["SESSION_COOKIE_SAMESITE"] = "Lax"
app.config["PERMANENT_SESSION_LIFETIME"] = 60 * 60 * 24 * 365
app.config["SESSION_REFRESH_EACH_REQUEST"] = True
app.config["SLOGAN"] = environ.get("SLOGAN", "").strip()
app.config["DEFAULT_COLOR"] = environ.get("DEFAULT_COLOR", "ff0000").strip()
app.config["DEFAULT_THEME"] = environ.get("DEFAULT_THEME", "midnight").strip()
app.config["FORCE_HTTPS"] = True
app.config["FORCE_HTTPS"] = int(environ.get("FORCE_HTTPS", 1)) if ("localhost" not in app.config["SERVER_NAME"] and "localhost" not in app.config["SERVER_NAME"]) else 0
app.config["UserAgent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36"
app.config["HCAPTCHA_SITEKEY"] = environ.get("HCAPTCHA_SITEKEY","").strip()
app.config["HCAPTCHA_SECRET"] = environ.get("HCAPTCHA_SECRET","").strip()
@ -51,6 +51,7 @@ app.config["SPAM_SIMILAR_COUNT_THRESHOLD"] = int(environ.get("SPAM_SIMILAR_COUNT
app.config["SPAM_URL_SIMILARITY_THRESHOLD"] = float(environ.get("SPAM_URL_SIMILARITY_THRESHOLD", 0.5))
app.config["COMMENT_SPAM_SIMILAR_THRESHOLD"] = float(environ.get("COMMENT_SPAM_SIMILAR_THRESHOLD", 0.5))
app.config["COMMENT_SPAM_COUNT_THRESHOLD"] = int(environ.get("COMMENT_SPAM_COUNT_THRESHOLD", 0.5))
app.config["VIDEO_COIN_REQUIREMENT"] = int(environ.get("VIDEO_COIN_REQUIREMENT", 0))
app.config["READ_ONLY"]=bool(int(environ.get("READ_ONLY", "0")))
app.config["BOT_DISABLE"]=bool(int(environ.get("BOT_DISABLE", False)))
app.config["RATELIMIT_KEY_PREFIX"] = "flask_limiting_"
@ -60,7 +61,7 @@ app.config["RATELIMIT_DEFAULTS_EXEMPT_WHEN"]=lambda:False
app.config["RATELIMIT_HEADERS_ENABLED"]=True
app.config["CACHE_TYPE"] = "redis"
app.config["CACHE_DIR"] = "cache"
app.config["RATELIMIT_STORAGE_URL"] = environ.get("REDIS_URL", "redis://localhost")
app.config["RATELIMIT_STORAGE_URL"] = "redis://localhost"
app.config['MAIL_SERVER'] = 'smtp.gmail.com'
app.config['MAIL_PORT'] = 587
app.config['MAIL_USE_TLS'] = True
@ -72,7 +73,7 @@ r=redis.Redis(host=environ.get("REDIS_URL", "redis://localhost"), decode_respon
limiter = Limiter(
app,
key_func=get_ipaddr,
default_limits=["3/second;30/minute;100/hour"],
default_limits=["3/second;30/minute;200/hour"],
headers_enabled=True,
strategy="fixed-window"
)
@ -98,7 +99,11 @@ def before_request():
g.timestamp = int(time.time())
if request.url.startswith("http://") and "localhost" not in app.config["SERVER_NAME"]:
if not request.path.startswith("/assets") and not request.path.startswith("/images") and not request.path.startswith("/hostedimages"):
session.permanent = True
if not session.get("session_id"): session["session_id"] = secrets.token_hex(16)
if app.config["FORCE_HTTPS"] and request.url.startswith("http://") and "localhost" not in app.config["SERVER_NAME"]:
url = request.url.replace("http://", "https://", 1)
return redirect(url, code=301)
@ -123,4 +128,4 @@ def after_request(response):
return response
from files.routes import *
from files.routes import *

View File

@ -84,6 +84,8 @@ SLURS = {
"china flu": "SARS-CoV-2 syndemic",
"china virus": "SARS-CoV-2 syndemic",
"kung flu": "SARS-CoV-2 syndemic",
"elon musk": "rocket daddy",
" elon ": " rocket daddy ",
}
LONGPOST_REPLIES = ['Wow, you must be a JP fan.', 'This is one of the worst posts I have EVER seen. Delete it.', "No, don't reply like this, please do another wall of unhinged rant please.", '# 😴😴😴', "Ma'am we've been over this before. You need to stop.", "I've known more coherent downies.", "Your pulitzer's in the mail", "That's great and all, but I asked for my burger without cheese.", 'That degree finally paying off', "That's nice sweaty. Why don't you have a seat in the time out corner with Pizzashill until you calm down, then you can have your Capri Sun.", "All them words won't bring your pa back.", "You had a chance to not be completely worthless, but it looks like you threw it away. At least you're consistent.", 'Some people are able to display their intelligence by going on at length on a subject and never actually saying anything. This ability is most common in trades such as politics, public relations, and law. You have impressed me by being able to best them all, while still coming off as an absolute idiot.', "You can type 10,000 characters and you decided that these were the one's that you wanted.", 'Have you owned the libs yet?', "I don't know what you said, because I've seen another human naked.", 'Impressive. Normally people with such severe developmental disabilities struggle to write much more than a sentence or two. He really has exceded our expectations for the writing portion. Sadly the coherency of his writing, along with his abilities in the social skills and reading portions, are far behind his peers with similar disabilities.', "This is a really long way of saying you don't fuck.", "Sorry ma'am, looks like his delusions have gotten worse. We'll have to admit him,", ':#marseywoah:', 'If only you could put that energy into your relationships', 'Posts like this is why I do Heroine.', 'still unemployed then?', 'K', 'look im gunna have 2 ask u 2 keep ur giant dumps in the toilet not in my replys 😷😷😷', "Mommy is soooo proud of you, sweaty. Let's put this sperg out up on the fridge with all your other failures.", "Good job bobby, here's a star", "That was a mistake. You're about to find out the hard way why.", 'You sat down and wrote all this shit. You could have done so many other things with your life. What happened to your life that made you decide writing novels of bullshit on rdrama.net was the best option?', "I don't have enough spoons to read this shit", "All those words won't bring daddy back.", 'OUT!']
@ -123,7 +125,6 @@ if 'rdrama.net' in SITE:
CARP_ID = 995
JOAN_ID = 28
AEVANN_ID = 1
KLEN_ID = 2050
LAWLZ_ID = 3833
LLM_ID = 253
DAD_ID = 2513
@ -148,7 +149,6 @@ elif SITE == "pcmemes.net":
CARP_ID = 0
JOAN_ID = 0
AEVANN_ID = 1
KLEN_ID = 0
LAWLZ_ID = 0
LLM_ID = 0
DAD_ID = 0
@ -173,7 +173,6 @@ else:
CARP_ID = 0
JOAN_ID = 0
AEVANN_ID = 0
KLEN_ID = 0
LAWLZ_ID = 0
LLM_ID = 0
DAD_ID = 0

View File

@ -29,7 +29,7 @@ def get_logged_in_user():
return v
def check_ban_evade(v):
if v and v.ban_evade and v.admin_level == 0 and not v.is_suspended:
if v and not v.patron and v.ban_evade and v.admin_level == 0 and not v.is_suspended:
if random.randint(0,30) < v.ban_evade: v.shadowbanned = "AutoJanny"
else: v.ban_evade +=1
g.db.add(v)

View File

@ -32,33 +32,40 @@ def grassed(v):
else: template = 'CHRISTMAS/'
return render_template(f"{template}grassed.html", v=v, users=users)
@app.get("/distribute/<cid>")
@app.post("/distribute/<comment>")
@limiter.limit("1/second")
@admin_level_required(3)
def distribute(v, cid):
try: int(cid)
def distribute(v, comment):
try: comment = int(comment)
except: abort(400)
post = g.db.query(Comment).filter_by(id=cid).first().post.permalink
votes = g.db.query(CommentVote).filter_by(comment_id=cid)
autobetter = g.db.query(User).filter_by(id=AUTOBETTER_ID).first()
coinsperperson = int(autobetter.coins / votes.count())
cid = notif_comment(f"You won {coinsperperson} coins betting on [{post}]({post}) !")
post = g.db.query(Comment).filter_by(id=comment).first().post
pool = 0
for option in post.bet_options: pool += option.upvotes
pool *= 200
votes = g.db.query(CommentVote).filter_by(comment_id=comment)
coinsperperson = int(pool / votes.count())
cid = notif_comment(f"You won {coinsperperson} coins betting on [{post.permalink}]({post.permalink}) :marseyparty:")
for vote in votes:
u = vote.user
u.coins += coinsperperson
add_notif(cid, u.id)
autobetter.coins = 0
autobetter = g.db.query(User).filter_by(id=AUTOBETTER_ID).first()
autobetter.coins -= pool
if autobetter.coins < 0: return {"error": "Not enough coins in bool"}, 400
g.db.add(autobetter)
g.db.commit()
return f"Each winner has received {coinsperperson} coins!"
@app.get("/truescore")
@auth_desired
def truescore(v):
users = g.db.query(User).order_by(User.truecoins.desc()).limit(25).all()
if not v or v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}truescore.html", v=v, users=users)
cid = notif_comment(f"You lost the 200 coins you bet on [{post.permalink}]({post.permalink}) :marseylaugh:")
cids = [x.id for x in post.bet_options]
cids.remove(comment)
votes = g.db.query(CommentVote).filter(CommentVote.comment_id.in_(cids)).all()
for vote in votes: add_notif(cid, vote.user.id)
g.db.commit()
return {"message": f"Each winner has received {coinsperperson} coins!"}
@app.post("/@<username>/revert_actions")
@limiter.limit("1/second")
@ -1022,7 +1029,7 @@ def api_sticky_post(post_id, v):
post = g.db.query(Submission).filter_by(id=post_id).first()
if post:
if post.stickied:
if post.stickied.startswith("t:"): abort(403)
if post.stickied.startswith("t:"): return {"error": "Can't unpin temporary pins!"}, 403
else: post.stickied = None
else:
pins = g.db.query(Submission.id).filter(Submission.stickied != None, Submission.is_banned == False).count()

View File

@ -18,6 +18,7 @@ from .front import frontlist, changeloglist
from urllib.parse import ParseResult, urlunparse, urlparse, quote
from os import path
import requests
from shutil import copyfile
site = environ.get("DOMAIN").strip()
site_name = environ.get("SITE_NAME").strip()
@ -1028,6 +1029,10 @@ def submit_post(v):
name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp'
file.save(name)
new_post.url = process_image(name)
name2 = name.replace('.webp', 'r.webp')
copyfile(name, name2)
new_post.thumburl = process_image(name2, True)
elif file.content_type.startswith('video/'):
file.save("video.mp4")
@ -1042,8 +1047,7 @@ def submit_post(v):
if (new_post.url or request.files.get('file')) and request.headers.get('cf-ipcountry')!="T1":
gevent.spawn( thumbnail_thread, new_post.id)
if not new_post.thumburl and new_post.url and request.headers.get('cf-ipcountry')!="T1": gevent.spawn( thumbnail_thread, new_post.id)
if not new_post.private:

View File

@ -361,20 +361,6 @@ def settings_profile_post(v):
if len(bio_html) > 10000: abort(400)
if v.id == KLEN_ID:
notify_users = NOTIFY_USERS(friends_html, v.id)
soup = BeautifulSoup(friends_html, features="html.parser")
for mention in soup.find_all("a", href=re.compile("^/@(\w+)")):
username = mention["href"].split("@")[1]
user = g.db.query(User).filter_by(username=username).first()
if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user.id)
cid = notif_comment(f"@{v.username} has added you to their friends list!")
for x in notify_users:
add_notif(cid, x)
v.bio = bio[:1500]
v.bio_html=bio_html
g.db.add(v)

View File

@ -293,8 +293,11 @@ def static_service2(path):
return resp
@app.get('/assets/<path:path>')
@app.get('/static/assets/<path:path>')
@limiter.exempt
def static_service(path):
if request.path.startswith('/assets/'): return redirect(request.full_path.replace('/assets/', '/static/assets/'))
resp = make_response(send_from_directory('assets', path))
if request.path.endswith('.webp') or request.path.endswith('.gif') or request.path.endswith('.ttf') or request.path.endswith('.woff') or request.path.endswith('.woff2'):
resp.headers.remove("Cache-Control")
@ -306,11 +309,13 @@ def static_service(path):
return resp
@app.get('/images/<path:path>')
@app.get('/IMAGES/<path:path>')
@app.get('/hostedimages/<path:path>')
@app.get('/images/<path>')
@app.get('/hostedimages/<path>')
@app.get("/static/images/<path>")
@limiter.exempt
def images(path):
if request.path.startswith('/images/') or request.path.lower().startswith('/hostedimages/'):
return redirect(request.full_path.replace('/images/', '/static/images/').replace('/hostedimages/', '/static/images/'))
resp = make_response(send_from_directory('/images', path.replace('.WEBP','.webp')))
resp.headers.remove("Cache-Control")
resp.headers.add("Cache-Control", "public, max-age=2628000")

View File

@ -253,18 +253,49 @@ def transfer_coins(v, username):
return {"message": f"You can't transfer {app.config['COINS_NAME']} to yourself!"}, 400
@app.post("/@<username>/transfer_bux")
@limiter.limit("1/second")
@is_not_banned
@validate_formkey
def transfer_bux(v, username):
receiver = g.db.query(User).filter_by(username=username).first()
if not receiver: return {"error": "That user doesn't exist."}, 404
if receiver.id != v.id:
amount = request.values.get("amount", "").strip()
amount = int(amount) if amount.isdigit() else None
if not amount or amount < 0: return {"error": f"Invalid amount of marseybux."}, 400
if v.procoins < amount: return {"error": f"You don't have enough marseybux"}, 400
if amount < 100: return {"error": f"You have to gift at least 100 marseybux."}, 400
receiver.procoins += amount
v.procoins -= amount
send_repeatable_notification(receiver.id, f"🤑 [@{v.username}]({v.url}) has gifted you {amount} marseybux!")
g.db.add(receiver)
g.db.add(v)
g.db.commit()
return {"message": f"{amount} marseybux transferred!"}, 200
return {"message": f"You can't transfer marseybux to yourself!"}, 400
@app.get("/leaderboard")
@auth_desired
def leaderboard(v):
if not v or v.oldsite: template = ''
else: template = 'CHRISTMAS/'
users = g.db.query(User)
users1 = users.order_by(User.coins.desc()).limit(25).all()
users2 = users.order_by(User.stored_subscriber_count.desc()).limit(15).all()
users3 = users.order_by(User.post_count.desc()).limit(10).all()
users4 = users.order_by(User.comment_count.desc()).limit(10).all()
users5 = users.order_by(User.received_award_count.desc()).limit(10).all()
users7 = users.order_by(User.coins_spent.desc()).limit(20).all()
users2 = users.order_by(User.stored_subscriber_count.desc()).limit(25).all()
users3 = users.order_by(User.post_count.desc()).limit(25).all()
users4 = users.order_by(User.comment_count.desc()).limit(25).all()
users5 = users.order_by(User.received_award_count.desc()).limit(25).all()
users7 = users.order_by(User.coins_spent.desc()).limit(25).all()
users10 = g.db.query(User).order_by(User.truecoins.desc()).limit(25).all()
votes1 = g.db.query(Submission.author_id, func.count(Submission.author_id)).join(Vote, Vote.submission_id==Submission.id).filter(Vote.vote_type==-1).group_by(Submission.author_id).order_by(func.count(Submission.author_id).desc()).all()
@ -279,20 +310,11 @@ def leaderboard(v):
users9 = sorted(users9, key=lambda x: x[1], reverse=True)[:25]
if 'pcmemes.net' == request.host:
users6 = users.order_by(User.basedcount.desc()).limit(10).all()
if not v or v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}leaderboard.html", v=v, users1=users1, users2=users2, users3=users3, users4=users4, users5=users5, users6=users6, users7=users7, users9=users9)
if not v or v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}leaderboard.html", v=v, users1=users1, users2=users2, users3=users3, users4=users4, users5=users5, users7=users7, users9=users9)
return render_template(f"{template}leaderboard.html", v=v, users1=users1, users2=users2, users3=users3, users4=users4, users5=users5, users6=users6, users7=users7, users9=users9, users10=users10)
return render_template(f"{template}leaderboard.html", v=v, users1=users1, users2=users2, users3=users3, users4=users4, users5=users5, users7=users7, users9=users9, users10=users10)
@app.get("/@<username>/css")
@ -318,11 +340,13 @@ def songs(id):
try: id = int(id)
except: return "", 400
user = g.db.query(User).filter_by(id=id).first()
if user and user.song: return redirect(f"/song/{user.song}.mp3")
if user and user.song: return redirect(f"/static/song/{user.song}.mp3")
else: abort(404)
@app.get("/song/<song>")
@app.get("/static/song/<song>")
def song(song):
if request.path.startswith('/song/'): return redirect(request.full_path.replace('/song/', '/static/song/'))
resp = make_response(send_from_directory('/songs', song))
resp.headers.remove("Cache-Control")
resp.headers.add("Cache-Control", "public, max-age=2628000")

View File

@ -151,6 +151,8 @@ def api_vote_comment(comment_id, new, v):
comment = get_comment(comment_id)
if comment.author_id == AUTOBETTER_ID: return {"error": "forbidden."}, 403
existing = g.db.query(CommentVote).filter_by(user_id=v.id, comment_id=comment.id).first()
if existing and existing.vote_type == new: return "", 204

View File

@ -311,7 +311,7 @@
{% block scripts %}{% endblock %}
<!-- Scripts -->
<script src="/assets/CHRISTMAS/js/header.js?v=200"></script>
<script src="/assets/CHRISTMAS/js/header.js?v=201"></script>
<!-- Lazy Loading -->
<script src="/assets/CHRISTMAS/js/lozad.js?v=200"></script>
@ -362,7 +362,7 @@
}
</script>
{% endif %}
<script src="/assets/CHRISTMAS/js/default.js?v=204"></script>
<script src="/assets/CHRISTMAS/js/default.js?v=205"></script>
</body>
</html>

View File

@ -212,7 +212,7 @@
</div>
</nav>
<script src="/assets/CHRISTMAS/js/header.js?v=200"></script>
<script src="/assets/CHRISTMAS/js/header.js?v=201"></script>
<style>
.notif-count {

View File

@ -196,7 +196,7 @@
<!-- Scripts -->
<script src="/assets/CHRISTMAS/js/header.js?v=200"></script>
<script src="/assets/CHRISTMAS/js/header.js?v=201"></script>
<!-- Lazy Loading -->
<script src="/assets/CHRISTMAS/js/lozad.js?v=200"></script>
@ -240,6 +240,6 @@
</script>
{% endif %}
<script src="/assets/CHRISTMAS/js/default.js?v=204"></script>
<script src="/assets/CHRISTMAS/js/default.js?v=205"></script>
</body>
</html>

View File

@ -24,7 +24,7 @@
<li><a href="/admin/users">Users Feed</a></li>
<li><a href="/admin/shadowbanned">Shadowbanned Users</a></li>
<li><a href="/admin/agendaposters">Users with Agendaposter Theme</a></li>
<li><a href="/admin/truescore">Users by True Score</a></li>
<li><a href="/admin/grassed">Currently Grassed Users</a></li>
</ul>
<h4>Safety</h4>

View File

@ -289,7 +289,7 @@
{% if v %}
<script src="/assets/js/post_toast2.js?v=197"></script>
<script src="/assets/js/formatting.js?v=190"></script>
<script src="/assets/js/default.js?v=190"></script>
<script src="/assets/js/default.js?v=191"></script>
{% endif %}
<link rel="stylesheet" href="/assets/css/lite-youtube.css?v=202">

View File

@ -98,7 +98,7 @@
<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-primary"><img class="mr-1 ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" height="13" src="/assets/images/emojis/marseycoin.webp" data-bs-original-title="{{'COINS_NAME' | app_config}}" aria-label="{{'COINS_NAME' | app_config}}"><span id="user-coins-amount">{{v.coins}}</span> {{'COINS_NAME' | app_config}}</div>
{% if v.procoins %}<div class="text-small-extra text-primary"><img class="mr-1 ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" height="13" src="/assets/images/emojis/marseybux.webp" data-bs-original-title="Marseybux" aria-label="Marseybux"><span>{{v.procoins}}</span> Marseybux</div>{% endif %}
{% if v.procoins %}<div class="text-small-extra text-primary"><img class="mr-1 ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" height="13" src="/assets/images/emojis/marseybux.webp" data-bs-original-title="Marseybux" aria-label="Marseybux"><span id="user-bux-amount">{{v.procoins}}</span> Marseybux</div>{% endif %}
</div>
</div>
</a>
@ -214,7 +214,7 @@
</div>
</nav>
<script src="/assets/js/header.js?v=190"></script>
<script src="/assets/js/header.js?v=192"></script>
<style>
.notif-count {

View File

@ -28,7 +28,7 @@
</pre>
<h5 style="font-weight:bold;text-align: center;">Top 20 by coins spent in shop</h5>
<h5 style="font-weight:bold;text-align: center;">Top 25 by coins spent in shop</h5>
<pre>
@ -56,7 +56,35 @@
</pre>
<h5 style="font-weight:bold;text-align: center;">Top 15 by followers</h5>
<h5 style="font-weight:bold;text-align: center;">Top 25 by truescore</h5>
<pre>
</pre>
<table class="table table-striped mb-5">
<thead class="bg-primary text-white">
<tr>
<th style="font-weight: bold">#</th>
<th style="font-weight: bold">Name</th>
<th style="font-weight: bold">Truescore</th>
</tr>
</thead>
<tbody id="followers-table">
{% for user in users10 %}
<tr>
<td style="font-weight:bold;">{{loop.index}}</td>
<td><a style="color:#{{user.namecolor}}; font-weight:bold; fonts" href="/@{{user.username}}"><img loading="lazy" src="/uid/{{user.id}}/pic" class="pp20"><span {% if user.patron %}class="patron" style="background-color:#{{user.namecolor}};"{% endif %}>{{user.username}}</span></a></td>
<td style="font-weight:bold; text-align:right;">{{user.truecoins}}</td>
</tr>
{% endfor %}
</tbody>
</table>
<pre>
</pre>
<h5 style="font-weight:bold;text-align: center;">Top 25 by followers</h5>
<pre>
@ -81,7 +109,7 @@
</pre>
<h5 style="font-weight:bold;text-align: center;">Top 10 by post count</h5>
<h5 style="font-weight:bold;text-align: center;">top 25 by post count</h5>
<pre>
@ -106,7 +134,7 @@
</pre>
<h5 style="font-weight:bold;text-align: center;">Top 10 by comment count</h5>
<h5 style="font-weight:bold;text-align: center;">top 25 by comment count</h5>
<pre>
@ -133,7 +161,7 @@
</pre>
<h5 style="font-weight:bold;text-align: center;">Top 10 by received awards</h5>
<h5 style="font-weight:bold;text-align: center;">top 25 by received awards</h5>
<pre>
@ -193,7 +221,7 @@
</pre>
<h5 style="font-weight:bold;text-align: center;">Top 10 by based count</h5>
<h5 style="font-weight:bold;text-align: center;">top 25 by based count</h5>
<pre>

View File

@ -542,7 +542,7 @@
<div class="body d-lg-flex border-bottom">
<label class="text-black w-lg-25">{% if 'rdrama.net' in request.host and v.id == 2050 %}Friends{% else %}Bio{% endif %}</label>
<label class="text-black w-lg-25">Bio</label>
<div class="w-lg-100">
<form id="profile-bio" action="/settings/profile" method="post" enctype="multipart/form-data">
@ -579,7 +579,7 @@
<div class="body d-lg-flex border-bottom">
<label class="text-black w-lg-25">{% if 'rdrama.net' in request.host and v.id == 2050 %}Bio{% else %}Friends{% endif %}</label>
<label class="text-black w-lg-25">Friends</label>
<div class="w-lg-100">
<form id="profile-friends" action="/settings/profile" method="post" enctype="multipart/form-data">

View File

@ -428,9 +428,12 @@
{% endfor %}
{% for c in p.bet_options %}
<div class="custom-control">
<div class="custom-control mt-3">
<input {% if c.poll_voted(v) %}checked{% endif %} class="custom-control-input bet" {% if not (v and v.coins > 200) or p.total_bet_voted(v) %}disabled{% endif %} type="radio" id="{{c.id}}" onchange="bet_vote('{{c.id}}')">
<label class="custom-control-label" for="{{c.id}}">{{c.body_html | safe}} - <a href="/votes?link=t3_{{c.id}}"><span id="bet-{{c.id}}">{{c.upvotes}}</span> bets</a>{% if not p.total_bet_voted(v) %}<span class="cost"> (cost of entry: 200 coins)</span>{% endif %}</label>
{% if v and v.admin_level > 2 %}
<button class="btn btn-primary px-2 mx-2" style="font-size:10px;padding:2px;margin-top:-5px" onclick="post_toast('/distribute/{{c.id}}')">Declare winner</button>
{% endif %}
</div>
{% endfor %}

View File

@ -119,22 +119,14 @@
{% if u.bio_html %}
<pre></pre>
{% if 'rdrama.net' in request.host and u.id == 2050 %}
<div class="text-muted font-weight-bolder">{{u.friends_html | safe}}</div>
{% else %}
<div class="text-muted font-weight-bolder">{{u.bio_html | safe}}</div>
{% endif %}
<div class="text-muted font-weight-bolder">{{u.bio_html | safe}}</div>
{% else %}
<p class="text-muted">No bio...</p>
{% endif %}
{% if u.friends_html %}
<p class="text-muted font-weight-bold">Friends:</p>
{% if 'rdrama.net' in request.host and u.id == 2050 %}
{{u.bio_html | safe}}
{% else %}
{{u.friends_html | safe}}
{% endif %}
{{u.friends_html | safe}}
{% endif %}
{% if u.enemies_html %}
@ -163,6 +155,9 @@
<a class="btn btn-primary" href="javascript:void(0)" onclick="post_toast('/@{{u.username}}/suicide')">Get them help</a>
<a class="btn btn-primary" href="javascript:void(0)" onclick="toggleElement('profile-toggleable', 'coin-transfer')">Gift {{'COINS_NAME' | app_config}}</a>
{% if v.procoins > 100 %}
<a class="btn btn-primary" href="javascript:void(0)" onclick="toggleElement('profile-toggleable', 'bux-transfer')">Gift Marseybux</a>
{% endif %}
{% if v.admin_level > 2 %}
<a id="admin" class="{% if u.admin_level > 1 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2('/@{{u.username}}/make_admin','admin','unadmin')">Make admin</a>
@ -198,6 +193,12 @@
<button class="btn btn-primary mt-3" onclick="transferCoins()">Gift</button>
</div>
<div class="d-none mt-3 profile-toggleable" id="bux-transfer">
<input autocomplete="off" id="bux-transfer-amount" class="form-control" name="amount" type="number" oninput="updateBux()">
<div>{{u.username}} will receive <span id="bux-transfer-taxed">0</span> marseybux</div>
<button class="btn btn-primary mt-3" onclick="transferBux()">Gift</button>
</div>
{% elif v and v.id == u.id %}
<a href="/settings/profile" class="btn btn-secondary">Edit profile</a>
<a href="/views" class="btn btn-secondary">Profile views</a>
@ -294,11 +295,9 @@
<pre></pre>
<p>User ID: {{u.id}}</p>
<p>Coins spent: {{u.coins_spent}}</p>
{% if v and v.admin_level > 1 %}
<p>True score: {{u.truecoins}}</p>
{% if u.is_private %}
<p>User has private mode enabled.</p>
{% endif %}
<p>True score: {{u.truecoins}}</p>
{% if u.is_private %}
<p>User has private mode enabled.</p>
{% endif %}
{% if v and (v.admin_level > 1 or v.alt) %}
<span>Alts:</span>
@ -312,6 +311,7 @@
<p>Banned by: <a href="{{u.banned_by.url}}">@{{u.banned_by.username}}</a></p>
{% endif %}
</div>
</div>
<div>
{% for b in u.badges %}
@ -323,7 +323,6 @@
{% endfor %}
</div>
</div>
</div>
</div>
@ -384,7 +383,7 @@
<img class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="{{'COINS_NAME' | app_config}}" height="15" src="/assets/images/emojis/marseycoin.webp?v=190">&nbsp;&nbsp;
{% if u.procoins %}
<span class="font-weight-bold">{{u.procoins}}</span>
<span id="profile-bux-amount-mobile" class="font-weight-bold">{{u.procoins}}</span>
<img class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Marseybux" height="15" src="/assets/images/emojis/marseybux.webp?v=190">&nbsp;&nbsp;
{% endif %}
@ -446,6 +445,9 @@
<a class="btn btn-primary" href="javascript:void(0)" onclick="toggleElement('profile-toggleable-mobile', 'message-mobile')">Message</a>
<a class="btn btn-primary" href="javascript:void(0)" onclick="post_toast('/@{{u.username}}/suicide')">Get them help</a>
<a class="btn btn-primary" href="javascript:void(0)" onclick="toggleElement('profile-toggleable-mobile', 'coin-transfer-mobile')">Gift {{'COINS_NAME' | app_config}}</a>
{% if v.procoins > 100 %}
<a class="btn btn-primary" href="javascript:void(0)" onclick="toggleElement('profile-toggleable', 'bux-transfer')">Gift Marseybux</a>
{% endif %}
{% if v.admin_level > 2 %}
<a id="admin2" class="{% if u.admin_level > 1 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast2('/@{{u.username}}/make_admin','admin2','unadmin2')">Make admin</a>
@ -480,6 +482,13 @@
<div>{{u.username}} will receive <span id="coins-transfer-taxed-mobile">0</span> {{'COINS_NAME' | app_config}}</div>
<button class="btn btn-primary mt-3" onclick="transferCoins(true)">Gift</button>
</div>
<div class="d-none mt-3 profile-toggleable-mobile" id="bux-transfer-mobile">
<input autocomplete="off" id="bux-transfer-amount-mobile" class="form-control" name="amount" type="number" oninput="updateBux(true)">
<div>{{u.username}} will receive <span id="bux-transfer-taxed-mobile">0</span> marseybux</div>
<button class="btn btn-primary mt-3" onclick="transferBux(true)">Gift</button>
</div>
{% if v.admin_level > 1 %}
<button id="grant" class="{% if u.paid_dues %}d-none{% endif %} btn btn-success" onclick="post_toast2('/@{{u.username}}/club_allow','grant','bar')">Grant club access</button>
@ -573,11 +582,9 @@
<pre></pre>
<p>User ID: {{u.id}}</p>
<p>Coins spent: {{u.coins_spent}}</p>
{% if v and v.admin_level > 1 %}
<p>True score: {{u.truecoins}}</p>
{% if u.is_private %}
<p>User has private mode enabled.</p>
{% endif %}
<p>True score: {{u.truecoins}}</p>
{% if u.is_private %}
<p>User has private mode enabled.</p>
{% endif %}
{% if v and (v.admin_level > 1 or v.alt) %}
<span>Alts:</span>
@ -689,7 +696,7 @@
{% if v %}
<div id='tax' class="d-none">{% if v.patron or u.patron %}0{% else %}0.03{% endif %}</div>
<script src="/assets/js/userpage_v.js?v=190"></script>
<script src="/assets/js/userpage_v.js?v=323"></script>
<div id="username" class="d-none">{{u.username}}</div>
{% endif %}

View File

@ -110,7 +110,7 @@
{% if v %}
<div id='tax' class="d-none">{% if v.patron or u.patron %}0{% else %}0.03{% endif %}</div>
<script src="/assets/js/userpage_v.js?v=190"></script>
<script src="/assets/js/userpage_v.js?v=323"></script>
<div id="username" class="d-none">{{u.username}}</div>
{% endif %}

View File

@ -35,13 +35,6 @@
<div id="uid" class="d-none">{{u.id}}</div>
{% endif %}
{% if v %}
<div id='tax' class="d-none">{% if v.patron or u.patron %}0{% else %}0.03{% endif %}</div>
<script src="/assets/js/userpage_v.js?v=190"></script>
<div id="username" class="d-none">{{u.username}}</div>
{% endif %}
<script src="/assets/js/userpage.js?v=190"></script>
{% endblock %}
{% block pagenav %}
@ -51,7 +44,7 @@
{% if v %}
<div id='tax' class="d-none">{% if v.patron or u.patron %}0{% else %}0.03{% endif %}</div>
<script src="/assets/js/userpage_v.js?v=190"></script>
<script src="/assets/js/userpage_v.js?v=323"></script>
<div id="username" class="d-none">{{u.username}}</div>
{% endif %}