Additional Info
Type
Package ID
Deep:SMF_Shoutbox_LanguagePack
First Created
March 08, 2006, 09:37:22 AM
Last Updated
March 18, 2008, 01:18:24 PM

SMF Shoutbox [1.1 RC2] v1.04

Shoutbox, visible above board index
Compatible With 1.1 RC2
Latest version v1.04
Downloads 26,108
Reviews 0
Rating 0/5
Subscribers 8
License (View License)
Author(s)
Hi there!

I wrote this shoutbox mod because of two reasons:
1. I wasn´t clever enough to modify Grudge´s Ultimate Shoutbox in the way i liked. I wanted to have a shoutbox with a little bit more "chat feeling". So i decided to program a shoutbox which exactly fits my needs.
2. I am new to PHP and to SMF, so this was a chance to improve my knowledge about these things. In fact, this was the very first time i coded PHP. I am very impressed of the clear structure of SMF.

The shoutbox appears above the board index of the default theme. You can adjust some things using the configuration / features and options menu.

Sample screenshot:


By the way, i have stolen some source code from Grudge. Thank you, Grudge! :-)

There is an additional german language pack available.

If you find a bug, please leave a comment to me. Thank you.



To make the shoutbox work with other themes, you have to do the following things:

Add the code

  // display shoutbox
  if (function_exists('sbox')) sbox();


at the position you want the shoutbox to appear.

For example, if you want to add the shoutbox to the "Classic YaBB SE Theme" and you want the shoutbox to appear above the board index, you have to edit the BoardIndex.template.php in the Themes/classic-directory and replace


// Show the "Board name      Topics  Posts    Last Post" header.
echo '
<table border="0" width="100%" cellspacing="1" cellpadding="5" class="bordercolor">
<tr class="titlebg">
<td colspan="2">', $txt[20], '</td>
<td width="6%" align="center">', $txt[330], '</td>
<td width="6%" align="center">', $txt[21], '</td>
<td width="22%" align="center">', $txt[22], '</td>
</tr>';

with

  // display shoutbox
  if (function_exists('sbox')) sbox();

// Show the "Board name      Topics  Posts    Last Post" header.
echo '
<table border="0" width="100%" cellspacing="1" cellpadding="5" class="bordercolor">
<tr class="titlebg">
<td colspan="2">', $txt[20], '</td>
<td width="6%" align="center">', $txt[330], '</td>
<td width="6%" align="center">', $txt[21], '</td>
<td width="22%" align="center">', $txt[22], '</td>
</tr>';


At this point the shoutbox will work, but you get an error if you try to minimize the shoutbox with your mouse.
To fix that, you have to add code in index.template.php in the Themes/classic-directory

Replace the following code in function template_main_above():

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '

with

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header_sb = ', empty($options['collapse_header_sb']) ? 'false' : 'true', ';

function shrinkHeaderSB(mode)
{';

if ($context['user']['is_guest'])
echo '
document.cookie = "upshrinkSB=" + (mode ? 1 : 0);';
else
echo '
smf_setThemeOption("collapse_header_sb", mode ? 1 : 0, null, "', $context['session_id'], '");';

echo '
document.getElementById("upshrink_sb").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

document.getElementById("upshrinkHeaderSB").style.display = mode ? "none" : "";

current_header_sb = mode;
}
// ]]></script>


Attention please


After you have installed the shoutbox please modify the file sboxDB.php.

Please search for

// handle spacial characters
$content=addslashes($content);


and replace this with


// handle special characters
$content=addslashes($content);

// enquote html and script code to avoid html/javascript injection
$content = htmlentities($content, ENT_QUOTES);


This modification will prevent your shoutbox from being injected with html code and javascript code.



If you have questions, please look here.

Deep

PS.: Sorry for my poor english.
sbox_v1.04.zip
29.08 KB
Manual installation info
You have to register or login to be able to leave a review
There are currently no reviews on this customization
Advertisement: