+ sequential messages from one user have the same color
* character limit for one shout has been raised to 320 chars (like one long SMS ;-) * displayed weekdays are now in the language the user has chosen in SMF and from SMF's language files * sBox-time is kept in sync with SMF's time (including all timezone-stuff) + there's a bar displayed showing what's new since the last refresh + poster's name can be clicked to show his profile + your own nick is made bold and a sound is played on first occurence + sbox now uses SMF's smileys and BBCode, option in settings shows the smiley-row known from posting messages in SMF + HTML is now blocked * now user's "Display Name"s are shown instead of usernames * database now only stores User-ID, Unix-timestamp and message ! There's some experimental code commented out - maybe someone will make it work some day. It's for showing who's viewing the shoutbox and for giving each user a specific unique distinguishable color.
BIN
chat-inbound_GSM.wav
Normal file
@ -4,60 +4,33 @@
|
||||
<name>SMF Shoutbox</name>
|
||||
<id>Deep:SMF_Shoutbox</id>
|
||||
<type>modification</type>
|
||||
<version>1.04</version>
|
||||
<version>1.10</version>
|
||||
<install for="1.1 RC2">
|
||||
<require-file name="sbox.php" destination="$sourcedir" />
|
||||
<require-file name="sboxDB.php" destination="$sourcedir" />
|
||||
<require-file name="sbox.template.php" destination="$themedir" />
|
||||
<require-file name="sbox_angry.gif" destination="$themedir/images" />
|
||||
<require-file name="sbox_bad.gif" destination="$themedir/images" />
|
||||
<require-file name="sbox_bang.gif" destination="$themedir/images" />
|
||||
<require-file name="sbox_cheerio.gif" destination="$themedir/images" />
|
||||
<require-file name="sbox_church.gif" destination="$themedir/images" />
|
||||
<require-file name="sbox_cry.gif" destination="$themedir/images" />
|
||||
<require-file name="sbox_funny.gif" destination="$themedir/images" />
|
||||
<require-file name="sbox_grin.gif" destination="$themedir/images" />
|
||||
<require-file name="sbox_hand.gif" destination="$themedir/images" />
|
||||
<require-file name="sbox_kiss.gif" destination="$themedir/images" />
|
||||
<require-file name="sbox_laugh.gif" destination="$themedir/images" />
|
||||
<require-file name="sbox_oops.gif" destination="$themedir/images" />
|
||||
<require-file name="sbox_smile.gif" destination="$themedir/images" />
|
||||
<require-file name="sbox_smoke.gif" destination="$themedir/images" />
|
||||
<require-file name="sbox_yeah.gif" destination="$themedir/images" />
|
||||
<require-file name="sbox_refresh.gif" destination="$themedir/images" />
|
||||
<require-file name="chat-inbound_GSM.wav" destination="$boarddir" />
|
||||
<code type="file">sbox_setup.php</code>
|
||||
<readme type="inline">
|
||||
<![CDATA[
|
||||
This allows you to put a shoutbox on your SMF forum above the board index of the default theme.
|
||||
|
||||
Written By Deep (diem4@gmx.net), inspired by Matthew Wolf (a.k.a Grudge)
|
||||
Originally written By Deep (diem4@gmx.net), inspired by Matthew Wolf (a.k.a Grudge)
|
||||
Heavily improved by Markus Birth (mbirth@webwriters.de)
|
||||
Copyright 2006 - Neither this package or any of it's contents may be distributed without authorisation.
|
||||
]]>
|
||||
</readme>
|
||||
<modification type="file" format="boardmod">sbox_v1.04.mod</modification>
|
||||
<modification type="file" format="boardmod">sbox_v1.10.mod</modification>
|
||||
</install>
|
||||
<uninstall for="1.1 RC2">
|
||||
<readme type="inline">Uninstall will remove all the changes made by the shoutbox. You must do this before upgrading!</readme>
|
||||
<modification type="file" format="boardmod" reverse="true">sbox_v1.04.mod</modification>
|
||||
<modification type="file" format="boardmod" reverse="true">sbox_v1.10.mod</modification>
|
||||
<remove-file name="$sourcedir/sbox.php" />
|
||||
<remove-file name="$sourcedir/sboxDB.php" />
|
||||
<remove-file name="$themedir/sbox.template.php" />
|
||||
<remove-file name="$themedir/images/sbox_angry.gif" />
|
||||
<remove-file name="$themedir/images/sbox_bad.gif" />
|
||||
<remove-file name="$themedir/images/sbox_bang.gif" />
|
||||
<remove-file name="$themedir/images/sbox_cheerio.gif" />
|
||||
<remove-file name="$themedir/images/sbox_church.gif" />
|
||||
<remove-file name="$themedir/images/sbox_cry.gif" />
|
||||
<remove-file name="$themedir/images/sbox_funny.gif" />
|
||||
<remove-file name="$themedir/images/sbox_grin.gif" />
|
||||
<remove-file name="$themedir/images/sbox_hand.gif" />
|
||||
<remove-file name="$themedir/images/sbox_kiss.gif" />
|
||||
<remove-file name="$themedir/images/sbox_laugh.gif" />
|
||||
<remove-file name="$themedir/images/sbox_oops.gif" />
|
||||
<remove-file name="$themedir/images/sbox_smile.gif" />
|
||||
<remove-file name="$themedir/images/sbox_smoke.gif" />
|
||||
<remove-file name="$themedir/images/sbox_yeah.gif" />
|
||||
<remove-file name="$themedir/images/sbox_refresh.gif" />
|
||||
<remove-file name="$boarddir/chat-inbound_GSM.wav" />
|
||||
<code type="file">sbox_remove.php</code>
|
||||
</uninstall>
|
||||
<install>
|
||||
|
@ -1,77 +1,221 @@
|
||||
<?php
|
||||
|
||||
function template_shout_box()
|
||||
{
|
||||
global $context, $settings, $options, $txt, $user_info, $scripturl, $modSettings, $forum_version, $sourcedir;
|
||||
|
||||
$themedir = $settings['default_theme_url'];
|
||||
$imgdir = $themedir."/images/";
|
||||
|
||||
echo '
|
||||
<div class="tborder"', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' style="width: 100%;"' : '', '>
|
||||
<div class="catbg" style="padding: 6px; vertical-align: middle; text-align: center;">
|
||||
<a href="#" onclick="shrinkHeaderSB(!current_header_sb); return false;"><img id="upshrink_sb" src="', $settings['images_url'], '/', empty($options['collapse_header_sp']) ? 'collapse.gif' : 'expand.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin-right: 2ex;" align="right" /></a>'.$txt['sbox_ModTitle'].'
|
||||
</div>
|
||||
<div id="upshrinkHeaderSB"', empty($options['collapse_header_sb']) ? '' : ' style="display: none;"', '>
|
||||
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
|
||||
<tr class="windowbg" align="right" style="width:13%">
|
||||
<td class="windowbg" style="width:87%">
|
||||
<form name="sbox" action="Sources/sboxDB.php?action=write" method="post" target="sboxframe" onsubmit="setTimeout(\'clearSbox()\',100)">
|
||||
<table width="100%" border="0" cellspacing="1" cellpadding="0">
|
||||
<tr>
|
||||
<td align="right">
|
||||
<a href="Sources/sboxDB.php" target="sboxframe"><img src="'.$imgdir.'sbox_refresh.gif" border="0" width="16" height="17" align="middle" alt="Neu laden" /></a>';
|
||||
if ((!$context['user']['is_guest']) || ($modSettings['sbox_GuestAllowed'] == "1"))
|
||||
echo '
|
||||
<input class="windowbg2" type="text" name="sboxText" size="70" maxlength="100" /> <input type="submit" class="input" value=" shout " />';
|
||||
echo '
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<iframe name="sboxframe" src="Sources/sboxDB.php" width="100%" height="'.$modSettings['sbox_Height'].'"></iframe>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>';
|
||||
if ($modSettings['sbox_SmiliesVisible'] == "1")
|
||||
echo '
|
||||
<td valign="top" class="windowbg2">
|
||||
<table cellpadding="2" cellspacing="0" border="1">
|
||||
<tr class="titlebg"><td align="center" colspan="3"><b>Smilies</b></td></tr>
|
||||
<tr class="headerbodies">
|
||||
<td align="center"><img src="'.$imgdir.$txt['sbox_smilie01_file'].'" alt="'.$txt['sbox_smilie01_text'].'" title="'.$txt['sbox_smilie01_text'].'" border="0" onclick="insertSmilie(\''.$txt['sbox_smilie01_code'].'\')" onmouseover="this.style.cursor=\'hand\';" /></td>
|
||||
<td align="center"><img src="'.$imgdir.$txt['sbox_smilie02_file'].'" alt="'.$txt['sbox_smilie02_text'].'" title="'.$txt['sbox_smilie02_text'].'" border="0" onclick="insertSmilie(\''.$txt['sbox_smilie02_code'].'\')" onmouseover="this.style.cursor=\'hand\';" /></td>
|
||||
<td align="center"><img src="'.$imgdir.$txt['sbox_smilie03_file'].'" alt="'.$txt['sbox_smilie03_text'].'" title="'.$txt['sbox_smilie03_text'].'" border="0" onclick="insertSmilie(\''.$txt['sbox_smilie03_code'].'\')" onmouseover="this.style.cursor=\'hand\';" /></td>
|
||||
</tr>
|
||||
<tr class="headerbodies">
|
||||
<td align="center"><img src="'.$imgdir.$txt['sbox_smilie04_file'].'" alt="'.$txt['sbox_smilie04_text'].'" title="'.$txt['sbox_smilie04_text'].'" border="0" onclick="insertSmilie(\''.$txt['sbox_smilie04_code'].'\')" onmouseover="this.style.cursor=\'hand\';" /></td>
|
||||
<td align="center"><img src="'.$imgdir.$txt['sbox_smilie05_file'].'" alt="'.$txt['sbox_smilie05_text'].'" title="'.$txt['sbox_smilie05_text'].'" border="0" onclick="insertSmilie(\''.$txt['sbox_smilie05_code'].'\')" onmouseover="this.style.cursor=\'hand\';" /></td>
|
||||
<td align="center"><img src="'.$imgdir.$txt['sbox_smilie06_file'].'" alt="'.$txt['sbox_smilie06_text'].'" title="'.$txt['sbox_smilie06_text'].'" border="0" onclick="insertSmilie(\''.$txt['sbox_smilie06_code'].'\')" onmouseover="this.style.cursor=\'hand\';" /></td>
|
||||
</tr>
|
||||
<tr class="headerbodies">
|
||||
<td align="center"><img src="'.$imgdir.$txt['sbox_smilie07_file'].'" alt="'.$txt['sbox_smilie07_text'].'" title="'.$txt['sbox_smilie07_text'].'" border="0" onclick="insertSmilie(\''.$txt['sbox_smilie07_code'].'\')" onmouseover="this.style.cursor=\'hand\';" /></td>
|
||||
<td align="center"><img src="'.$imgdir.$txt['sbox_smilie08_file'].'" alt="'.$txt['sbox_smilie08_text'].'" title="'.$txt['sbox_smilie08_text'].'" border="0" onclick="insertSmilie(\''.$txt['sbox_smilie08_code'].'\')" onmouseover="this.style.cursor=\'hand\';" /></td>
|
||||
<td align="center"><img src="'.$imgdir.$txt['sbox_smilie09_file'].'" alt="'.$txt['sbox_smilie09_text'].'" title="'.$txt['sbox_smilie09_text'].'" border="0" onclick="insertSmilie(\''.$txt['sbox_smilie09_code'].'\')" onmouseover="this.style.cursor=\'hand\';" /></td>
|
||||
</tr>
|
||||
<tr class="headerbodies">
|
||||
<td align="center"><img src="'.$imgdir.$txt['sbox_smilie10_file'].'" alt="'.$txt['sbox_smilie10_text'].'" title="'.$txt['sbox_smilie10_text'].'" border="0" onclick="insertSmilie(\''.$txt['sbox_smilie10_code'].'\')" onmouseover="this.style.cursor=\'hand\';" /></td>
|
||||
<td align="center"><img src="'.$imgdir.$txt['sbox_smilie11_file'].'" alt="'.$txt['sbox_smilie11_text'].'" title="'.$txt['sbox_smilie11_text'].'" border="0" onclick="insertSmilie(\''.$txt['sbox_smilie11_code'].'\')" onmouseover="this.style.cursor=\'hand\';" /></td>
|
||||
<td align="center"><img src="'.$imgdir.$txt['sbox_smilie12_file'].'" alt="'.$txt['sbox_smilie12_text'].'" title="'.$txt['sbox_smilie12_text'].'" border="0" onclick="insertSmilie(\''.$txt['sbox_smilie12_code'].'\')" onmouseover="this.style.cursor=\'hand\';" /></td>
|
||||
</tr>
|
||||
<tr class="headerbodies">
|
||||
<td align="center"><img src="'.$imgdir.$txt['sbox_smilie13_file'].'" alt="'.$txt['sbox_smilie13_text'].'" title="'.$txt['sbox_smilie13_text'].'" border="0" onclick="insertSmilie(\''.$txt['sbox_smilie13_code'].'\')" onmouseover="this.style.cursor=\'hand\';" /></td>
|
||||
<td align="center"><img src="'.$imgdir.$txt['sbox_smilie14_file'].'" alt="'.$txt['sbox_smilie14_text'].'" title="'.$txt['sbox_smilie14_text'].'" border="0" onclick="insertSmilie(\''.$txt['sbox_smilie14_code'].'\')" onmouseover="this.style.cursor=\'hand\';" /></td>
|
||||
<td align="center"><img src="'.$imgdir.$txt['sbox_smilie15_file'].'" alt="'.$txt['sbox_smilie15_text'].'" title="'.$txt['sbox_smilie15_text'].'" border="0" onclick="insertSmilie(\''.$txt['sbox_smilie15_code'].'\')" onmouseover="this.style.cursor=\'hand\';" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>';
|
||||
|
||||
echo '
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
<?php
|
||||
|
||||
function template_shout_box() {
|
||||
global $context, $settings, $options, $txt, $user_info, $scripturl, $modSettings, $forum_version, $sourcedir;
|
||||
|
||||
$themedir = $settings['default_theme_url'];
|
||||
$imgdir = $themedir."/images/";
|
||||
|
||||
echo '
|
||||
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
|
||||
function clearSbox()
|
||||
{
|
||||
// Delete shoutbox message text after shout has been submitted
|
||||
if (document.sbox)
|
||||
document.sbox.sboxText.value="";
|
||||
}
|
||||
// ]]></script>
|
||||
<div class="tborder"', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' style="width: 100%;"' : '', '>
|
||||
<div class="catbg" style="padding: 6px; vertical-align: middle; text-align: center;">
|
||||
<a href="#" onclick="shrinkHeaderSB(!current_header_sb); return false;"><img id="upshrink_sb" src="', $settings['images_url'], '/', empty($options['collapse_header_sp']) ? 'collapse.gif' : 'expand.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin-right: 2ex;" align="right" /></a>'.$txt['sbox_ModTitle'].'
|
||||
</div>
|
||||
<div id="upshrinkHeaderSB"', empty($options['collapse_header_sb']) ? '' : ' style="display: none;"', '>
|
||||
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
|
||||
<tr class="windowbg" align="right" style="width:13%">
|
||||
<td class="windowbg" style="width:87%">
|
||||
<form name="sbox" action="Sources/sboxDB.php?action=write" method="post" target="sboxframe" onsubmit="setTimeout(\'clearSbox()\', 500);">
|
||||
<input type="hidden" name="ts" value="'.forum_time(true).'">
|
||||
<table width="100%" border="0" cellspacing="1" cellpadding="0">
|
||||
<tr>
|
||||
<td align="right">
|
||||
<a href="Sources/sboxDB.php?" target="sboxframe"><img src="'.$imgdir.'sbox_refresh.gif" border="0" width="16" height="17" align="middle" alt="' . $txt['sbox_Refresh'] . '" /></a>';
|
||||
if ((!$context['user']['is_guest']) || ($modSettings['sbox_GuestAllowed'] == "1"))
|
||||
echo '
|
||||
<input class="windowbg2" type="text" name="sboxText" size="100" maxlength="320" /> <input type="submit" class="input" value=" shout " />';
|
||||
echo '
|
||||
</td>
|
||||
</tr>';
|
||||
|
||||
if (($modSettings['sbox_SmiliesVisible'] == "1") && ((!$context['user']['is_guest']) || ($modSettings['sbox_GuestAllowed'] == "1"))) {
|
||||
sbox_loadSmileys();
|
||||
echo '
|
||||
<tr>
|
||||
<td align="center">';
|
||||
sbox_printSmileys();
|
||||
}
|
||||
|
||||
echo'
|
||||
<tr>
|
||||
<td>
|
||||
<iframe name="sboxframe" src="Sources/sboxDB.php?" width="100%" height="'.$modSettings['sbox_Height'].'"></iframe>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
function sbox_loadSmileys() {
|
||||
global $context, $settings, $user_info, $txt, $modSettings, $db_prefix;
|
||||
|
||||
// Initialize smiley array...
|
||||
$context['smileys'] = array(
|
||||
'postform' => array(),
|
||||
'popup' => array(),
|
||||
);
|
||||
|
||||
// Load smileys - don't bother to run a query if we're not using the database's ones anyhow.
|
||||
if (empty($modSettings['smiley_enable']) && $user_info['smiley_set'] != 'none')
|
||||
$context['smileys']['postform'][] = array(
|
||||
'smileys' => array(
|
||||
array('code' => ':)', 'filename' => 'smiley.gif', 'description' => $txt[287]),
|
||||
array('code' => ';)', 'filename' => 'wink.gif', 'description' => $txt[292]),
|
||||
array('code' => ':D', 'filename' => 'cheesy.gif', 'description' => $txt[289]),
|
||||
array('code' => ';D', 'filename' => 'grin.gif', 'description' => $txt[293]),
|
||||
array('code' => '>:(', 'filename' => 'angry.gif', 'description' => $txt[288]),
|
||||
array('code' => ':(', 'filename' => 'sad.gif', 'description' => $txt[291]),
|
||||
array('code' => ':o', 'filename' => 'shocked.gif', 'description' => $txt[294]),
|
||||
array('code' => '8)', 'filename' => 'cool.gif', 'description' => $txt[295]),
|
||||
array('code' => '???', 'filename' => 'huh.gif', 'description' => $txt[296]),
|
||||
array('code' => '::)', 'filename' => 'rolleyes.gif', 'description' => $txt[450]),
|
||||
array('code' => ':P', 'filename' => 'tongue.gif', 'description' => $txt[451]),
|
||||
array('code' => ':-[', 'filename' => 'embarrassed.gif', 'description' => $txt[526]),
|
||||
array('code' => ':-X', 'filename' => 'lipsrsealed.gif', 'description' => $txt[527]),
|
||||
array('code' => ':-\\', 'filename' => 'undecided.gif', 'description' => $txt[528]),
|
||||
array('code' => ':-*', 'filename' => 'kiss.gif', 'description' => $txt[529]),
|
||||
array('code' => ':\'(', 'filename' => 'cry.gif', 'description' => $txt[530])
|
||||
),
|
||||
'last' => true,
|
||||
);
|
||||
elseif ($user_info['smiley_set'] != 'none')
|
||||
{
|
||||
if (($temp = cache_get_data('posting_smileys', 480)) == null)
|
||||
{
|
||||
$request = db_query("
|
||||
SELECT code, filename, description, smileyRow, hidden
|
||||
FROM {$db_prefix}smileys
|
||||
WHERE hidden IN (0, 2)
|
||||
ORDER BY smileyRow, smileyOrder", __FILE__, __LINE__);
|
||||
while ($row = mysql_fetch_assoc($request))
|
||||
{
|
||||
$row['code'] = htmlspecialchars($row['code']);
|
||||
$row['filename'] = htmlspecialchars($row['filename']);
|
||||
$row['description'] = htmlspecialchars($row['description']);
|
||||
|
||||
$context['smileys'][empty($row['hidden']) ? 'postform' : 'popup'][$row['smileyRow']]['smileys'][] = $row;
|
||||
}
|
||||
mysql_free_result($request);
|
||||
|
||||
cache_put_data('posting_smileys', $context['smileys'], 480);
|
||||
}
|
||||
else
|
||||
$context['smileys'] = $temp;
|
||||
}
|
||||
|
||||
// Clean house... add slashes to the code for javascript.
|
||||
foreach (array_keys($context['smileys']) as $location)
|
||||
{
|
||||
foreach ($context['smileys'][$location] as $j => $row)
|
||||
{
|
||||
$n = count($context['smileys'][$location][$j]['smileys']);
|
||||
for ($i = 0; $i < $n; $i++)
|
||||
{
|
||||
$context['smileys'][$location][$j]['smileys'][$i]['code'] = addslashes($context['smileys'][$location][$j]['smileys'][$i]['code']);
|
||||
$context['smileys'][$location][$j]['smileys'][$i]['js_description'] = addslashes($context['smileys'][$location][$j]['smileys'][$i]['description']);
|
||||
}
|
||||
|
||||
$context['smileys'][$location][$j]['smileys'][$n - 1]['last'] = true;
|
||||
}
|
||||
if (!empty($context['smileys'][$location]))
|
||||
$context['smileys'][$location][count($context['smileys'][$location]) - 1]['last'] = true;
|
||||
}
|
||||
$settings['smileys_url'] = $modSettings['smileys_url'] . '/' . $user_info['smiley_set'];
|
||||
}
|
||||
|
||||
function sbox_printSmileys() {
|
||||
global $context, $txt, $settings;
|
||||
|
||||
loadLanguage('Post');
|
||||
|
||||
// Now start printing all of the smileys.
|
||||
if (!empty($context['smileys']['postform']))
|
||||
{
|
||||
// Show each row of smileys ;).
|
||||
foreach ($context['smileys']['postform'] as $smiley_row)
|
||||
{
|
||||
foreach ($smiley_row['smileys'] as $smiley)
|
||||
echo '
|
||||
<a href="javascript:void(0);" onclick="replaceText(\' ', $smiley['code'], '\', document.forms.sbox.sboxText); return false;"><img src="', $settings['smileys_url'], '/', $smiley['filename'], '" align="bottom" alt="', $smiley['description'], '" title="', $smiley['description'], '" /></a>';
|
||||
|
||||
// If this isn't the last row, show a break.
|
||||
if (empty($smiley_row['last']))
|
||||
echo '<br />';
|
||||
}
|
||||
|
||||
// If the smileys popup is to be shown... show it!
|
||||
if (!empty($context['smileys']['popup']))
|
||||
echo '
|
||||
<a href="javascript:moreSmileys();">[', $txt['more_smileys'], ']</a>';
|
||||
}
|
||||
|
||||
// If there are additional smileys then ensure we provide the javascript for them.
|
||||
if (!empty($context['smileys']['popup']))
|
||||
{
|
||||
echo '
|
||||
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
|
||||
var smileys = [';
|
||||
|
||||
foreach ($context['smileys']['popup'] as $smiley_row)
|
||||
{
|
||||
echo '
|
||||
[';
|
||||
foreach ($smiley_row['smileys'] as $smiley)
|
||||
{
|
||||
echo '
|
||||
["', $smiley['code'], '","', $smiley['filename'], '","', $smiley['js_description'], '"]';
|
||||
if (empty($smiley['last']))
|
||||
echo ',';
|
||||
}
|
||||
|
||||
echo ']';
|
||||
if (empty($smiley_row['last']))
|
||||
echo ',';
|
||||
}
|
||||
|
||||
echo '];
|
||||
var smileyPopupWindow;
|
||||
|
||||
function moreSmileys()
|
||||
{
|
||||
var row, i;
|
||||
|
||||
if (smileyPopupWindow)
|
||||
smileyPopupWindow.close();
|
||||
|
||||
smileyPopupWindow = window.open("", "add_smileys", "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=480,height=220,resizable=yes");
|
||||
smileyPopupWindow.document.write(\'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html>\');
|
||||
smileyPopupWindow.document.write(\'\n\t<head>\n\t\t<title>', $txt['more_smileys_title'], '</title>\n\t\t<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css" />\n\t</head>\');
|
||||
smileyPopupWindow.document.write(\'\n\t<body style="margin: 1ex;">\n\t\t<table width="100%" cellpadding="5" cellspacing="0" border="0" class="tborder">\n\t\t\t<tr class="titlebg"><td align="left">', $txt['more_smileys_pick'], '</td></tr>\n\t\t\t<tr class="windowbg"><td align="left">\');
|
||||
|
||||
for (row = 0; row < smileys.length; row++)
|
||||
{
|
||||
for (i = 0; i < smileys[row].length; i++)
|
||||
{
|
||||
smileys[row][i][2] = smileys[row][i][2].replace(/"/g, \'"\');
|
||||
smileyPopupWindow.document.write(\'<a href="javascript:void(0);" onclick="window.opener.replaceText(" \' + smileys[row][i][0] + \'", window.opener.document.forms.sbox.sboxText); window.focus(); return false;"><img src="', $settings['smileys_url'], '/\' + smileys[row][i][1] + \'" alt="\' + smileys[row][i][2] + \'" title="\' + smileys[row][i][2] + \'" style="padding: 4px;" border="0" /></a> \');
|
||||
}
|
||||
smileyPopupWindow.document.write("<br />");
|
||||
}
|
||||
|
||||
smileyPopupWindow.document.write(\'</td></tr>\n\t\t\t<tr><td align="center" class="windowbg"><a href="javascript:window.close();\\">', $txt['more_smileys_close_window'], '</a></td></tr>\n\t\t</table>\n\t</body>\n</html>\');
|
||||
smileyPopupWindow.document.close();
|
||||
}
|
||||
// ]]></script>';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
310
sboxDB.php
@ -1,8 +1,12 @@
|
||||
<?
|
||||
<?php
|
||||
header('Pragma: no-cache');
|
||||
header('Expires: 0');
|
||||
header('Cache-control: none');
|
||||
|
||||
require("../SSI.php");
|
||||
|
||||
if (!defined('SMF'))
|
||||
die('Hacking attempt...');
|
||||
die('Hacking attempt...');
|
||||
|
||||
// global variables
|
||||
global $db_connection, $context, $settings, $txt, $user_info, $modSettings, $db_prefix;
|
||||
@ -11,99 +15,82 @@ global $db_connection, $context, $settings, $txt, $user_info, $modSettings, $db_
|
||||
//@mysql_select_db($db_name, $db_connection);
|
||||
|
||||
//display html header
|
||||
echo '<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
|
||||
echo '<html xmlns="http://www.w3.org/1999/xhtml"' . ($context['right_to_left']?' dir="rtl"':'') . '>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
|
||||
<meta name="description" content="Shoutbox" />
|
||||
<meta name="keywords" content="Shoutbox" />
|
||||
<title>Shoutbox</title>
|
||||
<meta http-equiv="refresh" content="'.$modSettings['sbox_RefreshTime'].';URL=sboxDB.php">
|
||||
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc2" />
|
||||
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
|
||||
function killYesNo()
|
||||
{
|
||||
return confirm("'.$txt['sbox_KillShout'].'");
|
||||
|
||||
}
|
||||
// ]]></script>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
|
||||
<meta name="description" content="Shoutbox" />
|
||||
<meta name="keywords" content="Shoutbox" />
|
||||
<title>Shoutbox</title>
|
||||
<meta http-equiv="refresh" content="' . $modSettings['sbox_RefreshTime'] . ';URL=sboxDB.php?ts=' . time() . '">
|
||||
<link rel="stylesheet" type="text/css" href="' . $settings['theme_url'] . '/style.css?rc2" />
|
||||
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
|
||||
function killYesNo() {
|
||||
return confirm("' . $txt['sbox_KillShout'] . '");
|
||||
}
|
||||
|
||||
<style type="text/css"><!-- // --><![CDATA[
|
||||
<!--
|
||||
.Kill
|
||||
{
|
||||
color: #ff0000;
|
||||
}
|
||||
.OddLine
|
||||
{
|
||||
font-family: '.$modSettings['sbox_FontFamily1'].';
|
||||
font-style: normal;
|
||||
font-size: '.$modSettings['sbox_TextSize1'].';
|
||||
font-weight: normal;
|
||||
color: '.$modSettings['sbox_TextColor1'].';
|
||||
}
|
||||
.EvenLine
|
||||
{
|
||||
font-family: '.$modSettings['sbox_FontFamily2'].';
|
||||
font-style: normal;
|
||||
font-size: '.$modSettings['sbox_TextSize2'].';
|
||||
font-weight: normal;
|
||||
color: '.$modSettings['sbox_TextColor2'].';
|
||||
}
|
||||
body
|
||||
{
|
||||
padding: 0px 0px 0px 0px;
|
||||
background-color: '.$modSettings['sbox_BackgroundColor'].';
|
||||
}
|
||||
a:link
|
||||
{
|
||||
color: #ff0000;
|
||||
text-decoration: none;
|
||||
}
|
||||
//-->
|
||||
// ]]></style>';
|
||||
// get SMF-time including time zone corrections (system+user)
|
||||
parent.document.sbox.ts.value = ' . forum_time(true) . ';
|
||||
// if (parent.document.sbox.ts.value != ' . forum_time(true) . ') alert(\'Time mismatch! (\'+parent.document.sbox.ts.value+\' / ' . forum_time(true) . ')\');
|
||||
// ]]></script>
|
||||
|
||||
<style type="text/css">
|
||||
.OddLine, A.OddLine {
|
||||
font-family: ' . $modSettings['sbox_FontFamily1'] . ';
|
||||
font-style: normal;
|
||||
font-size: ' . $modSettings['sbox_TextSize1'] . ';
|
||||
font-weight: normal;
|
||||
color: ' . $modSettings['sbox_TextColor1'] . ';
|
||||
}
|
||||
.EvenLine, A.EvenLine {
|
||||
font-family: ' . $modSettings['sbox_FontFamily2'] . ';
|
||||
font-style: normal;
|
||||
font-size: ' . $modSettings['sbox_TextSize2'] . ';
|
||||
font-weight: normal;
|
||||
color: ' . $modSettings['sbox_TextColor2'] . ';
|
||||
}
|
||||
|
||||
body {
|
||||
padding: 0px 0px 0px 0px;
|
||||
background-color: ' . $modSettings['sbox_BackgroundColor'] . ';
|
||||
}
|
||||
A {
|
||||
text-decoration: none;
|
||||
}
|
||||
A.Kill {
|
||||
color: #ff0000;
|
||||
}
|
||||
</style>';
|
||||
|
||||
|
||||
switch ($_REQUEST['action'])
|
||||
{
|
||||
switch ($_REQUEST['action']) {
|
||||
|
||||
case "write":
|
||||
if ((!$context['user']['is_guest']) || ($modSettings['sbox_GuestAllowed'] == "1"))
|
||||
{
|
||||
// empty messages are not allowed
|
||||
$content=$_REQUEST['sboxText'];
|
||||
if(chop($content."") != "")
|
||||
{
|
||||
// get actual weekday
|
||||
$days = array($txt['sbox_Sunday'],$txt['sbox_Monday'],$txt['sbox_Tuesday'],$txt['sbox_Wednesday'],$txt['sbox_Thurday'],$txt['sbox_Friday'],$txt['sbox_Saturday']);
|
||||
$day=$days[date("w")]; // weekday
|
||||
$date=$day." | ". date("G:i"); // time
|
||||
|
||||
// handle spacial characters
|
||||
$content=addslashes($content);
|
||||
|
||||
// insert shout message into database
|
||||
$sql = "insert into ".$db_prefix."sbox_content (name,content,time) values ('".$user_info['username']."','".$content."','$date')";
|
||||
db_query($sql,__FILE__,__LINE__);
|
||||
|
||||
// delete old shout messages (get id of last shouting and delete all shoutings as defined in settings
|
||||
$result = db_query("select id from ".$db_prefix."sbox_content where name='".$user_info['username']."' and content='".$content."' and time='$date'",__FILE__,__LINE__);
|
||||
$rows = mysql_fetch_assoc($result) ;
|
||||
$sql = "delete from ".$db_prefix."sbox_content where id < '".($rows["id"]-$modSettings['sbox_MaxLines'])."'";
|
||||
db_query($sql,__FILE__,__LINE__);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "kill":
|
||||
if ($context['user']['is_admin'])
|
||||
{
|
||||
$id = "".$_REQUEST['kill'];
|
||||
if ($id != "")
|
||||
{
|
||||
$sql = "delete from ".$db_prefix."sbox_content where id=".$id."";
|
||||
db_query($sql,__FILE__,__LINE__);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'write':
|
||||
if (((!$context['user']['is_guest']) || ($modSettings['sbox_GuestAllowed'] == "1")) && !empty($_REQUEST['sboxText'])) {
|
||||
$content=$_REQUEST['sboxText'];
|
||||
// get current timestamp
|
||||
$date = time();
|
||||
|
||||
// handle special characters
|
||||
$content = addslashes($content);
|
||||
|
||||
// insert shout message into database
|
||||
$sql = "INSERT INTO " . $db_prefix . "sbox_content (ID_MEMBER, content, time) VALUES ('" . $context['user']['id'] . "', '" . $content . "', '$date')";
|
||||
db_query($sql, __FILE__, __LINE__);
|
||||
|
||||
// delete old shout messages (get id of last shouting and delete all shoutings as defined in settings
|
||||
$result = db_query("SELECT id FROM " . $db_prefix . "sbox_content WHERE ID_MEMBER='" . $context['user']['id'] . "' AND content='" . $content . "' AND time='$date'", __FILE__, __LINE__);
|
||||
$rows = mysql_fetch_assoc($result) ;
|
||||
$sql = 'DELETE FROM ' . $db_prefix . "sbox_content WHERE id < '" . ($rows["id"]-$modSettings['sbox_MaxLines']) . "'";
|
||||
db_query($sql, __FILE__, __LINE__);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'kill':
|
||||
if ($context['user']['is_admin'] && !empty($_REQUEST['kill'])) {
|
||||
$sql = 'DELETE FROM ' . $db_prefix . 'sbox_content WHERE id=' . intval($_REQUEST['kill']);
|
||||
db_query($sql, __FILE__, __LINE__);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// close header and open body
|
||||
@ -111,55 +98,106 @@ echo '
|
||||
</head>
|
||||
<body>';
|
||||
|
||||
// get smilie path
|
||||
$themedir = $settings['default_theme_url']; // smf theme path
|
||||
$imgdir = $themedir."/images/"; // smilie path
|
||||
echo "\n" . '<div class="OddLine"><b>[ ' . strftime($user_info['time_format'], forum_time(true)) . ' ]</b></div>';
|
||||
|
||||
if ($context['user']['is_admin']) {
|
||||
// debug output for separator-bar
|
||||
// echo "\n" . '<div class="OddLine">( CurTime: ' . forum_time(true) . ' / LastTime: ' . $_REQUEST['ts'] . ' )</div>';
|
||||
}
|
||||
|
||||
/*
|
||||
if (!empty($settings['display_who_viewing'])) {
|
||||
echo '<small>';
|
||||
if ($settings['display_who_viewing'] == 1)
|
||||
echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt[19];
|
||||
else
|
||||
echo empty($context['view_members_list']) ? '0 ' . $txt[19] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) or $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
|
||||
echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board'], '</small>';
|
||||
}
|
||||
*/
|
||||
|
||||
// get shout messages out of database
|
||||
$result = db_query("select * from ".$db_prefix."sbox_content order by id desc, time asc limit ".$modSettings['sbox_MaxLines'],__FILE__,__LINE__);
|
||||
if(mysql_num_rows($result))
|
||||
{
|
||||
$count=0; // counter to distinguish font color
|
||||
while($row = mysql_fetch_assoc($result))
|
||||
{
|
||||
$count = $count + 1; // increase counter
|
||||
$name = $row["name"]; // user name
|
||||
$date = $row["time"]; // shouting date and time
|
||||
$content = stripslashes($row['content']); // shouting content
|
||||
|
||||
// replace smilie code with path to smilie image
|
||||
$content = str_replace ($txt['sbox_smilie01_code'], '<img src="'.$imgdir.$txt['sbox_smilie01_file'].'" alt="'.$txt['sbox_smilie01_text'].'" title="'.$txt['sbox_smilie01_text'].'" border="0" />', $content);
|
||||
$content = str_replace ($txt['sbox_smilie02_code'], '<img src="'.$imgdir.$txt['sbox_smilie02_file'].'" alt="'.$txt['sbox_smilie02_text'].'" title="'.$txt['sbox_smilie02_text'].'" border="0" />', $content);
|
||||
$content = str_replace ($txt['sbox_smilie03_code'], '<img src="'.$imgdir.$txt['sbox_smilie03_file'].'" alt="'.$txt['sbox_smilie03_text'].'" title="'.$txt['sbox_smilie03_text'].'" border="0" />', $content);
|
||||
$content = str_replace ($txt['sbox_smilie04_code'], '<img src="'.$imgdir.$txt['sbox_smilie04_file'].'" alt="'.$txt['sbox_smilie04_text'].'" title="'.$txt['sbox_smilie04_text'].'" border="0" />', $content);
|
||||
$content = str_replace ($txt['sbox_smilie05_code'], '<img src="'.$imgdir.$txt['sbox_smilie05_file'].'" alt="'.$txt['sbox_smilie05_text'].'" title="'.$txt['sbox_smilie05_text'].'" border="0" />', $content);
|
||||
$content = str_replace ($txt['sbox_smilie06_code'], '<img src="'.$imgdir.$txt['sbox_smilie06_file'].'" alt="'.$txt['sbox_smilie06_text'].'" title="'.$txt['sbox_smilie06_text'].'" border="0" />', $content);
|
||||
$content = str_replace ($txt['sbox_smilie07_code'], '<img src="'.$imgdir.$txt['sbox_smilie07_file'].'" alt="'.$txt['sbox_smilie07_text'].'" title="'.$txt['sbox_smilie07_text'].'" border="0" />', $content);
|
||||
$content = str_replace ($txt['sbox_smilie08_code'], '<img src="'.$imgdir.$txt['sbox_smilie08_file'].'" alt="'.$txt['sbox_smilie08_text'].'" title="'.$txt['sbox_smilie08_text'].'" border="0" />', $content);
|
||||
$content = str_replace ($txt['sbox_smilie09_code'], '<img src="'.$imgdir.$txt['sbox_smilie09_file'].'" alt="'.$txt['sbox_smilie09_text'].'" title="'.$txt['sbox_smilie09_text'].'" border="0" />', $content);
|
||||
$content = str_replace ($txt['sbox_smilie10_code'], '<img src="'.$imgdir.$txt['sbox_smilie10_file'].'" alt="'.$txt['sbox_smilie10_text'].'" title="'.$txt['sbox_smilie10_text'].'" border="0" />', $content);
|
||||
$content = str_replace ($txt['sbox_smilie11_code'], '<img src="'.$imgdir.$txt['sbox_smilie11_file'].'" alt="'.$txt['sbox_smilie11_text'].'" title="'.$txt['sbox_smilie11_text'].'" border="0" />', $content);
|
||||
$content = str_replace ($txt['sbox_smilie12_code'], '<img src="'.$imgdir.$txt['sbox_smilie12_file'].'" alt="'.$txt['sbox_smilie12_text'].'" title="'.$txt['sbox_smilie12_text'].'" border="0" />', $content);
|
||||
$content = str_replace ($txt['sbox_smilie13_code'], '<img src="'.$imgdir.$txt['sbox_smilie13_file'].'" alt="'.$txt['sbox_smilie13_text'].'" title="'.$txt['sbox_smilie13_text'].'" border="0" />', $content);
|
||||
$content = str_replace ($txt['sbox_smilie14_code'], '<img src="'.$imgdir.$txt['sbox_smilie14_file'].'" alt="'.$txt['sbox_smilie14_text'].'" title="'.$txt['sbox_smilie14_text'].'" border="0" />', $content);
|
||||
$content = str_replace ($txt['sbox_smilie15_code'], '<img src="'.$imgdir.$txt['sbox_smilie15_file'].'" alt="'.$txt['sbox_smilie15_text'].'" title="'.$txt['sbox_smilie15_text'].'" border="0" />', $content);
|
||||
$result = db_query("
|
||||
SELECT *
|
||||
FROM {$db_prefix}sbox_content AS sb
|
||||
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = sb.ID_MEMBER)
|
||||
ORDER BY id DESC, time ASC LIMIT " . $modSettings['sbox_MaxLines'], __FILE__, __LINE__);
|
||||
if(mysql_num_rows($result)) {
|
||||
$lname = '';
|
||||
$count = 0;
|
||||
$div = false;
|
||||
$alert = false;
|
||||
while($row = mysql_fetch_assoc($result)) {
|
||||
$name = $row['ID_MEMBER']; // user name
|
||||
$date = forum_time(true, $row['time']); // shouting date and time
|
||||
$content = stripslashes($row['content']); // shouting content
|
||||
$content = htmlentities($content);
|
||||
$content = parse_bbc($content);
|
||||
|
||||
// display shouting message and use a different color each second row
|
||||
if ($count % 2)
|
||||
echo '
|
||||
<div class="OddLine">';
|
||||
else
|
||||
echo '
|
||||
<div class="EvenLine">';
|
||||
if ($context['user']['is_admin'])
|
||||
echo '<a title="'.$txt['sbox_KillShout'].'" class="Kill" onclick="return killYesNo();" href="sboxDB.php?action=kill&kill='.$row['id'].'">[X]</a>';
|
||||
if (!empty($_REQUEST['ts']) && !$div && $date<$_REQUEST['ts']) {
|
||||
if ($count > 0) {
|
||||
echo '<hr>' . "\n";
|
||||
}
|
||||
$div = true;
|
||||
}
|
||||
|
||||
if ($name != $lname) {
|
||||
$count++; // increase counter
|
||||
}
|
||||
$lname = $name;
|
||||
|
||||
echo '[ '.$date.' ] <b><'.$name.'></b> '.$content.'</div>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</body>
|
||||
</html>';
|
||||
// display shouting message and use a different color each second row
|
||||
if ($count % 2 == 0) {
|
||||
$divclass = 'OddLine';
|
||||
} else {
|
||||
$divclass = 'EvenLine';
|
||||
}
|
||||
|
||||
/* $r = $g = $b = 0;
|
||||
for ($i=0;$i<strlen($name);$i++) {
|
||||
$x = ord(substr($name, $i, 1));
|
||||
switch ($i % 3) {
|
||||
case 0: $r += $x; break;
|
||||
case 1: $g += $x; break;
|
||||
case 2: $b += $x; break;
|
||||
}
|
||||
}
|
||||
$r = dechex($r % 192);
|
||||
$g = dechex($g % 192);
|
||||
$b = dechex($b % 192);
|
||||
if (strlen($r)<2) $r = '0' . $r;
|
||||
if (strlen($g)<2) $g = '0' . $g;
|
||||
if (strlen($b)<2) $b = '0' . $b;
|
||||
$colh = $r . $g . $b;
|
||||
|
||||
echo "\n" . '<div class="' . $divclass . '" style="color: #' . $colh . '">'; */
|
||||
echo "\n" . '<div class="' . $divclass . '">';
|
||||
|
||||
if ($context['user']['is_admin']) {
|
||||
echo '<a title="' . $txt['sbox_KillShout'] . '" class="Kill" onclick="return killYesNo();" href="sboxDB.php?action=kill&kill=' . $row['id'] . '">[X]</a>';
|
||||
}
|
||||
|
||||
$wd = $txt['days_short'][date('w', $date)];
|
||||
$ts = date('H:i', $date);
|
||||
$ds = $wd . ' | ' . $ts;
|
||||
|
||||
// highlight username, realname and make sound
|
||||
if (!empty($context['user']['name']) && strpos($content, $context['user']['name']) !== false) {
|
||||
if ($div === false) $alert = true;
|
||||
$content = str_replace($context['user']['name'], '<b><u>' . $context['user']['name'] . '</u></b>', $content);
|
||||
}
|
||||
if (!empty($user_info['username']) && $user_info['username'] != $context['user']['name'] && strpos($content, $user_info['username']) !== false) {
|
||||
if ($div === false) $alert = true;
|
||||
$content = str_replace($user_info['username'], '<b><u>' . $user_info['username'] . '</u></b>', $content);
|
||||
}
|
||||
|
||||
echo '[ ' . $ds . ' ] <b><<a href="' . $scripturl . '?action=profile;u=' . $name . '" target="_top" class="' . $divclass . '">' . ((!empty($row['realName']))?$row['realName']:$row['memberName']) . '</a>></b> ' . $content . '</div>';
|
||||
}
|
||||
if ($alert === true && $div === true) {
|
||||
echo '<embed src="' . $boardurl . '/chat-inbound_GSM.wav" hidden="true" autostart="true" loop="false"></embed>' . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
BIN
sbox_angry.gif
Before Width: | Height: | Size: 289 B |
BIN
sbox_bad.gif
Before Width: | Height: | Size: 4.6 KiB |
BIN
sbox_bang.gif
Before Width: | Height: | Size: 904 B |
BIN
sbox_cheerio.gif
Before Width: | Height: | Size: 5.3 KiB |
BIN
sbox_church.gif
Before Width: | Height: | Size: 3.7 KiB |
BIN
sbox_cry.gif
Before Width: | Height: | Size: 416 B |
BIN
sbox_funny.gif
Before Width: | Height: | Size: 749 B |
BIN
sbox_grin.gif
Before Width: | Height: | Size: 267 B |
BIN
sbox_hand.gif
Before Width: | Height: | Size: 655 B |
BIN
sbox_kiss.gif
Before Width: | Height: | Size: 1.7 KiB |
BIN
sbox_laugh.gif
Before Width: | Height: | Size: 226 B |
BIN
sbox_oops.gif
Before Width: | Height: | Size: 388 B |
@ -60,12 +60,12 @@ else
|
||||
|
||||
// Now time to make the new table
|
||||
$result = mysql_query("
|
||||
CREATE TABLE {$db_prefix}sbox_content
|
||||
(id int(11) NOT NULL auto_increment,
|
||||
time varchar(25) NOT NULL default '',
|
||||
name varchar(80) NOT NULL default '',
|
||||
content text NOT NULL,
|
||||
PRIMARY KEY (id)) TYPE=MyISAM;");
|
||||
CREATE TABLE `{$db_prefix}sbox_content` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`time` int(10) unsigned NOT NULL,
|
||||
`ID_MEMBER` mediumint(8) unsigned NOT NULL,
|
||||
`content` text NOT NULL,
|
||||
PRIMARY KEY (`id`)) ENGINE=MyISAM;");
|
||||
if (!$result)
|
||||
{
|
||||
echo "<font color=red>Error creating shoutbox table. SQL Error: ".mysql_error()."</font><BR />";
|
||||
@ -77,17 +77,17 @@ else
|
||||
$toSet = array();
|
||||
$toSet['sbox_Visible'] = '1';
|
||||
$toSet['sbox_GuestAllowed'] = '0';
|
||||
$toSet['sbox_MaxLines'] = '30';
|
||||
$toSet['sbox_Height'] = '180';
|
||||
$toSet['sbox_SmiliesVisible'] = '1';
|
||||
$toSet['sbox_TextSize1'] = 'x-small';
|
||||
$toSet['sbox_TextColor1'] = '#123456';
|
||||
$toSet['sbox_TextSize2'] = 'x-small';
|
||||
$toSet['sbox_TextColor2'] = '#000000';
|
||||
$toSet['sbox_MaxLines'] = '50';
|
||||
$toSet['sbox_Height'] = '180';
|
||||
$toSet['sbox_RefreshTime'] = '20';
|
||||
$toSet['sbox_BackgroundColor'] = '#E5E5E8';
|
||||
$toSet['sbox_FontFamily1'] = 'Verdana, sans-serif';
|
||||
$toSet['sbox_FontFamily2'] = 'Verdana, sans-serif';
|
||||
$toSet['sbox_TextSize1'] = 'xx-small';
|
||||
$toSet['sbox_TextColor1'] = '#000000';
|
||||
$toSet['sbox_TextSize2'] = 'xx-small';
|
||||
$toSet['sbox_TextColor2'] = '#476c8e';
|
||||
$toSet['sbox_BackgroundColor'] = '#E5E5E8';
|
||||
|
||||
// Insert settings
|
||||
foreach ($toSet as $key => $value)
|
||||
|
BIN
sbox_smile.gif
Before Width: | Height: | Size: 331 B |
BIN
sbox_smoke.gif
Before Width: | Height: | Size: 614 B |
@ -3,7 +3,7 @@ SMF Shoutbox
|
||||
</id>
|
||||
|
||||
<version>
|
||||
1.04
|
||||
1.10
|
||||
</version>
|
||||
|
||||
<mod info>
|
||||
@ -23,13 +23,28 @@ Instructions:
|
||||
If you really want to install this mod manually, please use this file as a "how to".
|
||||
|
||||
Author:
|
||||
The SMF shoutbox was written by Deep, some code ist "stolen" from Matthew Wolf (a.k.a Grudge).
|
||||
The SMF shoutbox was originally written by Deep, some code ist "stolen" from Matthew Wolf (a.k.a Grudge).
|
||||
The current version was heavily improved by Markus Birth.
|
||||
Thanks a lot, Grudge!
|
||||
|
||||
Please direct any questions regarding this version to Deep, either by email (diem4@gmx.net) or by posting
|
||||
in the appropriate place at www.simplemachines.org (the preferred option!)
|
||||
|
||||
History:
|
||||
Version 1.10
|
||||
1. sequential messages from one user have the same color
|
||||
2. character limit for one shout has been raised to 320 chars (like one long SMS ;-)
|
||||
3. displayed weekdays are now in the language the user has chosen in SMF and from SMF's language files
|
||||
4. sBox-time is kept in sync with SMF's time (including all timezone-stuff)
|
||||
5. there's a bar displayed showing what's new since the last refresh
|
||||
6. poster's name can be clicked to show his profile
|
||||
7. no HTML allowed
|
||||
8. your own nick is made bold and a sound is played on first occurence
|
||||
9. sbox now uses SMF's smileys and BBCode, option in settings shows the smiley-row known from posting messages in SMF
|
||||
10. now user's "Display Name"s are shown instead of usernames
|
||||
!! There's some experimental code commented out - maybe someone will make it work some day. It's
|
||||
!! for showing who's viewing the shoutbox and for giving each user a specific unique distinguishable color.
|
||||
|
||||
version 1.04
|
||||
1. font family is now adjustable
|
||||
2. german language pack extracted
|
||||
@ -56,7 +71,7 @@ Original Version
|
||||
</mod info>
|
||||
|
||||
<author>
|
||||
Deep
|
||||
Deep and Markus Birth
|
||||
</author>
|
||||
|
||||
<homepage>
|
||||
@ -72,65 +87,14 @@ $languagedir/Modifications.english.php
|
||||
</search for>
|
||||
|
||||
<add before>
|
||||
|
||||
//SMF Shoutbox
|
||||
$txt['sbox_ModTitle'] = 'SMF Shoutbox';
|
||||
$txt['sbox_Visible'] = 'Shoutbox is visible';
|
||||
$txt['sbox_GuestAllowed'] = 'Guests are allowed to shout';
|
||||
$txt['sbox_MaxLines'] = 'Maximum number of displayed lines';
|
||||
$txt['sbox_Height'] = 'Shoutbox height';
|
||||
$txt['sbox_SmiliesVisible'] = 'Smilie window is visible';
|
||||
$txt['sbox_smilie01_text'] = 'blblbl!';
|
||||
$txt['sbox_smilie02_text'] = 'grinning';
|
||||
$txt['sbox_smilie03_text'] = 'laughing';
|
||||
$txt['sbox_smilie04_text'] = 'kissing';
|
||||
$txt['sbox_smilie05_text'] = 'smiling';
|
||||
$txt['sbox_smilie06_text'] = 'that´s okay!';
|
||||
$txt['sbox_smilie07_text'] = 'smoking';
|
||||
$txt['sbox_smilie08_text'] = 'greeting';
|
||||
$txt['sbox_smilie09_text'] = 'cheerio!';
|
||||
$txt['sbox_smilie10_text'] = 'oops';
|
||||
$txt['sbox_smilie11_text'] = 'praying';
|
||||
$txt['sbox_smilie12_text'] = 'crying';
|
||||
$txt['sbox_smilie13_text'] = 'angry';
|
||||
$txt['sbox_smilie14_text'] = 'baaaaaad';
|
||||
$txt['sbox_smilie15_text'] = 'headbanging';
|
||||
$txt['sbox_smilie01_code'] = ':frech:';
|
||||
$txt['sbox_smilie02_code'] = ';-)';
|
||||
$txt['sbox_smilie03_code'] = ':-]';
|
||||
$txt['sbox_smilie04_code'] = ':-s';
|
||||
$txt['sbox_smilie05_code'] = ':-)';
|
||||
$txt['sbox_smilie06_code'] = ':-!';
|
||||
$txt['sbox_smilie07_code'] = ':smoking:';
|
||||
$txt['sbox_smilie08_code'] = ':greeting:';
|
||||
$txt['sbox_smilie09_code'] = ':cheerio:';
|
||||
$txt['sbox_smilie10_code'] = ':-O';
|
||||
$txt['sbox_smilie11_code'] = ':praying:';
|
||||
$txt['sbox_smilie12_code'] = ':crying:';
|
||||
$txt['sbox_smilie13_code'] = ':-(';
|
||||
$txt['sbox_smilie14_code'] = ':bad:';
|
||||
$txt['sbox_smilie15_code'] = ':bang:';
|
||||
$txt['sbox_smilie01_file'] = 'sbox_funny.gif';
|
||||
$txt['sbox_smilie02_file'] = 'sbox_grin.gif';
|
||||
$txt['sbox_smilie03_file'] = 'sbox_laugh.gif';
|
||||
$txt['sbox_smilie04_file'] = 'sbox_kiss.gif';
|
||||
$txt['sbox_smilie05_file'] = 'sbox_smile.gif';
|
||||
$txt['sbox_smilie06_file'] = 'sbox_yeah.gif';
|
||||
$txt['sbox_smilie07_file'] = 'sbox_smoke.gif';
|
||||
$txt['sbox_smilie08_file'] = 'sbox_hand.gif';
|
||||
$txt['sbox_smilie09_file'] = 'sbox_cheerio.gif';
|
||||
$txt['sbox_smilie10_file'] = 'sbox_oops.gif';
|
||||
$txt['sbox_smilie11_file'] = 'sbox_church.gif';
|
||||
$txt['sbox_smilie12_file'] = 'sbox_cry.gif';
|
||||
$txt['sbox_smilie13_file'] = 'sbox_angry.gif';
|
||||
$txt['sbox_smilie14_file'] = 'sbox_bad.gif';
|
||||
$txt['sbox_smilie15_file'] = 'sbox_bang.gif';
|
||||
$txt['sbox_Monday'] = 'Monday';
|
||||
$txt['sbox_Tuesday'] = 'Tuesday';
|
||||
$txt['sbox_Wednesday'] = 'Wednesday';
|
||||
$txt['sbox_Thurday'] = 'Thurday';
|
||||
$txt['sbox_Friday'] = 'Friday';
|
||||
$txt['sbox_Saturday'] = 'Saturday';
|
||||
$txt['sbox_Sunday'] = 'Sunday';
|
||||
$txt['sbox_SmiliesVisible'] = 'Smiley row is visible';
|
||||
$txt['sbox_KillShout'] = 'Dou you want to kill this shout?';
|
||||
$txt['sbox_TextSize1'] = '1. Font size';
|
||||
$txt['sbox_TextColor1'] = '1. Font color';
|
||||
@ -140,6 +104,7 @@ $txt['sbox_RefreshTime'] = 'Refresh time';
|
||||
$txt['sbox_BackgroundColor'] = 'Background color';
|
||||
$txt['sbox_FontFamily1'] = '1. Font family';
|
||||
$txt['sbox_FontFamily2'] = '2. Font family';
|
||||
$txt['sbox_Refresh'] = 'Refresh';
|
||||
</add before>
|
||||
|
||||
|
||||
@ -152,12 +117,13 @@ $languagedir/Help.english.php
|
||||
</search for>
|
||||
|
||||
<add before>
|
||||
|
||||
//SMF Shoutbox
|
||||
$helptxt['sbox_Visible'] = 'Here you can decide wether the shoutbox is visible or not,';
|
||||
$helptxt['sbox_GuestAllowed'] = 'Here you can decide wether the shoutbox smilies are visible or not';
|
||||
$helptxt['sbox_MaxLines'] = 'Here you can enter the maximal count of lines display by shoutbox.';
|
||||
$helptxt['sbox_Visible'] = 'Here you can decide wether the shoutbox is visible at all or not.';
|
||||
$helptxt['sbox_GuestAllowed'] = 'Here you can decide whether guests are allowed to post new shouts.';
|
||||
$helptxt['sbox_MaxLines'] = 'Here you can enter the maximal count of lines displayed in the shoutbox.';
|
||||
$helptxt['sbox_Height'] = 'Here you can enter the height (pixels) of the shoutbox.';
|
||||
$helptxt['sbox_SmiliesVisible'] = 'Here you can decide wether smilies are visible or not.';
|
||||
$helptxt['sbox_SmiliesVisible'] = 'Here you can decide whether smileys are visible or not. They work independently of this setting.';
|
||||
$helptxt['sbox_TextSize1'] = 'Here you can adjust the 1. font size';
|
||||
$helptxt['sbox_TextColor1'] = 'Here you can adjust the 1. font color';
|
||||
$helptxt['sbox_TextSize2'] = 'Here you can adjust the 2. font size';
|
||||
@ -365,64 +331,3 @@ $themedir/index.template.php
|
||||
|
||||
</add after>
|
||||
|
||||
<edit file>
|
||||
$themedir/script.js
|
||||
</edit file>
|
||||
|
||||
<search for>
|
||||
doForm.admin_hash_pass.value = hex_sha1(hex_sha1(username.toLowerCase() + doForm.admin_pass.value) + cur_session_id);
|
||||
doForm.admin_pass.value = doForm.admin_pass.value.replace(/./g, "*");
|
||||
}
|
||||
</search for>
|
||||
|
||||
<add after>
|
||||
|
||||
function clearSbox()
|
||||
{
|
||||
// Delete shoutbox message text after shout has been submitted
|
||||
if (document.sbox)
|
||||
document.sbox.sboxText.value="";
|
||||
}
|
||||
|
||||
function insertSmilie(smilieCode)
|
||||
{
|
||||
// insert smilie code into shoutbox text
|
||||
if (document.sbox)
|
||||
{
|
||||
var smilie = " " + smilieCode;
|
||||
var sboxText = document.sbox.sboxText;
|
||||
|
||||
if (sboxText.textLength)
|
||||
if (sboxText.textLength >= 0)
|
||||
{
|
||||
sboxText.focus();
|
||||
var startSelection = sboxText.selectionStart;
|
||||
var endSelection = sboxText.textLength;
|
||||
sboxText.value = sboxText.value.substring(0,startSelection) + smilie + sboxText.value.substring(sboxText.selectionEnd,endSelection);
|
||||
sboxText.selectionStart = startSelection;
|
||||
sboxText.selectionEnd = startSelection;
|
||||
sboxText.selectionStart = sboxText.selectionStart + smilie.length;
|
||||
return;
|
||||
}
|
||||
var browser = navigator.userAgent.toLowerCase();
|
||||
var browserInternetExplorer = ((browser.indexOf("msie") != -1) && (browser.indexOf("opera") == -1));
|
||||
var platformWindows = ((browser.indexOf("win")!=-1) || (browser.indexOf("16bit")!=-1));
|
||||
if (browserInternetExplorer && platformWindows && (parseInt(navigator.appVersion) >= 4))
|
||||
{
|
||||
if(sboxText.isTextEdit)
|
||||
{
|
||||
sboxText.focus();
|
||||
var selection = document.selection;
|
||||
var range = selection.createRange();
|
||||
range.colapse;
|
||||
if (range != null && (selection.type == "Text" || selection.type == "None"))
|
||||
range.text = smilie;
|
||||
return;
|
||||
}
|
||||
}
|
||||
sboxText.value += smilie;
|
||||
sboxText.focus();
|
||||
}
|
||||
}
|
||||
|
||||
</add after>
|
BIN
sbox_yeah.gif
Before Width: | Height: | Size: 343 B |