<center>
<?php
// Copyright by Manuel Staechele
// Support www.ilch.de
// modifiziert von: Suehprom (FFG-Clan)
defined ('main') or die ('no direct access');
if (loggedin()) {
$shoutbox_VALUE_name = $_SESSION['authname'];
} else {
$shoutbox_VALUE_name = 'Nickname';
}
// Admins
if (user_has_admin_right($menu, false)) {
if (has_right($allgAr['sb_recht'])) {
if (!empty($_POST['shoutbox2_submit']) AND chk_antispam ('shoutbox2')) {
$shoutbox_nickname = escape($_POST['shoutbox2_nickname'], 'string');
$shoutbox_nickname = substr($shoutbox_nickname, 0, 15);
$shoutbox_textarea = escape($_POST['shoutbox2_textarea'], 'textarea');
$shoutbox_textarea = preg_replace("/[.?(url|b|i|u|img|code|quote)[^]]*?]/i", "", $shoutbox_textarea);
$shoutbox_textarea = strip_tags($shoutbox_textarea);
if (!empty($shoutbox_nickname) AND !empty($shoutbox_textarea)) {
db_query('INSERT INTO `prefix_shoutbox2` (`nickname`,`textarea`) VALUES ( "<font color=#FF0000>' . $shoutbox_nickname . '</font><br><small>' . date('d.m - H:i \U\h\r') . '</small>" , "<br>' . $shoutbox_textarea . '" ) ');
}
$ref = strstr($_SERVER['HTTP_REFERER'], 'index.php?');
$ref = strlen($ref) < 10 ? 'index.php' : $ref;
header('Location: ' . $ref);
}
echo '<form action="index.php?' . $menu->get_complete() . '" method="POST">';
echo '<input type="text" size="15" name="shoutbox2_nickname" value="' . $shoutbox_VALUE_name . '" onFocus="if (value == \'' . $shoutbox_VALUE_name . '\') {value = \'\'}" onBlur="if (value == \'\') {value = \'' . $shoutbox_VALUE_name . '\'}" maxlength="15">';
echo '<br /><textarea style="width: 80%" cols="15" rows="2" name="shoutbox2_textarea"></textarea><br />';
echo get_antispam ('shoutbox2', 0);
echo '<input type="submit" value="' . $lang['formsub'] . '" name="shoutbox2_submit">';
echo '</form>';
}
echo '<table width="90%" class="border" cellpadding="2" cellspacing="1" border="0">';
$erg = db_query('SELECT * FROM `prefix_shoutbox2` ORDER BY id DESC LIMIT ' . (is_numeric($allgAr['sb_limit'])?$allgAr['sb_limit']:15));
$class = 'Cnorm';
while ($row = db_fetch_object($erg)) {
$class = ($class == 'Cmite' ? 'Cnorm' : 'Cmite');
echo '<tr class="' . $class . '"><td><b>' . $row->nickname . ':</b> ' . preg_replace('/([^s]{' . $allgAr['sb_maxwordlength'] . '})(?=[^s])/', "$1n", $row->textarea) . '</td></tr>';
}
echo '</table><a class="box" href="index.php?shoutbox2"><center><img src = http://www.fightersforgermany.de/include/images/icons/archiv.png alt="Archiv" border="0" /></a></center></a>';
} else {
// User
if (has_right($allgAr['sb_recht'])) {
if (!empty($_POST['shoutbox2_submit']) AND chk_antispam ('shoutbox2')) {
$shoutbox_nickname = escape($_POST['shoutbox2_nickname'], 'string');
$shoutbox_nickname = substr($shoutbox_nickname, 0, 15);
$shoutbox_textarea = escape($_POST['shoutbox2_textarea'], 'textarea');
$shoutbox_textarea = preg_replace("/[.?(url|b|i|u|img|code|quote)[^]]*?]/i", "", $shoutbox_textarea);
$shoutbox_textarea = strip_tags($shoutbox_textarea);
if (!empty($shoutbox_nickname) AND !empty($shoutbox_textarea)) {
db_query('INSERT INTO `prefix_shoutbox2` (`nickname`,`textarea`) VALUES ( "<font color=#FF9900>' . $shoutbox_nickname . '</font><br><small>' . date('d.m - H:i \U\h\r') . '</small>" , "<br>' . $shoutbox_textarea . '" ) ');
}
$ref = strstr($_SERVER['HTTP_REFERER'], 'index.php?');
$ref = strlen($ref) < 10 ? 'index.php' : $ref;
header('Location: ' . $ref);
}
echo '<form action="index.php?' . $menu->get_complete() . '" method="POST">';
echo '<input type="text" size="15" name="shoutbox2_nickname" value="' . $shoutbox_VALUE_name . '" onFocus="if (value == \'' . $shoutbox_VALUE_name . '\') {value = \'\'}" onBlur="if (value == \'\') {value = \'' . $shoutbox_VALUE_name . '\'}" maxlength="15">';
echo '<br /><textarea style="width: 80%" cols="15" rows="2" name="shoutbox2_textarea"></textarea><br />';
echo get_antispam ('shoutbox', 0);
echo '<input type="submit" value="' . $lang['formsub'] . '" name="shoutbox2_submit">';
echo '</form>';
}
echo '<table width="90%" class="border" cellpadding="2" cellspacing="1" border="0">';
$erg = db_query('SELECT * FROM `prefix_shoutbox2` ORDER BY id DESC LIMIT ' . (is_numeric($allgAr['sb_limit'])?$allgAr['sb_limit']:15));
$class = 'Cnorm';
while ($row = db_fetch_object($erg)) {
$class = ($class == 'Cmite' ? 'Cnorm' : 'Cmite');
echo '<tr class="' . $class . '"><td><b>' . $row->nickname . ':</b> ' . preg_replace('/([^s]{' . $allgAr['sb_maxwordlength'] . '})(?=[^s])/', "$1n", $row->textarea) . '</td></tr>';
}
echo '</table><a class="box" href="index.php?shoutbox2"><center><img src = http://www.fightersforgermany.de/include/images/icons/archiv.png alt="Archiv" border="0" /></a></center></a>';
}
?>
</center>
Du musst dazu natürlich noch eine 2. Tabelle in der Datenbank anlegen, dazu in phpmyadmin die ic?_shoutbox Tabelle ohne Daten exportieren (Senden abklicken) und den Code den du da erhälst als SQL ausführen, wobei du natürlich noch den Tabellennamen zu ic?_shoutbox2 ändern musst.
Weiter solltest du auch die contents/shoutbox.php kopieren, zu shoutbox2.php und dort dann auch die Tabellennamen und ggf. Links entsprechend ändern.
Wenn du sehen willst, was für Änderungen ich vorgenommen habe, benutzte ein Programm, wie WinMerge, dann erkennst du das bestimmt, ist nicht wirklich schwer.