- Estás aquí:
- Inicio › Foro › Application Support
who is online on board index cbbchat?
2 mensajes
• Página 1 de 1
-
- Mightymax
- Mensajes: 2
- Registrado: Lun Oct 01, 2018 4:44 pm
Mar Oct 02, 2018 12:06 pm • a través de Web
Hi,
Is it possible to add users present on the chat on the index page of the forum? (with "who is online" phpbb)
Thanks
Is it possible to add users present on the chat on the index page of the forum? (with "who is online" phpbb)
Thanks
-
- Mightymax
- Mensajes: 2
- Registrado: Lun Oct 01, 2018 4:44 pm
Mié Oct 03, 2018 8:46 am • a través de Web
Hi,
i solved my problem with this topic :
https://www.canidev.com/viewtopic.php?f=22&t=862
https://www.canidev.com/viewtopic.php?t=512&lang=en
but we must adapt the instructions.
open /includes/functions.php
add before $template->assign_vars(array(
add before 'SITENAME' => $config['sitename'],
open /styles/your style/template/index_body.html
add before <!-- EVENT index_body_birthday_block_before -->
Open /phpbb/session.php
add after $provider->logout($this->data, $new_session);
Thanks to IvanPF and coralyn
and the result:
i solved my problem with this topic :
https://www.canidev.com/viewtopic.php?f=22&t=862
https://www.canidev.com/viewtopic.php?t=512&lang=en
but we must adapt the instructions.
open /includes/functions.php
add before $template->assign_vars(array(
- Código: Seleccionar todo
//Begin cbb chatters online
$chatters = '';
global $chat;
$sql = 'SELECT u.user_id, u.username, u.user_colour FROM YOUR PREFIX_chat_users c, ' . USERS_TABLE . ' u
WHERE c.user_online = 1 AND c.user_id = u.user_id
AND c.user_lastjoin > ' . $chat->time_limit;
$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 = 'Aucun utilisateur';}
else {$chatters = '<b></b> </a>' . substr($chatters, 0, -2);}
// End cbb chatters online
add before 'SITENAME' => $config['sitename'],
- Código: Seleccionar todo
'CHATTERS' => $chatters,
open /styles/your style/template/index_body.html
add before <!-- EVENT index_body_birthday_block_before -->
- Código: Seleccionar todo
<!-- IF S_REGISTERED_USER -->Qui est sur le Tchat?<!-- ENDIF --><!-- IF S_REGISTERED_USER -->{CHATTERS}<!-- ENDIF -->
Open /phpbb/session.php
add after $provider->logout($this->data, $new_session);
- Código: Seleccionar todo
if(!empty($config['chat_enabled']))
{
global $chat;
if(!defined('CHAT_USERS_TABLE'))
{
include($phpbb_root_path . "ext/canidev/chat/constants.$phpEx");
}
// Delete from chat users if no banned
$sql = 'DELETE FROM ' . CHAT_USERS_TABLE . '
WHERE user_id = ' . $this->data['user_id'] . "
OR user_ip = '" . $this->ip . "'
AND exclude_time = 0";
$db->sql_query($sql);
// Set the correct user statusif banned
if(!$db->sql_affectedrows())
{
$sql = 'UPDATE ' . CHAT_USERS_TABLE . '
SET user_online = 0
WHERE user_id = ' . $this->data['user_id'] . '
AND exclude_time > 0';
$db->sql_query($sql);
}
// Delete private messages
if(method_exists($chat, 'obtain_room'))
{
$room_ary = $chat->obtain_rooms();
$sql = 'DELETE FROM ' . CHAT_MESSAGES_TABLE . '
WHERE (poster_id = ' . $this->data['user_id'] . '
AND ' . $db->sql_in_set('dest_key', array_keys($room_ary), true) . ')
OR dest_key = ' . $this->data['user_id'];
$db->sql_query($sql);
}
$cookie_expire = $this->time_now - 31536000;
$this->set_cookie('chat_key', '', $cookie_expire);
$this->set_cookie('chat_lastcheck', '', $cookie_expire);
}
Thanks to IvanPF and coralyn
and the result:
2 mensajes
• Página 1 de 1
¿Quién está conectado?
Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 0 invitados
- Contenido
- Descargas
- En desarrollo
- Comunidad y Soporte
- Rss
- Enlaces de Interés
- phpBB Oficial
- phpBB Oficial (Español)
- Raul Arroyo Monzo
- PasionReef
- Sobre CaniDev
- Condiciones de uso
- Política de Privacidad
- Sobre nosotros
- Contacto
- © 2011-2024 CaniDev