Advertisement:

Navigation

SMF Mod Site

Mod Name:
nneonneo's Shoutbox
Created By:
nneonneo
Type:
Chat/Shoutboxes
First Created:
December 23, 2006, 03:44:53 PM
Last Modified:
January 28, 2014, 01:32:11 PM
Latest Version:
1.22
Compatible With:
1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.1.7, 1.1.8, 1.1.14, 2.0 Beta 3 Public, 2.0 Beta 3.1 Public, 2.0 Beta 4, 2.0 RC1, 2.0
Total Downloads:
98288

Download this mod

SB_1.03.tgz (30kB) [3512]
SB_1.04.tgz (31kB) [938]
SB_1.05.tgz (32kB) [2484]
SB_1.06.tgz (31kB) [4241]
SB_1.07.tgz (32kB) [541]
SB_1.08.tgz (31kB) [1177]
SB_1.09.tgz (33kB) [447]
SB_1.10.tgz (32kB) [687]
SB_1.11.tgz (32kB) [1643]
SB_1.12.tgz (34kB) [1416]
SB_1.13.tgz (23kB) [1343]
SB_1.13_SMF2.tgz (22kB) [857]
SB_1.13_SMF2.zip (25kB) [1148]
SB_1.14b.tgz (23kB) [584]
SB_1.14b.zip (29kB) [1811]
SB_1.15.zip (29kB) [3649]
SB_1.16.zip (29kB) [1623]
AdvSB_1.16.zip (57kB) [1369]
SB_1.20.zip (32kB) [1166]
AdvSB_1.20.zip (64kB) [1776]
SB_1.17.zip (29kB) [1776]
AdvSB_1.21.zip (62kB) [1677]
SB_1.21.zip (30kB) [31578]
AdvSB_1.22.zip (64kB) [4720]
SB_1.22.zip (34kB) [14068]
SB_1.22b.zip (33kB) [6684]
Manual Install Instructions for SMF


Below are some preview images of what the mod looks like when being used

Description:

This shoutbox is based on the excellent work of Yuri Vishnevsky. It is an AJAX-powered shoutbox, making minimal adjustments to the forum software to avoid conflicts with existing mods.

The shoutbox needs no refreshing; just a modern AJAX-compatible web browser for the client. The script has been reworked for efficiency and minimal bandwidth use.

Questions and concerns may be directed to nneonneo {at} gmail {period} com or posted to the discussion thread for this mod.

Screenshot: (administrator's view) - 1.03 version shown


This mod has been tested with SMF 1.1.14 and SMF 2.0 Final, and with Opera (9.0+), Safari (2.0+), Firefox (2.0+), Camino (1+), Internet Explorer (6+) and Konqueror (3+).

Table of Contents
Advanced Shoutbox
Live Demos
Translations
Editable Options
Installation to Other Themes
Tips and Customizations
Troubleshooting
Changelog
Upgrading to the Latest Version

Advanced Shoutbox
SunKing and MrMoney, from the community forums, helped incorporate many of the more popular customizations into a modified shoutbox package, dubbed the "Advanced AJAX Shoutbox". It can be downloaded from this mod page as the AdvSB_ series of packages. The package includes the basic shoutbox, icons for the History, Commands etc. links, the sound mod, two-line display and other miscellaneous customizations.


Live Demos
Live Demo available at http://nneonneo.net46.net/smf/ for SMF 1.1.5 (and TinyPortal) and http://nneonneo.net46.net/smf2/ for the Advanced Shoutbox running in SMF 2.0. You do not need to have an account to test the shoutbox.


Translations
All translations are posted here.
Note: Translations from 1.11 onwards should work fine with 1.16, and translations for 1.20 onwards work with 1.22.
Translations from 1.16 and before are not complete for 1.2x, as a few more strings were added in 1.20.

1.01-1.16 translations (updates for 1.20 welcome)

  • Türkçe (Turkish) translation, provided by o2gr of http://www.ozgur.be/
  • Ελληνικά (Greek) translation, from petr00kos of http://www.oink.gr/
  • Português (Portuguese) translation from 4T3IG0
  • Italiano (Italian) translation from Mystiquo
  • Français (French) translation from Patriiick
  • Hrvatski (Croatian) translation from ameo

1.20+ translations (also work for 1.16 and below)
  • Polski (Polish) translation by Kangel
  • Русский (Russian) translation by EugeneLoza
  • Deutsch (German) translation by womble
  • Български (Bulgarian) translation by amorphine
  • Italiano (Italian) translation from leonardus
  • Hrvatski (Croatian) translation from ameo
  • Македонски (Macedonian) translation from Picobrain

Thanks to everyone for making translations! If you'd like to make a translation, PM me (nneonneo) on the community forums.


Editable Options
in yshout/settings.php and yshout/settings.js: read the comments
in index.template.php:
  • $shoutFile can be edited to allow different themes to use different shout files
  • CSS block in the <head> section (search for #yshout) allows customizable appearance
Permissions for the shoutbox: in the admin panel, under Membergroups->Permissions.
More information available in the official thread.


Installation to Other Themes
In the theme's "index.template.php" file:
find
Code: [Select]
// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="' . $scripturl . '?board=' . $context['current_board'] . '.0" />';
After that, add
Code: [Select]
// YSHOUT HERE - <head> code
global $boardurl,$shoutFile;
$shoutFile='home';
$scripturlparsed = parse_url($scripturl);
$scriptpath=isset($scripturlparsed['path'])?$scripturlparsed['path']:'/';
$args='';
foreach($_GET as $key => $value) // passthrough $_GET
$args.='&'.urlencode($key).'='.urlencode($value);
echo '
<script src="',$boardurl,'/yshout/js/moo.ajax.js" type="text/javascript"></script>
<script src="',$boardurl,'/yshout/settings.js" type="text/javascript"></script>
<script type="text/javascript"><!-- // --><![CDATA[
if (window.addEventListener){
window.addEventListener("load", function(){loadChat();}, false);
} else if (window.attachEvent){
window.attachEvent("onload", function(){loadChat();});
}
var shoutFile="',$shoutFile,'";
var yshout_php="',$scriptpath,'?yshout',$args,'";
// ]]></script>
<script src="',$boardurl,'/yshout/js/yshout.js?July062008" type="text/javascript"></script>
<style type="text/css">
#yshout {
font-size: 10px;
overflow: hidden;
}
#yshout #yshout-toollinks { /* tool links (History, Commands, etc.) */
}
#yshout #shouts { /* main shouts area */
}
#yshout .shout { /* one shout */
margin: 0 0 0; /* Top Bottom Linespacing */
line-height: 1;
}
#yshout .shout-timestamp {
font-style: normal;
font-weight: normal;
}
#yshout .shout-adminlinks { /* del and ban buttons */
font-size: 6pt;
color: #141414;
}
#yshout #shout-form {
margin: 0;
padding: 0;
}
#yshout #shout-form fieldset {
border: none;
}
#yshout #forum-name {
width: 70px;
margin-right: 5px;
}
#yshout #shout-text {
width: 310px;
margin-right: 5px;
}
#yshout #shout-button {
width: 55px;
}
#yshout .shout-invalid { /* invalid shout (shout textbox) */
background: #FFFDD1;
}
</style>';
// YSHOUT END - <head> code

Second, find the desired location of the shoutbox and place at that location (in the index.template.php file!) *one* of the two blocks below:

For an "instant-on" shoutbox which loads with the page:
Code: [Select]
// YSHOUT HERE - shoutbox code
global $txt,$context,$boarddir;
if(allowedTo('yshout_view'))
{
echo '<br /><b>',$txt['yshout_shoutbox'],'</b><br /><br />';
echo '<div id="yshout">';
include_once($boarddir.'/yshout/yshout.php');
echo '</div>';
}
elseif($context['user']['is_guest'])
echo $txt['yshout_no_guests'];
// YSHOUT END - shoutbox code

For the original 1.16 behaviour (shoutbox loads after the page has fully loaded):
Code: [Select]
// YSHOUT HERE - shoutbox code
echo '
<br /><b>',$txt['yshout_shoutbox'],'</b><br /><br />
<div id="yshout">',$txt['yshout_loading'],'<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>';
// YSHOUT END - shoutbox code


Tips and Customizations
Putting the shoutbox on a separate page: Copy yshout/index.php to the desired location and modify $boardurl per the instructions in the file. Note that just visiting /forum/yshout/ will get you a simple forum-less shoutbox.

Installing to TinyPortal: Follow the instructions for the "<head> code" block under Installation to Other Themes, then add either of the "shoutbox code" blocks to a new TinyPortal center phpbox.

Adding a smileys bar:
see http://www.simplemachines.org/community/index.php?topic=137508.msg1388091#msg1388091 (thank you pongsak!)

Adding a clicking sound to new/incoming posts: see http://www.simplemachines.org/community/index.php?topic=137508.msg1208212#msg1208212 for how to do this using SoundManager2.
http://www.simplemachines.org/community/index.php?topic=137508.msg1652792#msg1652792 for the user option for muting the sound.

Showing a scrollbar: see http://www.simplemachines.org/community/index.php?topic=137508.msg1532028#msg1532028

Installation to the news header: see http://www.simplemachines.org/community/index.php?topic=137508.msg1534963#msg1534963

Changing the timestamp: see http://www.simplemachines.org/community/index.php?topic=137508.msg1630065#msg1630065

Notifying users of new topics and replies in the forum: see http://www.simplemachines.org/community/index.php?topic=137508.msg1817042#msg1817042

Troubleshooting
No text? If you aren't using English on your board, you will need to add the following code to Themes/default/languages/Modifications.<language>.php, right above the final "?>" in the file (you're welcome to translate and localize this text; if you do so, you can PM me with the translation and I will post it with credit to you):
Code: [Select]
// ---- Begin modification - nneonneo's Shoutbox ----
$txt['yshout_shoutbox'] = 'Shout Box';
$txt['yshout_loading'] = '...loading shoutbox...';
$txt['yshout_rp_banned'] = "Sorry, you've been banned from the shoutbox.";
$txt['yshout_no_guests'] = 'Sorry, you must be logged in to use the shoutbox!';
$txt['yshout_ban_conf'] = 'Ban Confirmation';
$txt['yshout_select_mode'] = 'Select Ban Mode:';
$txt['yshout_rp'] = 'Reading and Posting';
$txt['yshout_p'] = 'Posting only';
$txt['yshout_error'] = 'ERROR: ';
$txt['yshout_no_user'] = 'User not found.';
$txt['yshout_del_success'] = 'Shout deleted.';
$txt['yshout_no_action'] = 'Nothing to do.';
$txt['yshout_history'] = 'History';
$txt['yshout_commands'] = 'Commands';
$txt['yshout_exthistory'] = 'ExtendedHistory';
$txt['yshout_hide'] = 'Hide';
$txt['yshout_show'] = 'Show';
$txt['yshout_admlinks'] = 'AdminLinks';
$txt['yshout_return'] = 'ReturnToShoutbox';
$txt['yshout_p_banned'] = 'You are banned from posting.';
$txt['yshout_banned'] = 'Banned';
$txt['yshout_shout_button'] = 'Shout!';
$txt['yshout_banlist_caption'] = 'Shout Box Bans (click to unban)';
$txt['yshout_ip_bans'] = 'IP Bans for ';
$txt['yshout_username_bans'] = 'Username Bans for ';
$txt['yshout_ban_type_error'] = 'use /banuser or /banip!';
$txt['yshout_ban_mode_error'] = 'Must have mode argument.';
$txt['yshout_imp_slash_error'] = 'Prefix shout with "/" (slash character)! See "/help impersonate" for details.';
$txt['yshout_imp_uname_error'] = 'No username given!';
$txt['yshout_imp_max4_error'] = 'Maximum 4 arguments!';
$txt['yshout_cmd_reference'] = 'Command Reference';
$txt['yshout_cmdlist'] = array(
'/help' => ' [command]: Help on a command, or all if no command is specified.',
'/return' => ': Go back to the Shout Box.',
'/pi' => ' [digits]: What is the value of pi to the nth digit?',
'/me' => ' &lt;message&gt;: Emotes the message (e.g. <span class="meaction"> * Nathaniel likes dogs</span>)');
$txt['yshout_cmdlistadmin'] = array(
'/clear' => ': Completely empty the Shout Box.',
'/help' => ' [command]: Help on a command, or all if no command is specified.',
'/return' => ': Go back to the Shout Box.',
'/banlist' => ': List all bans currently in place. Unban the users by clicking on their names.',
'/banuser' => ' &lt;mode&gt; &lt;username&gt;: Ban a user by name. You should use the user\'s real username, otherwise the ban can be evaded. Mode can be "u" to unban, "rp" for read and post bans, or "p" for a post ban.',
'/banip' => ' &lt;mode&gt; &lt;IP&gt;: Ban a user by IP. Mode can be "u" to unban, "rp" for read and post bans, or "p" for a post ban.',
'/impersonate' => ' &lt;user&gt; [userlevel] [ip] [userid] /[shout text]: Impersonate a user. Shout text must be prefixed by a "/" or else it will fail.<blockquote><div>
&lt;user&gt;: Username to use<br />
[userlevel]: User Level to use. 0=normal, 1=mod, 2=admin<br />
[ip]: IP address to use, as 1.2.3.4<br />
[userid]: User ID from forum, to fix profile link</div></blockquote>',
'/lock' => ' &lt;message&gt;: Lock the shoutbox for maintenance with the specified message.',
'/unlock' => ': Release the shoutbox from maintenance.');
$txt['yshout_maintenance'] = 'Locked';
$txt['yshout_lock_arg_error'] = 'You need to specify a reason for maintenance!';
$txt['yshout_lock_changed'] = 'Changed maintenance reason to "%s".';
$txt['yshout_lock_success'] = 'Locked shoutbox for maintenance with reason "%s".';
$txt['yshout_unlock_already'] = 'Failed to unlock: shoutbox isn\'t locked!';
$txt['yshout_unlock_success'] = 'Successfully unlocked shoutbox.';
$txt['yshout_no_posting'] = 'Sorry, you cannot post to the shoutbox.';
$txt['yshout_smilies'] = "Smilies";
// Permissions
$txt['permissiongroup_yshout'] = 'Shoutbox';
$txt['permissionname_yshout_view'] = 'View shoutbox';
$txt['permissionname_yshout_post'] = 'Post in shoutbox';
$txt['permissionname_yshout_moderate'] = 'Moderate shoutbox';
$txt['permissionhelp_yshout_view'] = 'This permission allows access to the shoutbox. If it is enabled, users will see the shoutbox and the chats in it.';
$txt['permissionhelp_yshout_post'] = 'This permission allows users to post messages to the shoutbox. If it is disabled, users cannot enter any messages.';
$txt['permissionhelp_yshout_moderate'] = 'If this permission is set, users will be allowed to moderate the shoutbox -- deleting, banning and clearing among other features.';
$txt['permissiongroup_simple_yshout'] = 'Shoutbox';
// ---- End modification - nneonneo's Shoutbox ----
above the final "?>" in your version of Themes/default/languages/Modifications.XXXX.php (where XXXX represents your localization/language)

PortaMx warnings in shoutbox: If warnings like this:
Code: [Select]
Notice: Undefined index: forum in /home/.../public_html/smf/Sources/Subs.php on line 3936
Notice: Undefined index: PortaMx in /home/.../public_html/smf/Sources/Subs.php on line 3938
Notice: Undefined index: pmx_settings in /home/.../public_html/smf/Sources/Subs.php on line 4000
Notice: Undefined index: pmx_blocks in /home/.../public_html/smf/Sources/Subs.php on line 4005
Notice: Undefined index: PortaMx in /home/.../public_html/smf/Sources/Subs.php on line 4207
are showing up in the shoutbox, see http://www.simplemachines.org/community/index.php?topic=137508.msg1829501#msg1829501 for a fix.

High bandwidth use for large forums: This shoutbox was never designed for very large forums. The limitations of PHP make it difficult, if not impossible to implement real ("live") chatting features without being resource-heavy.

That said, there is something you can do about it. The shoutbox can be made less taxing, at the cost of less interactivity.

The basic procedure is to set refreshTime in yshout/settings.js to something higher, like 20000 (milliseconds). After that, reduce $updateTimeout in yshout/settings.php to 10 seconds or less (0 will make the shoutbox behave like an autorefreshing shoutbox (with a delay controlled by refreshTime), rather than a shoutbox that updates automatically on new shouts).

You might also want to try enabling compression in the settings file: change $gzipCompression to true.

Changelog
Changes in 1.03 [announcement]:
Fixed incompatibility with PHP <= 4. This package can be upgraded directly over the previous version (1.02).

Changes in 1.04 [announcement]:
Fixed timezone issues (all times formatted according to user data with timeformat). Times shown will be according to user and forum time offsets.

Changes in 1.05 [announcement]:
Added a "del" option to shouts for administrators/moderators to allow for the deletion of shouts.
Added "$gzipCompression" option; this defaults to true but can be set to false if you experience issues.
Increased the security of a few functions as a precaution.
Fixed some bugs related to not using "home.txt" as the chat file. Now, it is possible to use a different file for each theme, or, if you're intrepid, a different file for different boards/users/etc. See index.template.php and search for "shoutFile".

Changes in 1.06 [description] [announcement]:
Guest support added by popular request.
Character encodings bug fixed.
Word filtering added (filters according to SMF settings)
1.1.2 support added and tested
New options to limit chat command usage (e.g. blocking commands or entirely disabling them; see yshout.php options)
Internationalization support added: default language is English (though translations are certainly welcome)
Added support for search-engine friendly pages.

Changes in 1.07 [announcement]:
Fixed long standing smileys issue.
Fixed minor bug with line counting (off-by-one)
Added CSS class "adminlink" to allow for customization of the administrative links.
1.1.3 support added.

Changes in 1.08 [announcement]:
Major bugfix and enhancement to auto-refreshing; the shoutbox should now be suitable for big forums as well as small. The basic gist of the upgrade is at http://www.simplemachines.org/community/index.php?topic=137508.msg996154;topicseen#msg996154 (thank you very much Sarke) coupled with a few minor changes that make the "push" shoutbox work :)

Changes in 1.09 [announcement]:
Addition of "$maxShoutChars" and "$maxUsernameChars" parameters for controlling shout and username lengths respectively; note that the username limit does NOT apply to registered users.
Addition of a maintenance/lock mode, activated by the /lock command and deactivated by /unlock, which makes the shoutbox read-only for everyone except admins & mods.

Changes in 1.10 [announcement]:
Compatibility with SMF 1.1.4.

Changes in 1.11 [announcement]:
Option to prevent guests from posting added. If allowGuests is true, they can still see the shoutbox, and if the new allowGuestsPosts is false, then they will be barred from posting.
The bug for pressing "Cancel" on the Extended History dialog is fixed (it now appropriately cancels, rather than redirecting to an empty history page) - thanks to pongsak for discovering this.
Users who have multiple domains or use both "www." and no-www versions of their domain names can now do so without having the shoutbox fail. The shoutbox now uses absolute paths from the server root, instead of including a domain name.

Changes in 1.12 [announcement]:
Added the option to set certain membergroups as moderators of the shoutbox.
Made the shoutbox use usergroup colors by default
One more fix for stubborn "...loading shoutbox..." problems. I've tested this on a number of configurations, and I think it should work for everyone properly now.
Fix to prevent long page loads on IE 7. Basically, on any page load request, the shoutbox aborts the current connection, using an IE-7 specific detection of that. It's a serious kludge, but it does resolve the lag on IE 7.

Changes in 1.13 [announcement]:
Removed yshout/js/prototype.js and replaced it with a much smaller file containing only the necessary components. The old prototype.js caused problems with SMF's stats page.
Moved CSS out of index.template.php and yshout.php into their own files, Themes/default/yshout-style.css and yshout/yshout-style.css respectively. This makes upgrading, installation and uninstallation much easier. Other themes don't need to be updated.

Changes in 1.14 [announcement]:
Fixed a refresh bug that could cause many requests to be sent to the server.
Merged SMF1 and SMF2 versions together. One package now works for both versions of SMF.

Changes in 1.14b [announcement]:
Fixed non-ASCII character support (regression in 1.14). Thanks to dannbass for spotting it.

Changes in 1.15 [announcement]:
Compatibility with SMF 1.15 and 2.0b3.1.
Proper support for SMF 2: fixed membergroup detection and user banning.
Installation to SMF2 via the Package Manager should work again.

Changes in 1.16 [announcement]:
Fixed storage of foreign usernames in shoutbox
Fixed postgroup bug that could cause shoutbox to fail to load

Changes in 1.20 [announcement]:
Instant-on capability for quick loading
Security fixes
Guest name url-encoding bug fixed
Settings and documentation moved to a separate files
Permissions implemented as SMF membergroup permissions
Full XHTML-compliance
Additional functions to make modifying the shoutbox easier
Additional CSS classes for more customizability
Changed /yshout/ to act as a standalone shoutbox
Hooked index.php to fix the majority of "loading shoutbox" problems with previous versions
Added a warning for missing language files to alleviate problems with foreign boards
Many miscellaneous fixes

Changes in 1.17 (last planned release of 1.1x) [announcement]:
Security fix

Changes in 1.21 [announcement]:
Removed dependencies on the Behaviour, Prototype and domFunction libraries.
Fixed a few bugs in form submission and flood control.
Fixed a bug that broke Whos Online (reported by bocco83).
Fixed security bug
Added postgroup colors

Changes in 1.22 [announcement]:
Proper SMF 2.0 Beta 4 compatibility
$gzipCompression now defaults to off, to avoid common issues with forums
Shoutbox no longer restarts session if forced to refresh

Changes in 1.22b:
Minor CSS updates for SMF 2.0 Final.

Upgrading to the Latest Version
1.2x versions are not backwards-compatible with 1.1x or 1.0x shoutbox versions. Previous versions should be uninstalled prior to installing 1.22.

1.22 includes an updater from 1.21 which you can use to update without having to uninstall.