Skip to content

Commit

Permalink
CHS Shoutbox 0.9.11 from 2009-10-08
Browse files Browse the repository at this point in the history
  • Loading branch information
Chrissyx committed Jan 10, 2021
1 parent 3f442ab commit 8f2e4ce
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 85 deletions.
8 changes: 6 additions & 2 deletions Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
######################################


Version: 0.9.10
Version: 0.9.11


Vorwort
Expand All @@ -28,6 +28,10 @@ Einsatz kommen soll), die "shoutbox.php" und den Ordner "shoutbox" samt Inhalt h
aus dem Ordner "shoutbox" auf und folge dann den Anweisungen.


Update auf neue Version
Lade, wie schon zur Installation auch, alle Dateien hoch und ersetze so jede Datei durch ihre neue Version.


FAQ
-Wie kann ich meine Shoutbox verwalten?
Rufe, wie schon bei der Installation auch, die "index.php" im "shoutbox"-Ordner auf und folge den Anweisungen.
Expand All @@ -53,7 +57,7 @@ Mehr Infos zum TBB unter http://www.tritanium-scripts.com/


Credits
� 2006 - 2008 by Chrissyx
� 2006 - 2009 by Chrissyx
Powered by V4 Technology
http://www.chrissyx.de(.vu)/
http://www.chrissyx.com/
74 changes: 44 additions & 30 deletions shoutbox.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?php

#####################################################################
#Script written by Chrissyx #
#You may use and edit this script, if you don't remove this comment!#
#http://www.chrissyx.de(.vu)/ #
#####################################################################

/**
* Shoutbox zum Anzeigen und Verwalten der Shouts. Verarbeitet auch Login und Passwörter.
*
* @author Chrissyx
* @copyright (c) 2006 - 2009 by Chrissyx
* @license http://creativecommons.org/licenses/by-nc-sa/3.0/ Creative Commons 3.0 by-nc-sa
* @package CHS_Shoutbox
* @version 0.9.11
*/
/**
* Generiert den XHTML Head für jede interne Seite der Shoutbox und sendet den passenden Content-Type, wenn der Browser XML unterstützt.
*
Expand Down Expand Up @@ -48,16 +50,15 @@ function headBox($title, $keywords, $description, $sonstiges=null)
{
//Config: Shoutbox, Anzahl Archiv, Archiv, Passwort, Anzahl, TBB Smilies, Smilies Anzahl, Smilies Anzahl Reihe, Redir nach Login
list($shoutboxdat, $shoutarchivmax, $shoutarchivdat, $shoutpwdat, $shoutmax, $smilies, $smiliesmax, $smiliesmaxrow, $redir) = @array_map('trim', file('shoutbox/settings.dat')) or die('<b>ERROR:</b> Keine Einstellungen gefunden!');
$forum = explode('/', $smilies);
$forum = implode('/', array_slice($forum, 0, count($forum)-2));
$forum = implode('/', array_slice(explode('/', $smilies), 0, -2));
$temp = fopen('shoutbox/settings.php', 'w');
fwrite($temp, "<?php\n //Auto-generated config!\n \$shoutboxdat = '$shoutboxdat';\n \$shoutarchivmax = " . (($shoutarchivmax) ? $shoutarchivmax : "''") . ";\n \$shoutarchivdat = '$shoutarchivdat';\n \$shoutpwdat = '$shoutpwdat';\n \$shoutmax = $shoutmax;\n \$smilies = file('$smilies');\n \$smiliesmax = " . (($smiliesmax) ? $smiliesmax : "''") . ";\n \$smiliesmaxrow = " . (($smiliesmaxrow) ? $smiliesmaxrow : "''") . ";\n \$redir = '$redir';\n \$forum = '$forum';\n?>");
fwrite($temp, "<?php\n //Auto-generated config!\n \$shoutboxdat = '$shoutboxdat';\n \$shoutarchivmax = " . ($shoutarchivmax ? $shoutarchivmax : "''") . ";\n \$shoutarchivdat = '$shoutarchivdat';\n \$shoutpwdat = '$shoutpwdat';\n \$shoutmax = $shoutmax;\n \$smilies = array_map('trim', " . (file_exists($smilies) ? "file('$smilies')" : 'array()') . ");\n \$smiliesmax = " . ($smiliesmax ? $smiliesmax : "''") . ";\n \$smiliesmaxrow = " . ($smiliesmaxrow ? $smiliesmaxrow : "''") . ";\n \$redir = '$redir';\n \$forum = '$forum';\n?>");
fclose($temp);
$smilies = file($smilies);
$smilies = array_map('trim', file_exists($smilies) ? file($smilies) : array());
}

//$action laden
$action = (!$_GET['action']) ? $_POST['action'] : $_GET['action'];
$action = isset($_GET['action']) ? $_GET['action'] : (isset($_POST['action']) ? $_POST['action'] : '');
session_start();

//Mehr Smilies
Expand Down Expand Up @@ -95,7 +96,7 @@ function headBox($title, $keywords, $description, $sonstiges=null)
{
headBox('CHS - Shoutbox: Login', 'Shoutbox, CHS, Login, Chrissyx', 'Login der Shoutbox von CHS', '<link rel="stylesheet" media="all" href="shoutbox/style.css" />');
?>
<span style="font-size:large;">CHS - Shoutbox: Login</span><br />
<h4>CHS - Shoutbox: Login</h4>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
Bitte Passwort angeben: <input type="password" name="shoutpw" <?php if($_POST['shoutpw']) echo('style="border-color:#FF0000;" /><br />
<span style="color:#FF0000; font-weight:bold;">&raquo; Falsches Passwort!</span><br '); ?>/><br />
Expand Down Expand Up @@ -170,23 +171,36 @@ function headBox($title, $keywords, $description, $sonstiges=null)
?>

<script type="text/javascript">

/*******************************************************************\
*Script written by Chrissyx *
*You may use and edit this script, if you don't remove this comment!*
*http://www.chrissyx.de(.vu)/ *
\*******************************************************************/

/**
* Activates the submit button, depending on the stated name.
*
* @author Chrissyx
* @copyright (c) 2001 - 2009 by Chrissyx
* @license http://creativecommons.org/licenses/by-nc-sa/3.0/ Creative Commons 3.0 by-nc-sa
* @link http://www.chrissyx.de(.vu)/
* @since 0.9
* @version 1.0
*/
function canShout()
{
document.getElementById('shoutboxform').shout.disabled = (document.getElementById('shoutboxform').name.value.length != 0) ? false : true;
};
{
(sbform = document.getElementById('shoutboxform')).shout.disabled = sbform.name.value.length != 0 ? false : true;
}

/**
* Adds a smilie-string to the textbox.
*
* @author Chrissyx
* @copyright (c) 2001 - 2009 by Chrissyx
* @license http://creativecommons.org/licenses/by-nc-sa/3.0/ Creative Commons 3.0 by-nc-sa
* @link http://www.chrissyx.de(.vu)/
* @since 0.9
* @version 1.0
*/
function setShoutSmilie(smilie)
{
document.getElementById('shoutboxform').shoutbox.value += smilie;
document.getElementById('shoutboxform').shoutbox.focus();
};
(sbbox = document.getElementById('shoutboxform').shoutbox).value += smilie;
sbbox.focus();
}
</script>

<a id="shoutbox" name="shoutbox"></a>
Expand All @@ -201,18 +215,18 @@ function setShoutSmilie(smilie)
{
$smilie = explode("\t", $smilies[$i]);
$key[] = $smilie[1];
$value[] = '<img src="' . $forum . '/' . $smilie[2] . '" style="border:none;" alt="' . $smilie[1] . '" />';
$value[] = '<img src="' . $forum . '/' . $smilie[2] . '" alt="' . $smilie[1] . '" style="border:none;" />';
if($i<$smiliesmax)
{
if(($i % $smiliesmaxrow) == 0) echo("<br />\n");
echo("<a href=\"javascript:setShoutSmilie(' " . $smilie[1] . " ');\">" . $value[$i] . '</a>');
echo("<a href=\"javascript:setShoutSmilie(' " . $smilie[1] . "');\">" . $value[$i] . '</a>');
}
}
$smilies = array_combine($key, $value);
}
?><br />
<input type="submit" name="shout" value="Shout!" style="width:53px;" readonly="readonly" /> <input type="reset" value="Reset" style="width:53px;" /> <input type="button" value="Archiv" style="width:53px;" onclick="window.open('shoutbox.php?action=archiv&amp;page=0', '_blank', 'width=400, resizable, scrollbars, status');" /><br />
<input type="button" value="Reload" onclick="document.location='<?=$_SERVER['PHP_SELF']?>#shoutbox';" style="width:<?=($smilies) ? "63px;\" /> <input type=\"button\" value=\"Mehr Smilies\" style=\"width:100px;\" onclick=\"window.open('shoutbox.php?action=smilies', '_blank', 'width=250, resizable, scrollbars, status')" : '167px'?>;" />
<input type="button" value="Reload" onclick="window.location='<?=$_SERVER['PHP_SELF']?>#shoutbox'; location.reload();" style="width:<?=($smilies) ? "63px;\" /> <input type=\"button\" value=\"Mehr Smilies\" style=\"width:100px;\" onclick=\"window.open('shoutbox.php?action=smilies', '_blank', 'width=250, resizable, scrollbars, status')" : '167px'?>;" />
</div>
<input type="hidden" name="action" value="shout" />
<?php if($_SESSION['shoutpw'] && $_SESSION['dispall']) echo('<a href="' . $_SERVER['PHP_SELF'] . '?action=shoutout">Logout</a>'); ?>
Expand Down Expand Up @@ -262,7 +276,7 @@ function setShoutSmilie(smilie)
else echo("<b>ERROR:</b> Keine Adminrechte!<br />\n");
}

//Shouts zeigen (Achtung: 1337!)
//Shouts zeigen (Achtung: 1337! Verstehen auf eigene Gefahr!)
if(!$temp = file($shoutboxdat)) echo('Keine Shouts gefunden!');
else foreach($temp as $key => $value)
{
Expand Down
16 changes: 12 additions & 4 deletions shoutbox/functions.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
<?php
/**
* Benötigte Funktionen und initiale Anweisungen.
*
* @author Chrissyx
* @copyright (c) 2001 - 2009 by Chrissyx
* @license http://creativecommons.org/licenses/by-nc-sa/3.0/ Creative Commons 3.0 by-nc-sa
* @package CHS_Shoutbox
*/
//$action laden
$action = (!$_GET['action']) ? $_POST['action'] : $_GET['action'];
$action = isset($_GET['action']) ? $_GET['action'] : (isset($_POST['action']) ? $_POST['action'] : '');

//echo Kurzform aktivieren
if(ini_get(short_open_tag) == '0') ini_set(short_open_tag, '1');
if(ini_get('short_open_tag') == '0') ini_set('short_open_tag', '1');

//Session laden, IP sichern
session_start();
if(!$_SESSION['session_ip']) $_SESSION['session_ip'] = $_SERVER['REMOTE_ADDR'];
if(!isset($_SESSION['session_ip'])) $_SESSION['session_ip'] = $_SERVER['REMOTE_ADDR'];
else if($_SESSION['session_ip'] != $_SERVER['REMOTE_ADDR']) die('Nicht erlaubt, diese Session zu verwenden!');

//Aufbauzeit [PHP4]
Expand Down Expand Up @@ -80,7 +88,7 @@ function tail()
*
* @author Chrissyx
* @copyright Chrissyx
* @param string HTML Schriftgröße von 1 bis 7 oder eigener Wert.
* @param string HTML Schriftgröße von 1 bis 7 oder eigener Wert
*/
function font($wert)
{
Expand Down
74 changes: 25 additions & 49 deletions shoutbox/index.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php

#####################################################################
#Script written by Chrissyx #
#You may use and edit this script, if you don't remove this comment!#
#http://www.chrissyx.de(.vu)/ #
#####################################################################

$temp = explode('/', $_SERVER['PHP_SELF']);
if(($temp[count($temp)-2]) != 'shoutbox') die('<b>ERROR:</b> Konnte Verzeichnis "shoutbox" nicht finden! "index.php" aufgerufen?');
elseif(!file_exists('../shoutbox.php')) die('<b>ERROR:</b> Konnte "shoutbox.php" nicht finden!');
elseif(!file_exists('style.css')) die('<b>ERROR:</b> Konnte "style.css" nicht finden!');
elseif(!file_exists('functions.php')) die('<b>ERROR:</b> Konnte "functions.php" nicht finden!');
else include('functions.php');
/**
* Adminmodul zum Installieren und Verwalten der Shoutbox.
*
* @author Chrissyx
* @copyright (c) 2006 - 2009 by Chrissyx
* @license http://creativecommons.org/licenses/by-nc-sa/3.0/ Creative Commons 3.0 by-nc-sa
* @package CHS_Newsscript
* @version 0.9.11
*/
if(!is_dir('../shoutbox/')) die('<b>ERROR:</b> Konnte Verzeichnis &quot;shoutbox&quot; nicht finden!');
elseif(!file_exists('../shoutbox.php')) die('<b>ERROR:</b> Konnte &quot;shoutbox.php&quot; nicht finden!');
elseif(!file_exists('style.css')) die('<b>ERROR:</b> Konnte &quot;style.css&quot; nicht finden!');
else require('functions.php');

if(file_exists('settings.dat'))
{
Expand All @@ -27,12 +27,13 @@
$action = 'admin';
}
}

$temp = $temp[count($temp)-1];
if(decoct(fileperms($temp)) != '100775') chmod($temp, 0775) or die('<b>ERROR:</b> Konnte für "' . $temp . '" keine Rechte setzen!');
elseif(decoct(fileperms('../shoutbox.php')) != '100775') chmod('../shoutbox.php', 0775) or die('<b>ERROR:</b> Konnte für "shoutbox.php" keine Rechte setzen!');
elseif(decoct(fileperms('../shoutbox/')) != '40775') chmod('../shoutbox/', 0775) or die('<b>ERROR:</b> Konnte für den Ordner "shoutbox" keine Rechte setzen!');
clearstatcache();
else
{
if(decoct(fileperms($temp = basename($_SERVER['PHP_SELF']))) != '100775') chmod($temp, 0775) or die('<b>ERROR:</b> Konnte für &quot;' . $temp . '&quot; keine Rechte setzen!');
elseif(decoct(fileperms('../shoutbox.php')) != '100775') chmod('../shoutbox.php', 0775) or die('<b>ERROR:</b> Konnte für &quot;shoutbox.php&quot; keine Rechte setzen!');
elseif(decoct(fileperms('../shoutbox/')) != '40775') chmod('../shoutbox/', 0775) or die('<b>ERROR:</b> Konnte für den Ordner &quot;shoutbox&quot; keine Rechte setzen!');
clearstatcache();
}

switch($action)
{
Expand Down Expand Up @@ -84,27 +85,9 @@
fwrite($temp, $_SESSION['shoutpw']);
fclose($temp);
}
if($_POST['shoutboxdat'] != $settings[0])
{
$temp = fopen('../' . $_POST['shoutboxdat'], 'w');
fwrite($temp, file_get_contents('../' . $settings[0]));
fclose($temp);
unlink('../' . $settings[0]);
}
if($_POST['shoutarchivdat'] != $settings[2])
{
$temp = fopen('../' . $_POST['shoutarchivdat'], 'w');
fwrite($temp, file_get_contents('../' . $settings[2]));
fclose($temp);
unlink('../' . $settings[2]);
}
if($_POST['shoutpwdat'] != $settings[3])
{
$temp = fopen('../' . $_POST['shoutpwdat'], 'w');
fwrite($temp, file_get_contents('../' . $settings[3]));
fclose($temp);
unlink('../' . $settings[3]);
}
if($_POST['shoutboxdat'] != $settings[0]) rename('../' . $settings[0], '../' . $_POST['shoutboxdat']) or $_POST['shoutboxdat'] = $settings[0];
if($_POST['shoutarchivdat'] != $settings[2]) rename('../' . $settings[2], '../' . $_POST['shoutarchivdat']) or $_POST['shoutarchivdat'] = $settings[2];
if($_POST['shoutpwdat'] != $settings[3]) rename('../' . $settings[3], '../' . $_POST['shoutpwdat']) or $_POST['shoutpwdat'] = $settings[3];
$temp = fopen('settings.dat', 'w');
fwrite($temp, $_POST['shoutboxdat'] . "\n" . $_POST['shoutarchivmax'] . "\n" . $_POST['shoutarchivdat'] . "\n" . $_POST['shoutpwdat'] . "\n" . $_POST['shoutmax'] . "\n" . $_POST['shoutsmilies'] . "\n" . $_POST['smiliesmax']. "\n" . $_POST['smiliesmaxrow'] . "\n" . $_POST['redir']);
fclose($temp);
Expand Down Expand Up @@ -150,23 +133,16 @@
<script type="text/javascript">
function help(data)
{

/*******************************************************************\
*Script written by Chrissyx *
*You may use and edit this script, if you don't remove this comment!*
*http://www.chrissyx.de(.vu)/ *
\*******************************************************************/

document.getElementById('help').firstChild.nodeValue = data;
};
}
</script>

<?php font('4'); ?>CHS - Shoutbox: Installation</span><br /><br />
Hier kannst Du deine Shoutbox einrichten und installieren. Bereits vorhandene Dateien werden überschrieben!<br />
Bitte treffe folgende Einstellungen:<br /><br />
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<table onmouseout="help('Hier findest Du jeweils eine kleine Hilfe zu den Einstellungen. Aktiviere JavaScript, falls sich hier nichts ändert.');">
<tr><td colspan="2"></td><td rowspan="16" width="200" style="background-color:yellow"><div id="help">Hier findest Du jeweils eine kleine Hilfe zu den Einstellungen. Aktiviere JavaScript, falls sich hier nichts ändert.</div></td></tr>
<tr><td colspan="2"></td><td rowspan="16" style="background-color:yellow; width:200px;"><div id="help">Hier findest Du jeweils eine kleine Hilfe zu den Einstellungen. Aktiviere JavaScript, falls sich hier nichts ändert.</div></td></tr>
<tr onmouseover="help('Lege hier die Anzahl der angezeigten Shouts fest, bevor sie ins Archiv verschoben werden. Je mehr Shouts, desto länger wird die Box und der benötigte Platz zum Anzeigen auf deiner Seite. Normal sind 5 bis 10 Einträge, aber das ist dir überlassen.');"><td>Anzahl der Shouts:</td><td><input type="text" name="shoutmax" value="5" size="25" /></td></tr>
<tr onmouseover="help('Optional: Wenn Du willst, kannst Du hier angeben, ob Shouts im Archiv seitenweise angezeigt werden sollen. Falls ja, bieten sich 40 bis 50 Einträge an, es können aber auch über 100 und mehr sein.');"><td>Shouts pro Archiv:</td><td><input type="text" name="shoutarchivmax" size="25" onfocus="this.value='50';" /></td></tr>
<tr><td colspan="2"></td></tr>
Expand Down

0 comments on commit 8f2e4ce

Please sign in to comment.