forked from rDrama/rDrama
1
0
Fork 0

add houses to WPD

master
Aevann 2024-01-31 23:23:57 +02:00
parent 69c3ee8fb4
commit 104e53c6ae
4 changed files with 8 additions and 21 deletions

View File

@ -420,7 +420,7 @@ FEATURES = {
'PRONOUNS': False,
'BADGES': True,
'HATS': True,
'HOUSES': False,
'HOUSES': True,
'GAMBLING': True,
'USERS_PROFILE_BANNER': True,
'USERS_PROFILE_BODYTEXT': True,
@ -436,6 +436,7 @@ FEATURES = {
'PING_GROUPS': True,
'BOTS': True,
}
HOUSES = ["Furry","Femboy","Vampire","Racist","Edgy"]
WERKZEUG_ERROR_DESCRIPTIONS = {
400: "The browser (or proxy) sent a request that this server could not understand.",
@ -630,7 +631,6 @@ if SITE in {'rdrama.net', 'staging.rdrama.net'}:
DEFAULT_TIME_FILTER = "day"
FEATURES['PRONOUNS'] = True
FEATURES['HOUSES'] = True
FEATURES['USERS_PERMANENT_WORD_FILTERS'] = True
BUG_THREAD = 18459
@ -723,6 +723,7 @@ elif SITE == 'watchpeopledie.tv':
FEATURES['NSFW_MARKING'] = False
FEATURES['BOTS'] = False
FEATURES['HAT_SUBMISSIONS'] = False
HOUSES = ["Furry","Femboy","Vampire","Edgy"]
PERMS['POST_COMMENT_EDITING'] = 3
PERMS['MODS_EVERY_HOLE'] = 3
@ -811,18 +812,14 @@ elif SITE == 'watchpeopledie.tv':
elif SITE == 'devrama.net':
AEVANN_ID = 7
FEATURES['PRONOUNS'] = True
FEATURES['HOUSES'] = True
FEATURES['USERS_PERMANENT_WORD_FILTERS'] = True
PERMS["SITE_SETTINGS"] = 4
PERMS["ORGIES"] = 4
else: # localhost or testing environment implied
FEATURES['PRONOUNS'] = True
FEATURES['HOUSES'] = True
FEATURES['USERS_PERMANENT_WORD_FILTERS'] = True
HOLE_BANNER_LIMIT = 69420
HOUSES = ("None","Furry","Femboy","Vampire","Racist","Edgy") if FEATURES['HOUSES'] else ("None")
BOT_IDs = {AUTOJANNY_ID, SNAPPY_ID, LONGPOSTBOT_ID, ZOZBOT_ID}
COLORS = {'ff459a','805ad5','62ca56','38a169','80ffff','2a96f3','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58','8cdbe6', DEFAULT_COLOR}

View File

@ -122,18 +122,8 @@ def stats():
}
if FEATURES['HOUSES']:
stats2 = {
"House Furry members": "{:,}".format(g.db.query(User).filter(User.house.like('Furry%')).count()),
"House Femboy members": "{:,}".format(g.db.query(User).filter(User.house.like('Femboy%')).count()),
"House Vampire members": "{:,}".format(g.db.query(User).filter(User.house.like('Vampire%')).count()),
"House Racist members": "{:,}".format(g.db.query(User).filter(User.house.like('Racist%')).count()),
"House Edgy members": "{:,}".format(g.db.query(User).filter(User.house.like('Edgy%')).count()),
"House Furry total truescore": "{:,}".format(g.db.query(func.sum(User.truescore)).filter(User.house.like('Furry%')).scalar() or 0),
"House Femboy total truescore": "{:,}".format(g.db.query(func.sum(User.truescore)).filter(User.house.like('Femboy%')).scalar() or 0),
"House Vampire total truescore": "{:,}".format(g.db.query(func.sum(User.truescore)).filter(User.house.like('Vampire%')).scalar() or 0),
"House Racist total truescore": "{:,}".format(g.db.query(func.sum(User.truescore)).filter(User.house.like('Racist%')).scalar() or 0),
"House Edgy total truescore": "{:,}".format(g.db.query(func.sum(User.truescore)).filter(User.house.like('Edgy%')).scalar() or 0),
}
stats.update(stats2)
for house in HOUSES:
stats[f"House {house} members"] = "{:,}".format(g.db.query(User).filter(User.house.like(f'{house}%')).count())
stats[f"House {house} total truescore"] = "{:,}".format(g.db.query(func.sum(User.truescore)).filter(User.house.like(f'{house}%')).scalar() or 0)
return stats

View File

@ -356,7 +356,7 @@ def settings_personal_post(v):
else: abort(400, f"{theme} is not a valid theme")
house = request.values.get("house")
if not updated and house and house in HOUSES and FEATURES['HOUSES']:
if not updated and house and house in ["None"]+HOUSES and FEATURES['HOUSES']:
if v.bite: abort(403)
if v.house:
if v.house.replace(' Founder', '') == house: abort(409, f"You're already in House {house}")

View File

@ -101,7 +101,7 @@
{% endif %}
<div class="input-group">
<select data-cost="{{cost}}" id="changing-house"{% if cost > v.coins + v.marseybux or v.bite %}disabled{% endif %} autocomplete="off" id='house' class="form-control setting_select" form="profile-settings" name="house" data-nonce="{{g.nonce}}">
{% for entry in HOUSES %}
{% for entry in ["None"]+HOUSES %}
<option value="{{entry}}" {% if v.house.startswith(entry) %}selected{% endif %}>
{{entry}}
</option>