phpBB Part: Forum
MOD Name: AJAX Chat
MOD Version: 2.0.0 Beta 8
Author: Handyman
MOD Description: This Mod Adds AJAX Chat to your forum.
Demo: AJAX Chat MOD Demo
Users can chat without ever needing to reload the page.
Works with:
- phpBB 3.0.x
- AJAX Technology
- No page re-loading required
- Ability for Admins to delete posts in the Chat
- Shows who's online in the Chat
Licence: GNU General Public License v2
Screenshots: in action, On main page
Installation Level: Easy
Installation Time: ~3 Minutes
Format:
Download File: Download
Roadmap
- Add smilies button
- Show smilies in chat room
- Multiple Rooms (Progress = 25%)
- Report Post/Users
- Add Quote Button
- Enable Author Delete
- Private Rooms
- Send Chat Requests
- Reset Chat button
- Avatar Thumbnails with Fullsize Rollovers.
- Chat Logs
If you would like to be able to automatically remove all chat messages that can no longer be seen (if you don't want logs)
you can do this:
Handyman` wrote:open chat.php
FindReplace withCode: Select all
$sql = 'SELECT * FROM ' . CHAT_TABLE . ' ORDER BY message_id DESC'; $result = $db->sql_query_limit($sql, 25); $rows = $db->sql_fetchrowset($result); foreach ($rows as $row) { if ($count++ == 0) { $last_id = $row['message_id']; } $template->assign_block_vars('chatrow', array( 'MESSAGE_ID' => $row['message_id'], 'USERNAME_FULL' => clean_username(get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $user->lang['GUEST'])), 'MESSAGE' => generate_text_for_display($row['message'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options']), 'TIME' => $user->format_date($row['time']), 'CLASS' => ($row['message_id'] % 2) ? 1 : 2, )); } $db->sql_freeresult($result);
That will then delete all messages older than the last one displayed in the chat and will also only delete when you first view the chat.Code: Select all
$sql = 'SELECT * FROM ' . CHAT_TABLE . ' ORDER BY message_id DESC'; $result = $db->sql_query_limit($sql, 25); $rows = $db->sql_fetchrowset($result); $db->sql_freeresult($result); $delete_id = 0; foreach ($rows as $row) { if ($count++ == 0) { $last_id = $row['message_id']; } $template->assign_block_vars('chatrow', array( 'MESSAGE_ID' => $row['message_id'], 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $user->lang['GUEST']), 'MESSAGE' => generate_text_for_display($row['message'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options']), 'TIME' => $user->format_date($row['time']), 'CLASS' => ($row['message_id'] % 2) ? 1 : 2, )); $delete_id = $row['message_id']; } $sql = 'DELETE FROM ' . CHAT_TABLE . ' WHERE message_id < ' . $delete_id; $db->sql_query($sql);