Displayed the Online User from Chat in the Forum

190 views
Skip to first unread message

Martin S

unread,
May 27, 2016, 2:07:33 AM5/27/16
to AJAX-chat
Hello,

This chat are released for phpbb 3.1, but i missed some features, in the version for phpbb 3.0 you can displayed the Online User from Chat in the Forum. But the Documentation dont Work anymore for phpbb 3.1
It fails at this $ _SERVER query . Can anyone help here ?

Best regards
Martin

cpg

unread,
May 27, 2016, 5:52:17 AM5/27/16
to AJAX-chat
Hallo,
you have to edit the includes/functions.php

 $chatters = '';
    $sql = 'SELECT u.user_id, u.username, u.user_colour FROM ajax_chat_online c, ' . USERS_TABLE . ' u
    WHERE c.userID = 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);}


'CHATTERS'         => $chatters,

Best regards
cpg

cpg

unread,
May 27, 2016, 10:07:35 AM5/27/16
to AJAX-chat

Hallo,

the first part

above

// The following assigns all _common_ variables that may be used at any point in a template.

and

'CHATTERS'         => $chatters,

under

        'SITENAME'                        => $config['sitename'],
        'SITE_DESCRIPTION'                => $config['site_desc'],
        'PAGE_TITLE'                    => $page_title,
      



in overall_header.html you can show the Chatters in this way:

<!-- IF not S_IS_BOT--><p>{CHATTERS}</p><!-- ENDIF -->

Best regards





Am Freitag, 27. Mai 2016 08:07:33 UTC+2 schrieb Martin S:

Martin S

unread,
Jul 14, 2016, 7:58:29 AM7/14/16
to AJAX-chat
Hello cpg,
Thank you for instructions now it works! It is also possible to display the number of users?

e.g .:
5 users in the chat

Best regards
Martin

Reply all
Reply to author
Forward
0 new messages