AJAX Shoutbox (for phpBB 2.0)

Brief Description of AJAX Shoutbox with Sounds

This is a version of Kinfule’s AJAX Shoutbox for phpBB 2.x (an Alpha mod) integrated so that when chat messages are posted, a notification sound can also be played. The Javascript SoundManager 2 library (which actually calls Flash to render the sound) was used to create the sounds. This integration was developed for a client. Since it was based on products developed with open source licenses it is incumbent upon me to make this integration also available to the public. However, since its status is Alpha, you should be mindful that it has not been independently tested and certified by the phpBB Mod team. It may have critical bugs and security issues.

Detailed Description of AJAX Shoutbox with Sounds

Author Kinfule wrote an AJAX Shoutbox mod for phpBB. There are a number of shoutbox mods for phpBB but this one is sophisticated because it uses AJAX (Asynchronous Javascript and XML) to periodically check the phpBB board for new chat messages. No page refresh is needed. However, this particular mod (to the best of my knowledge) never went beyond Alpha status. However it seems to work fine. While chat messages can be sent and received easily enough, there is no way to know if a new chat message have been received unless you watch the screen. With this mod a sound can optionally play when a chat message is received. This allows you to do other things provided you leave the chat page open. (The chat window can be minimized.) Of course make sure your speakers are turned on so you can hear the sounds.

SoundManager 2 is a Javascript library created by Scott Shiller under a BSD license. SoundManager acts as a conduit to Flash, which actually plays the sounds. Since Flash is installed in most browsers, 99% of browsers can play sounds through the Flash extension. Web page for SoundManager 2 is here.

I integrated version Version 2.0b.20070415 of the SoundManager 2 Javascript library. It is included in this package. You do not need to download it. However, a newer version may be available. Any sounds with a .mp3 extension placed in /soundmanagerv20/sounds can be selected. A set of default sounds are provided. Feel free to add or delete your own sounds. Note that Flash can only play MP3 files, so consequently this is also a limitation of SoundManager 2.

Also I extended the AJAX Shoutbox for a customer to allow a short “view” of the chat window suitable for placing on the main index or elsewhere. The view does not include sounds. The assumption is that if you want to hear sounds you have the chat page (chat.php) open, typically in a tab. When you hear a sound you know that a new chat message has been received. You can sample the sounds by selecting them. Your own chat messages will also invoke a sound.

Here is an example of how the shoutbox view could be included on the main index. Typically you would place it inside a table cell. You would have to rework the layout of index_body.tpl.

<td height="25"><iframe src="./shoutbox_view.php?width=250&height=200" width="250" height="200" marginheight="0" marginwidth="0" scrolling="no"></iframe></td>

A few shoutbox defaults were changed. The chat window is a bit taller to accommodate the additional controls. There are a few variables you can change as needed near the top of shoutbox.php:

$sound_file_dir = './soundmanagerv20/sounds/'; // Location of MP3 files on server to be used by SoundManager. Change as necessary.
$sound_cookie_expires_days = '365'; // Number of days before the sound cookies expires. Default is one year.

phpBB 3.x Compatibility

Please note that this mod works only with phpBB version 2.x.

phpBB 2.x Future Development

Since the Shoutbox mod was not done by me and never went beyond Alpha status, I will likely only update this mod if its status changes or is upgraded, or there is a new version of the SoundManager Javascript library.

Support

This software is very old so I don’t support it. Use it at your own risk.

Version Archive and Notes

If you are interested in purchasing my services to install the this modification, click here.

Version Date Functionality
0.1 09/20/2007 This is an initial release, which like the Shoutbox mod should be considered Alpha status. It has not been approved by the phpBB Mod Team. If you install this, you need to be mindful of that it may be buggy or have security related issues. Please report any installation errors or bugs that you encounter.


If you administer a phpBB board, you should find my book Mastering phpBB Administration invaluable. Learn lots of tips, tricks and secrets I learned from serving over 400 clients. Paper and Kindle versions available.

Leave a Reply

Your email address will not be published. Required fields are marked *