Rooms showing hidden users online to guests

Chat rooms for mChat with optional password protection and 1-on-1 chats
User avatar
kasimi
mChat developer
Posts: 985
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: Rooms showing hidden users online to guests

#11

Post by kasimi » 10 Sep 2019, 10:22

:+1:

Gary
Donor
Posts: 8
Joined: 24 Sep 2018, 22:28

Re: Rooms showing hidden users online to guests

#12

Post by Gary » 10 Sep 2019, 10:54

In the template called mchatroom_users.html

I tried using that phpbb conditional you said and it still doesn't work.

I tried wrapping the online code in that template with this, expecting it would only show users online information to members and not guests. But it also hides it from logged in users as well.

Code: Select all

- This code is only accessible to donors -
{% if S_USER_LOGGED_IN %}
<ul class="mchat-rooms-users">
{% for user in loops.mchatroom_users %}
<li data-mchatrooms-user="{{ user.USER_ID }}" data-mchatrooms-room="{{ user.ROOM_ID }}">{{ user.USER_NAME }}{% if user.IS_KICKABLE %} <a href="#" data-mchatrooms-action="kick" title="{{ lang('MCHATROOMS_KICK') }}"><i class="icon fa fa-times-circle fa-fw" aria-hidden="true"></i><span class="sr-only">{{ lang('MCHATROOMS_KICK') }}</span></a>{% endif %}</li>
{% endfor %}
</ul>
{% endif %}

Gary
Donor
Posts: 8
Joined: 24 Sep 2018, 22:28

Re: Rooms showing hidden users online to guests

#13

Post by Gary » 10 Sep 2019, 13:26

Removed this, found out it's some people playing games against the shoutbox that have managed to keep causing that error to happen on and off

User avatar
kasimi
mChat developer
Posts: 985
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: Rooms showing hidden users online to guests

#14

Post by kasimi » 12 Sep 2019, 16:20

The template file is loaded by AJAX which doesn't render any page header which is where S_USER_LOGGED_IN is assigned to the template. Use {% if user.data.is_registered %} instead.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests