add orgy icon

pull/199/head
Aevann 2023-09-17 23:58:08 +03:00
parent 13e83143fd
commit 60580cc6fa
8 changed files with 71 additions and 50 deletions

View File

@ -213,6 +213,7 @@
.fa-at:before{content:"\40"} .fa-at:before{content:"\40"}
.fa-ankh:before{content:"\f644"} .fa-ankh:before{content:"\f644"}
.fa-quotes:before{content:"\e234"} .fa-quotes:before{content:"\e234"}
.fa-tv:before{content:"\f26c"}
/* do not remove - fixes hand, talking, marsey-love components /* do not remove - fixes hand, talking, marsey-love components
from breaking out of the comment box from breaking out of the comment box

View File

@ -71,7 +71,6 @@ if SITE == 'staging.rdrama.net':
LOGGED_IN_CACHE_KEY = "loggedin" LOGGED_IN_CACHE_KEY = "loggedin"
LOGGED_OUT_CACHE_KEY = "loggedout" LOGGED_OUT_CACHE_KEY = "loggedout"
CHAT_ONLINE_CACHE_KEY = "online"
CASINO_RELEASE_DAY = 1662825600 CASINO_RELEASE_DAY = 1662825600

View File

@ -42,7 +42,8 @@ online = {
f'{SITE_FULL}/orgy': [], f'{SITE_FULL}/orgy': [],
} }
cache.set(CHAT_ONLINE_CACHE_KEY, len(online[f'{SITE_FULL}/chat']), timeout=0) cache.set('loggedin_chat', len(online[f'{SITE_FULL}/chat']), timeout=0)
cache.set('loggedin_orgy', len(online[f'{SITE_FULL}/orgy']), timeout=0)
def auth_required_socketio(f): def auth_required_socketio(f):
def wrapper(*args, **kwargs): def wrapper(*args, **kwargs):
@ -72,10 +73,6 @@ def chat(v):
if not v.allowed_in_chat: if not v.allowed_in_chat:
abort(403, CHAT_ERROR_MESSAGE) abort(403, CHAT_ERROR_MESSAGE)
orgy = get_orgy()
if orgy:
return redirect('/orgy')
displayed_messages = {k: val for k, val in messages[f"{SITE_FULL}/chat"].items() if val["user_id"] not in v.userblocks} displayed_messages = {k: val for k, val in messages[f"{SITE_FULL}/chat"].items() if val["user_id"] not in v.userblocks}
return render_template("chat.html", v=v, messages=displayed_messages) return render_template("chat.html", v=v, messages=displayed_messages)
@ -200,12 +197,8 @@ def speak(data, v):
def refresh_online(): def refresh_online():
emit("online", [online[request.referrer], muted], room=request.referrer, broadcast=True) emit("online", [online[request.referrer], muted], room=request.referrer, broadcast=True)
if get_orgy(): cache.set('loggedin_chat', len(online[f'{SITE_FULL}/chat']), timeout=0)
key = f'{SITE_FULL}/orgy' cache.set('loggedin_orgy', len(online[f'{SITE_FULL}/orgy']), timeout=0)
else:
key = f'{SITE_FULL}/chat'
cache.set(CHAT_ONLINE_CACHE_KEY, len(online[key]), timeout=0)
@socketio.on('connect') @socketio.on('connect')
@auth_required_socketio @auth_required_socketio

View File

@ -7,6 +7,7 @@ from jinja2 import pass_context
from PIL import ImageColor from PIL import ImageColor
from files.classes.user import User from files.classes.user import User
from files.classes.orgy import get_orgy
from files.helpers.assetcache import assetcache_path from files.helpers.assetcache import assetcache_path
from files.helpers.config.const import * from files.helpers.config.const import *
from files.helpers.regex import * from files.helpers.regex import *
@ -129,5 +130,5 @@ def inject_constants():
"CHUD_PHRASES":CHUD_PHRASES, "hasattr":hasattr, "calc_users":calc_users, "HOLE_INACTIVITY_DELETION":HOLE_INACTIVITY_DELETION, "CHUD_PHRASES":CHUD_PHRASES, "hasattr":hasattr, "calc_users":calc_users, "HOLE_INACTIVITY_DELETION":HOLE_INACTIVITY_DELETION,
"MAX_IMAGE_AUDIO_SIZE_MB":MAX_IMAGE_AUDIO_SIZE_MB, "MAX_IMAGE_AUDIO_SIZE_MB_PATRON":MAX_IMAGE_AUDIO_SIZE_MB_PATRON, "MAX_IMAGE_AUDIO_SIZE_MB":MAX_IMAGE_AUDIO_SIZE_MB, "MAX_IMAGE_AUDIO_SIZE_MB_PATRON":MAX_IMAGE_AUDIO_SIZE_MB_PATRON,
"MAX_VIDEO_SIZE_MB":MAX_VIDEO_SIZE_MB, "MAX_VIDEO_SIZE_MB_PATRON":MAX_VIDEO_SIZE_MB_PATRON, "MAX_VIDEO_SIZE_MB":MAX_VIDEO_SIZE_MB, "MAX_VIDEO_SIZE_MB_PATRON":MAX_VIDEO_SIZE_MB_PATRON,
"CURSORMARSEY_DEFAULT":CURSORMARSEY_DEFAULT, "SNAPPY_ID":SNAPPY_ID, "CURSORMARSEY_DEFAULT":CURSORMARSEY_DEFAULT, "SNAPPY_ID":SNAPPY_ID, "get_orgy":get_orgy, "TRUESCORE_CC_CHAT_MINIMUM":TRUESCORE_CC_CHAT_MINIMUM,
} }

View File

@ -31,11 +31,14 @@ def calc_users():
g.loggedin_counter = 0 g.loggedin_counter = 0
g.loggedout_counter = 0 g.loggedout_counter = 0
g.loggedin_chat = 0 g.loggedin_chat = 0
g.loggedin_orgy = 0
v = getattr(g, 'v', None) if g else None v = getattr(g, 'v', None) if g else None
if has_request_context and g and g.desires_auth and not g.is_api_or_xhr: if has_request_context and g and g.desires_auth and not g.is_api_or_xhr:
loggedin = cache.get(LOGGED_IN_CACHE_KEY) or {} loggedin = cache.get(LOGGED_IN_CACHE_KEY) or {}
loggedout = cache.get(LOGGED_OUT_CACHE_KEY) or {} loggedout = cache.get(LOGGED_OUT_CACHE_KEY) or {}
g.loggedin_chat = cache.get(CHAT_ONLINE_CACHE_KEY) or 0 g.loggedin_chat = cache.get('loggedin_chat') or 0
g.loggedin_orgy = cache.get('loggedin_orgy') or 0
timestamp = int(time.time()) timestamp = int(time.time())
check_session_id() check_session_id()

View File

@ -4,6 +4,13 @@
{% block content %} {% block content %}
<h3 class="py-2">Admin Tools</h3> <h3 class="py-2">Admin Tools</h3>
{% if v.admin_level >= PERMS['ORGIES'] %}
<h4>Orgies</h4>
<ul>
<li><a href="/admin/orgy">Start/Stop Orgy</a></li>
</ul>
{%- endif %}
{% if v.admin_level >= PERMS['USE_ADMIGGER_THREADS'] and (SITE_NAME == 'rDrama' or SIDEBAR_THREAD or BANNER_THREAD or BADGE_THREAD or SNAPPY_THREAD) %} {% if v.admin_level >= PERMS['USE_ADMIGGER_THREADS'] and (SITE_NAME == 'rDrama' or SIDEBAR_THREAD or BANNER_THREAD or BADGE_THREAD or SNAPPY_THREAD) %}
<h4>Add Stuff</h4> <h4>Add Stuff</h4>
<ul> <ul>
@ -98,12 +105,6 @@
</ul> </ul>
{%- endif %} {%- endif %}
{% if v.admin_level >= PERMS['ORGIES'] %}
<h4>Misc</h4>
<ul>
<li><a href="/admin/orgy">Start/Stop Orgy</a></li>
</ul>
{%- endif %}
<h4>Statistics</h4> <h4>Statistics</h4>
<ul> <ul>
<li><a href="/stats">Content Stats</a></li> <li><a href="/stats">Content Stats</a></li>

View File

@ -224,16 +224,27 @@
<a class="nav-link" href="/submit" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Create Post"><i class="fas fa-feather-alt"></i></a> <a class="nav-link" href="/submit" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Create Post"><i class="fas fa-feather-alt"></i></a>
</li> </li>
{% if FEATURES['CHAT'] -%} {%- if FEATURES['CHAT'] -%}
<li class="nav-item d-none d-lg-flex align-items-center justify-content-center text-center mx-1" id="header--chat--item"> {%- if v and v.allowed_in_chat and get_orgy() -%}
<a class="nav-link position-relative" href="/chat"> <li class="nav-item d-none d-lg-flex align-items-center justify-content-center text-center mx-1" id="header--chat--item">
<i class="fas fa-messages" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Chat"></i> <a class="nav-link position-relative" href="/orgy" style="margin-top: -1.9px !important">
<b id="chat-count-header-bar" class="text-lg {% if g.loggedin_chat > 40 %}text-danger{% elif g.loggedin_chat > 20 %}text-yellow{% endif %}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Users in chat right now"> <i class="fas fa-tv" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Orgy"></i>
{{g.loggedin_chat}} <b id="chat-count-header-bar" class="text-lg {% if g.loggedin_orgy > 40 %}text-danger{% elif g.loggedin_orgy > 20 %}text-yellow{% endif %}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Users in right now">
</b> {{g.loggedin_orgy}}
</a> </b>
</li> </a>
{%- endif %} </li>
{%- else -%}
<li class="nav-item d-none d-lg-flex align-items-center justify-content-center text-center mx-1" id="header--chat--item">
<a class="nav-link position-relative" href="/chat" style="margin-top: -1.6px !important">
<i class="fas fa-messages" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Chat"></i>
<b id="chat-count-header-bar" class="text-lg {% if g.loggedin_chat > 40 %}text-danger{% elif g.loggedin_chat > 20 %}text-yellow{% endif %}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Users in chat right now">
{{g.loggedin_chat}}
</b>
</a>
</li>
{%- endif -%}
{%- endif -%}
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1" id="header--randomuser--item"> <li class="nav-item d-flex align-items-center justify-content-center text-center mx-1" id="header--randomuser--item">
<a class="nav-link" href="/random_user" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Random User with a Profile Anthem"><i class="fas fa-music"></i></a> <a class="nav-link" href="/random_user" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Random User with a Profile Anthem"><i class="fas fa-music"></i></a>

View File

@ -46,26 +46,38 @@
</a> </a>
</button> </button>
{% if v %} {% if v %}
{% if FEATURES['CHAT'] -%} {%- if FEATURES['CHAT'] -%}
<button type="button" class="nobackground border-0 col px-0 btn btn-dead m-0 pt-0" style="margin-right:-10px!important"> {%- if v and v.allowed_in_chat and get_orgy() -%}
<a href="/chat" class="text-decoration-none"> <button type="button" class="nobackground border-0 col px-0 btn btn-dead m-0 pt-0" style="margin-right:-10px!important">
<div class="text-center {% if request|selected_tab=='chat' %}text-primary{% else %}text-muted{% endif %}"> <a href="/orgy" class="text-decoration-none">
<b class="text-lg {% if g.loggedin_chat > 40 %}text-danger{% elif g.loggedin_chat > 20 %}text-yellow{% endif %}" style="padding-top:10px" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Users in chat right now">{{g.loggedin_chat}}</b> <div class="text-center {% if request|selected_tab=='orgy' %}text-primary{% else %}text-muted{% endif %}">
<div class="text-small-extra">Chat</div> <b class="text-lg {% if g.loggedin_orgy > 40 %}text-danger{% elif g.loggedin_orgy > 20 %}text-yellow{% endif %}" style="padding-top:10px" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Users in Orgy right now">{{g.loggedin_orgy}}</b>
</div> <div class="text-small-extra">Orgy</div>
</a> </div>
</button> </a>
{%- endif %} </button>
{% if FEATURES['AWARDS'] -%} {%- else -%}
<button type="button" class="nobackground border-0 col px-0 mr-3 btn btn-dead m-0"> <button type="button" class="nobackground border-0 col px-0 btn btn-dead m-0 pt-0" style="margin-right:-10px!important">
<a href="/shop/awards" class="text-decoration-none"> <a href="/chat" class="text-decoration-none">
<div class="text-center {% if request|selected_tab=='shop' %}text-primary{% else %}text-muted{% endif %}"> <div class="text-center {% if request|selected_tab=='chat' %}text-primary{% else %}text-muted{% endif %}">
<i class="fas fa-store text-lg"></i> <b class="text-lg {% if g.loggedin_chat > 40 %}text-danger{% elif g.loggedin_chat > 20 %}text-yellow{% endif %}" style="padding-top:10px" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Users in chat right now">{{g.loggedin_chat}}</b>
<div class="text-small-extra">Shop</div> <div class="text-small-extra">Chat</div>
</div> </div>
</a> </a>
</button> </button>
{%- endif %} {%- endif -%}
{%- endif -%}
{%- if FEATURES['AWARDS'] -%}
<button type="button" class="nobackground border-0 col px-0 mr-3 btn btn-dead m-0">
<a href="/shop/awards" class="text-decoration-none">
<div class="text-center {% if request|selected_tab=='shop' %}text-primary{% else %}text-muted{% endif %}">
<i class="fas fa-store text-lg"></i>
<div class="text-small-extra">Shop</div>
</div>
</a>
</button>
{%- endif -%}
{% else %} {% else %}
<button type="button" class="nobackground border-0 col px-0 mr-3 btn btn-dead m-0"> <button type="button" class="nobackground border-0 col px-0 mr-3 btn btn-dead m-0">
<a href="/signup?redirect={{request.full_path | urlencode}}" class="text-decoration-none"> <a href="/signup?redirect={{request.full_path | urlencode}}" class="text-decoration-none">