Page 1 of 217

[ABD] AJAX Chat/Shoutbox MOD 2.0.0 Beta 8

Posted: Mon May 21, 2007 11:18 pm
by Handyman`
Classification: Add-on
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
Features:
  • AJAX Technology
  • No page re-loading required
  • Ability for Admins to delete posts in the Chat
  • Shows who's online in the Chat
Language: English

Licence: GNU General Public License v2

Screenshots: in action, On main page
Installation Level: Easy
Installation Time: ~3 Minutes
Format: Image
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
My Mod Roadmap: http://startrekguide.com/forum/f100-mod ... html#p8507

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

Find

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);

        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);  
Replace with

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);  
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.

Re: [Beta] AJAX Chat/Shoutbox Mod

Posted: Mon May 21, 2007 11:20 pm
by geoffreak
Wow, I didn't know your username was GroovePlugs here on phpbb.com :lol:

Re: [Beta] AJAX Chat/Shoutbox Mod

Posted: Mon May 21, 2007 11:21 pm
by igorw
Great work there, handyman!

Re: [Beta] AJAX Chat/Shoutbox Mod

Posted: Mon May 21, 2007 11:31 pm
by jerx
Wow, looks really nice! May I suggest a feature? Ability to show user' s avatars in the shoutbox. It uses up much resources and bandwidth, but my users love that and I think it helps keeping the site active.

One question though, why do I see a horizontal scroll bar?

Re: [Beta] AJAX Chat/Shoutbox Mod

Posted: Mon May 21, 2007 11:35 pm
by Handyman`
Yep… Handyman was taken here :P
Horizontal scroll bar… is that on my site or when you installed it on your site?
If it's on mine, which style are you viewing it in?

Re: [Beta] AJAX Chat/Shoutbox Mod

Posted: Mon May 21, 2007 11:44 pm
by jerx
It is on your site. It is the sniper pro style and I am viewing your site as a guest. To clarify the problem. I don' t mean a horizontal scroll bar at the bottom of my browser window. The shoutbox has the scrollbar in it, where the shouts are displayed.

Re: [Beta] AJAX Chat/Shoutbox Mod

Posted: Mon May 21, 2007 11:46 pm
by TimJBart
Is it possible to disable the memberlist on the right hand side? Looks good though 8-)

Re: [Beta] AJAX Chat/Shoutbox Mod

Posted: Tue May 22, 2007 12:35 am
by geoffreak
TimJBart wrote:Is it possible to disable the memberlist on the right hand side? Looks good though 8-)
Just edit the file to display it how you wish ;)

Re: [Beta] AJAX Chat/Shoutbox Mod

Posted: Tue May 22, 2007 12:45 am
by 3Di
Please provide a direct download link with no restriction. As per the Forum Rules. Thank you. ;)

Re: [Beta] AJAX Chat/Shoutbox Mod

Posted: Tue May 22, 2007 1:44 am
by Handyman`
3Di wrote:Please provide a direct download link with no restriction. As per the Forum Rules. Thank you. ;)
Thanks for the notice… link has been updated.

@Tim, you can change it however you like… it uses the style classes, so it would always match your style… if your style has them on the right, the chat will be on the right as well… but you can change it just by editing the stylesheet.

@jerx, check it out in subsilver and see if it's still there… append go to forum/chat.php?style=7

Re: [Beta] AJAX Chat/Shoutbox Mod

Posted: Tue May 22, 2007 2:01 am
by mariotendo
Very nice mod!

I was wondering if it was possible to use this on an ordinary web site, because I would really like to use a Shoutbox that uses the same database as my forum (I'm sure a few other people would like that feature as well).

Re: [Beta] AJAX Chat/Shoutbox Mod

Posted: Tue May 22, 2007 6:35 am
by Handyman`
We just upgraded to RC1, so the demo is down for a bit until I re-install it tomorrow.

@mariotendo, you can't use it outside of phpbb because it uses the user->data to find your username and such and it also needs the template system… however, you can put it on any page you want that has the basic phpBB3 session and template info.

Very easy to do, just follow the instructions near the bottom of the install file (shows how to place it on the index page) follow those instructions for any page you want it on.

Re: [Beta] AJAX Chat/Shoutbox Mod

Posted: Tue May 22, 2007 3:43 pm
by Arm@nd
How long are kept the shouts ?

Re: [Beta] AJAX Chat/Shoutbox Mod

Posted: Tue May 22, 2007 4:26 pm
by jerx
GroovePlugs wrote: @jerx, check it out in subsilver and see if it's still there… append go to forum/chat.php?style=7
Looks the same - horizontal scrollbar. But there is a very long shout from yesterday (at 22.42).

Re: [Beta] AJAX Chat/Shoutbox Mod

Posted: Tue May 22, 2007 6:00 pm
by SmashingPilot
Is there now way to have the chat available from the main forum index. Currently, for people to be able to access the chat, they need to type in the address location for the chat. I would love to have the chat available to post in below all my current forums.

Do you know what I mean?? Is that possible?


Thanks.