Archived
1
0

Initial import v1.04

This commit is contained in:
mbirth 2006-08-04 07:11:50 +00:00
parent 683ba72bfc
commit da05c0f208
23 changed files with 989 additions and 0 deletions

66
package-info.xml Normal file
View File

@ -0,0 +1,66 @@
<?xml version="1.0"?>
<!DOCTYPE package-info SYSTEM "http://www.simplemachines.org/xml/package-info">
<package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/">
<name>SMF Shoutbox</name>
<id>Deep:SMF_Shoutbox</id>
<type>modification</type>
<version>1.04</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" />
<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)
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>
</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>
<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" />
<code type="file">sbox_remove.php</code>
</uninstall>
<install>
<readme type="inline">Sorry, but the SMF Shoutbox Mod doesn't support your SMF version!</readme>
</install>
</package-info>

38
sbox.php Normal file
View File

@ -0,0 +1,38 @@
<?php
/******************************************************************************
* shout.php *
*******************************************************************************
* SMF: Simple Machines Forum - SMF Shoutbox MOD *
* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com) *
* =========================================================================== *
* Software Version: 1.00 *
* Software originally by: ? *
* Ported to SMF by: Deep *
* Support, News, Updates at: http://www.simplemachines.org *
*******************************************************************************
* This program is free software; you may redistribute it and/or modify it *
* under the terms of the provided license as published by Lewis Media. *
* *
* This program is distributed in the hope that it is and will be useful, *
* but WITHOUT ANY WARRANTIES; without even any implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
* See the "license.txt" file for details of the Simple Machines license. *
* The latest version can always be found at http://www.simplemachines.org. *
******************************************************************************/
if (!defined('SMF'))
die('Hacking attempt...');
function sbox_display()
{
global $user_info, $db_prefix, $modSettings, $settings, $sourcedir, $scripturl, $txt, $context;
if ($modSettings['sbox_Visible'] != '0')
{
// Load the template!
loadTemplate('sbox');
template_shout_box();
}
}
?>

77
sbox.template.php Normal file
View File

@ -0,0 +1,77 @@
<?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" />&nbsp;<input type="submit" class="input" value="&nbsp;shout&nbsp;" />';
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>';
}
?>

165
sboxDB.php Normal file
View File

@ -0,0 +1,165 @@
<?
require("../SSI.php");
if (!defined('SMF'))
die('Hacking attempt...');
// global variables
global $db_connection, $context, $settings, $txt, $user_info, $modSettings, $db_prefix;
// used in test scenario
//@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"' : '', '>
<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>
<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>';
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;
}
// close header and open body
echo '
</head>
<body>';
// get smilie path
$themedir = $settings['default_theme_url']; // smf theme path
$imgdir = $themedir."/images/"; // smilie path
// 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);
// 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>';
echo '[&nbsp;'.$date.'&nbsp;]&nbsp;<b>&lt;'.$name.'&gt;</b>&nbsp;'.$content.'</div>';
}
echo '
</body>
</html>';
}
?>

BIN
sbox_angry.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

BIN
sbox_bad.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
sbox_bang.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 904 B

BIN
sbox_cheerio.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
sbox_church.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
sbox_cry.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

BIN
sbox_funny.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 749 B

BIN
sbox_grin.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

BIN
sbox_hand.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 655 B

BIN
sbox_kiss.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
sbox_laugh.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

BIN
sbox_oops.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

BIN
sbox_refresh.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 B

96
sbox_remove.php Normal file
View File

@ -0,0 +1,96 @@
<?php
/******************************************************************************
* sbox_remove.php *
*******************************************************************************
* SMF: Simple Machines Forum - SMF Shoutbox MOD *
* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com) *
* =========================================================================== *
* Software Version: 1.04 *
* Software originally by: ? *
* Ported to SMF by: Deep, most code stolen from Matthew Wolf (Grudge) *
* Support, News, Updates at: http://www.simplemachines.org *
*******************************************************************************
* This program is free software; you may redistribute it and/or modify it *
* under the terms of the provided license as published by Lewis Media. *
* *
* This program is distributed in the hope that it is and will be useful, *
* but WITHOUT ANY WARRANTIES; without even any implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
* See the "license.txt" file for details of the Simple Machines license. *
* The latest version can always be found at http://www.simplemachines.org. *
******************************************************************************/
echo'
<html>
<head>
<title>SMF DataBase Editor - Ultimate Shoutbox</title>
</head>
<body bgcolor="#FFFFFF">
<center>
<table border="0" cellspacing="1" cellpadding="4" bgcolor="#000000" width="90%">
<tr>
<th bgcolor="#34699E"><font color="#FFFFFF">SMF DB Editor - SMF-Shoutbox MOD - SQL UNINSTALL</font></th>
</tr>';
if (!isset($_REQUEST['sa']))
{
echo'
<tr>
<td bgcolor="#FFFFFF" align="center">
<font size="2"><a href="sbox_remove.php?sa=doit&man=yes">Click here to start shoutbox uninstallation</font></a><br /</td></tr></table>
';
}
else
{
echo '</table>';
if ((isset($_REQUEST['man'])) || (!isset($db_name)))
{
include_once ("Settings.php");
$dbcon = mysql_connect($db_server, $db_user, $db_passwd);
mysql_select_db($db_name);
}
$error=0;
$shoutChunkSize = 350;
$timeLimitThreshold = 10;
$self = &$_SERVER['PHP_SELF'];
$start_time = time();
// Now time to make the new table
$result = mysql_query("DROP TABLE {$db_prefix}sbox_content;");
if (!$result)
{
echo "<font color=red>Error removing shoutbox table. SQL Error: ".mysql_error()."</font><BR />";
$error++;
}
else
echo "<font color=green>Shoutbox table deleted!</font><BR />";
$result = mysql_query("DELETE FROM {$db_prefix}settings WHERE variable LIKE 'sbox_%';");
if(!$result)
{
echo "<font color=red>Settings: ".mysql_error().".</font><br />";
$error++;
}
else
echo "<font color=green>Settings removed correctly!</font><br />";
$done = 1;
// Result
if (isset($done))
{
echo "</td></tr></table>";
if($error==0)
echo "<P>Downgrade of SQL was successfull.";
elseif ($error==1)
echo "<P>There was <B>one</B> error when downgrading your SQL.";
elseif ($error>1)
echo "<P>There were <B>$error</B> errors when downgrading your SQL.";
}
}
echo '</body></html>';
?>

119
sbox_setup.php Normal file
View File

@ -0,0 +1,119 @@
<?php
/******************************************************************************
* sbox_setup.php *
*******************************************************************************
* SMF: Simple Machines Forum - SMF Shoutbox MOD *
* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com) *
* =========================================================================== *
* Software Version: 1.04 *
* Software originally by: ? *
* Ported to SMF by: Deep, most code stolen from Matthew Wolf (Grudge) *
* Support, News, Updates at: http://www.simplemachines.org *
*******************************************************************************
* This program is free software; you may redistribute it and/or modify it *
* under the terms of the provided license as published by Lewis Media. *
* *
* This program is distributed in the hope that it is and will be useful, *
* but WITHOUT ANY WARRANTIES; without even any implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
* See the "license.txt" file for details of the Simple Machines license. *
* The latest version can always be found at http://www.simplemachines.org. *
******************************************************************************/
echo'
<html>
<head>
<title>SMF DataBase Editor - SMF-Shoutbox</title>
</head>
<body bgcolor="#FFFFFF">
<center>
<table border="0" cellspacing="1" cellpadding="4" bgcolor="#000000" width="90%">
<tr>
<th bgcolor="#34699E"><font color="#FFFFFF">SMF DB Editor - SMF-Shoutbox MOD - SQL INSTALL</font></th>
</tr>';
if (!isset($_REQUEST['sa']))
{
echo'
<tr>
<td bgcolor="#FFFFFF" align="center">
<font size="2"><a href="sbox_setup.php?sa=doit&man=yes">Click here to start shoutbox installation</font></a><br /</td></tr></table>
';
}
else
{
echo '</table>';
if ((isset($_REQUEST['man'])) || (!isset($db_name)))
{
include_once ("Settings.php");
$dbcon = mysql_connect($db_server, $db_user, $db_passwd);
mysql_select_db($db_name);
}
$error=0;
$shoutChunkSize = 350;
$timeLimitThreshold = 10;
$self = &$_SERVER['PHP_SELF'];
$start_time = time();
// 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;");
if (!$result)
{
echo "<font color=red>Error creating shoutbox table. SQL Error: ".mysql_error()."</font><BR />";
$error++;
}
else
echo "<font color=green>Shoutbox table created!</font><BR />";
$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_RefreshTime'] = '20';
$toSet['sbox_BackgroundColor'] = '#E5E5E8';
$toSet['sbox_FontFamily1'] = 'Verdana, sans-serif';
$toSet['sbox_FontFamily2'] = 'Verdana, sans-serif';
// Insert settings
foreach ($toSet as $key => $value)
{
$result = mysql_query("INSERT INTO {$db_prefix}settings (`variable`, `value`) VALUES ('$key', '$value');");
if(!$result)
{
echo "<font color=red>Table: ".mysql_error()." Already exists, skipping.</font><br />";
$error++;
}
else
echo "<font color=green>Data inserted correctly!</font><br />";
}
$done = 1;
// Result
if (isset($done))
{
echo "</td></tr></table>";
if($error==0)
echo "<P>Upgrade of SQL was successfull.";
elseif ($error==1)
echo "<P>There was <B>one</B> error when upgrading your SQL.";
elseif ($error>1)
echo "<P>There were <B>$error</B> errors when upgrading your SQL.";
}
}
echo '</body></html>';
?>

BIN
sbox_smile.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

BIN
sbox_smoke.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 B

428
sbox_v1.04.mod Normal file
View File

@ -0,0 +1,428 @@
<id>
SMF Shoutbox
</id>
<version>
1.04
</version>
<mod info>
This is a shoutbox with seamless integration into SMF.
Any registered user and any guest (if you allow them to use it) can type in a message and click shout.
The shoubox appears above the board index of the default theme. To do that, BoardIndex.template.php
of the default theme will be modified.
If you are using another theme, please modify the BoardIndex.template.php of that theme manually.
Maybe you have to modify sbox.template.php a little bit if u are using an "unusual" theme.
Instructions:
1. Install SMF shoutbox using boardmod (it´s too complex to install manually)
2. Go into the Feature Settings page and choose the appropriate settings
3. Type in a message and click Shout!
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).
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.04
1. font family is now adjustable
2. german language pack extracted
version 1.03
1. another refreshing bug fixed
2. help texts (admin interface) added
3. javascript bug (opera and netscape only) fixed
4. smilie window now can be made invisible
5. shouts can be deleted by admin
6. font color, font size and background color can be adjusted
version 1.02
1. javascript/html bugs fixed
2. error when shouting empty string fixed
version 1.01:
1. some debug code removed
2. refreshing bug fixed
3. file path bug fixed
version 1.00:
Original Version
</mod info>
<author>
Deep
</author>
<homepage>
No homepage available at the moment
</homepage>
<edit file>
$languagedir/Modifications.english.php
</edit file>
<search for>
?>
</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_KillShout'] = 'Dou you want to kill this shout?';
$txt['sbox_TextSize1'] = '1. Font size';
$txt['sbox_TextColor1'] = '1. Font color';
$txt['sbox_TextSize2'] = '2. Font size';
$txt['sbox_TextColor2'] = '2. Font color';
$txt['sbox_RefreshTime'] = 'Refresh time';
$txt['sbox_BackgroundColor'] = 'Background color';
$txt['sbox_FontFamily1'] = '1. Font family';
$txt['sbox_FontFamily2'] = '2. Font family';
</add before>
<edit file>
$languagedir/Help.english.php
</edit file>
<search for>
?>
</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_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_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';
$helptxt['sbox_TextColor2'] = 'Here you can adjust the 2. font color';
$helptxt['sbox_RefreshTime'] = 'Here you can adjust the refresh time';
$helptxt['sbox_BackgroundColor'] = 'Here you can adjust the background color';
$helptxt['sbox_FontFamily1'] = 'Here you can adjust the 1. font family.';
$helptxt['sbox_FontFamily2'] = 'Here you can adjust the 2. font family.';
</add before>
<edit file>
$sourcedir/ModSettings.php
</edit file>
<search for>
'karma' => 'ModifyKarmaSettings',
</search for>
<add after>
'sbox' => 'ModifySboxSettings',
</add after>
<search for>
'layout' => array(
'title' => $txt['mods_cat_layout'],
'href' => $scripturl . '?action=featuresettings;sa=layout;sesc=' . $context['session_id'],
),
</search for>
<add after>
'sbox' => array(
'title' => $txt['sbox_ModTitle'],
'href' => $scripturl . '?action=featuresettings;sa=sbox;sesc=' . $context['session_id'],
),
</add after>
<search for>
function ModifyKarmaSettings()
</search for>
<add before>
function ModifySboxSettings()
{
global $txt, $scripturl, $context, $settings, $sc;
$config_vars = array
(
array('check', 'sbox_Visible'),
array('check', 'sbox_GuestAllowed'),
array('check', 'sbox_SmiliesVisible'),
array('int', 'sbox_MaxLines'),
array('int', 'sbox_Height'),
array('int', 'sbox_RefreshTime'),
array('select', 'sbox_FontFamily1', array(
'Garamond, serif' => 'Garamond, serif',
'Times, serif' => 'Times, serif',
'Arial, Helvetica, sans-serif' => 'Arial, Helvetica, sans-serif',
'Tahoma, Helvetica, sans-sarif' => 'Tahoma, Helvetica, sans-sarif',
'Verdana, sans-serif' => 'Verdana, sans-serif',
'cursive' => 'cursive',
'Palatino, fantasy' => 'Palatino, fantasy',
'Courier, monospace' => 'Courier, monospace'
),
),
array('select', 'sbox_FontFamily2', array(
'Garamond, serif' => 'Garamond, serif',
'Times, serif' => 'Times, serif',
'Arial, Helvetica, sans-serif' => 'Arial, Helvetica, sans-serif',
'Tahoma, Helvetica, sans-sarif' => 'Tahoma, Helvetica, sans-sarif',
'Verdana, sans-serif' => 'Verdana, sans-serif',
'cursive' => 'cursive',
'Palatino, fantasy' => 'Palatino, fantasy',
'Courier, monospace' => 'Courier, monospace'
),
),
array('select', 'sbox_TextSize1', array(
'8px' => '8xp',
'9px' => '9xp',
'10px' => '10xp',
'11px' => '11xp',
'12px' => '12xp',
'13px' => '13xp',
'14px' => '14xp',
'15px' => '15xp',
'16px' => '16xp',
'xx-small' => 'xx-small',
'x-small' => 'x-small',
'small' => 'small',
'medium' => 'medium',
'large' => 'large',
'x-large' => 'x-large',
'xx-large' => 'xx-large'
),
),
array('text', 'sbox_TextColor1'),
array('select', 'sbox_TextSize2', array(
'8px' => '8xp',
'9px' => '9xp',
'10px' => '10xp',
'11px' => '11xp',
'12px' => '12xp',
'13px' => '13xp',
'14px' => '14xp',
'15px' => '15xp',
'16px' => '16xp',
'xx-small' => 'xx-small',
'x-small' => 'x-small',
'small' => 'small',
'medium' => 'medium',
'large' => 'large',
'x-large' => 'x-large',
'xx-large' => 'xx-large'
),
),
array('text', 'sbox_TextColor2'),
array('text', 'sbox_BackgroundColor')
);
// Saving?
if (isset($_GET['save']))
{
saveDBSettings($config_vars);
redirectexit('action=featuresettings;sa=sbox');
}
$context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=sbox';
$context['settings_title'] = $txt['sbox_ModTitle'];
prepareDBSettingContext($config_vars);
}
</add before>
<edit file>
$sourcedir/Subs.php
</edit file>
<search for>
log_error('Copyright removed!!');
}
}
</search for>
<add after>
function sbox()
{
global $sourcedir;
include_once("$sourcedir/sbox.php");
sbox_display();
}
</add after>
<edit file>
$themedir/BoardIndex.template.php
</edit file>
<search for>
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/fader.js"></script>
</td>
</tr>
</table>';
}
</search for>
<add after>
// display shoutbox
if (function_exists('sbox')) sbox();
</add after>
<edit file>
$themedir/index.template.php
</edit file>
<search for>
echo $context['html_headers'], '
</search for>
<add after>
<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>
</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 Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B