cBB Chat Who is online?




coralyn
 
Posts: 3
Joined: Wed Mar 21, 2018 12:57 pm

cBB Chat Who is online?

Postby coralyn » Thu Mar 22, 2018 8:56 am • via 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


coralyn
 
Posts: 3
Joined: Wed Mar 21, 2018 12:57 pm

Re: cBB Chat Who is online?

Postby coralyn » Thu Mar 22, 2018 2:19 pm • via Web
It works:

open / includes / functions.php

add before 'SITENAME' => $config['sitename'],
Code: Select all
//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'],
Code: Select all
'CHATTERS'                     => $chatters,


Add after Who is online (i have got this on top in my styles/myStyle/template/overall_header.html)
Code: Select all
{CHATTERS}


Example:
Code: Select all
<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

Who is online

Users browsing this forum: No registered users and 1 guest

cron