cBB Chat Who is online?


Avatar de Usuario
coralyn
 
Mensajes: 13
Registrado: Mié Mar 21, 2018 12:57 pm
 Jue Mar 22, 2018 8:56 am • a través de Web
Hello!

Thank you so much for this awesome chat. Cheap and great! Many thanks!
phpbb: 3.2.1 / cBB Chat v1.1.3
One question: Who can i show on index, who is online in chat?

viewtopic.php?t=512&lang=en
This is outdated, i think.

Greetings from germany,
coralyn
Avatar de Usuario
coralyn
 
Mensajes: 13
Registrado: Mié Mar 21, 2018 12:57 pm
 Jue Mar 22, 2018 2:19 pm • a través de Web
It works:

open / includes / functions.php

add before 'SITENAME' => $config['sitename'],
Código: Seleccionar todo
//Begin cbb chatters online
   $chatters = '';
        $sql = 'SELECT u.user_id, u.username, u.user_colour FROM[b][u] [ADD YOUR SUFFIX][/u][/b]_chat_users c, ' . USERS_TABLE . ' u
             where c.user_online = 1 AND c.user_id = u.user_id';

   $result = $db->sql_query($sql);
             while ($row = $db->sql_fetchrow($result)) {   
       $chatters .= get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']) . ', ';
    }
    $db->sql_freeresult($result);

    if ($chatters == '') {$chatters = 'Keine Mitglieder im Chat';}
   else {$chatters = '<b>Im Chat:</b>&nbsp;</a>' . substr($chatters, 0, -2);}   
   
// End cbb chatters online


add before 'SITENAME' => $config['sitename'],
Código: Seleccionar todo
'CHATTERS'                     => $chatters,


Add after Who is online (i have got this on top in my styles/myStyle/template/overall_header.html)
Código: Seleccionar todo
{CHATTERS}


Example:
Código: Seleccionar todo
<p>{SITE_DESCRIPTION}</p>
<!-- IF S_REGISTERED_USER -->Wer ist online?<br>{LOGGED_IN_USER_LIST} <br><!-- ENDIF --><!-- IF S_REGISTERED_USER -->[b][u]{CHATTERS}[/u][/b]<!-- ENDIF -->


I have make it visible only for registered users.
Greetings
Avatar de Usuario
coralyn
 
Mensajes: 13
Registrado: Mié Mar 21, 2018 12:57 pm
 Lun Feb 08, 2021 8:56 am • a través de Web
Has anyone here found a more elegant solution?
The display is not really helpful, as often users are still displayed who are no longer in the chat (but are still displayed so in the database)...

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 0 invitados