PHP-Code:
<head>
<style type="text/css">
.smileys {
width:480px;
}
</style>
<script language="JavaScript">
function addValue(text)
{
document.Shoutbox.Eintrag.value = document.Shoutbox.Eintrag.value + text;
}
</script>
</head>
<? head ('Shoutbox'); ?>
<?php
include 'module/Shoutbox/files/inc/functions.inc.php';
if(get_magic_quotes_gpc()) {
array_stripslashes($_GET);
array_stripslashes($_POST);
array_stripslashes($_COOKIE);
}
$uid_finden = db_query("Select * FROM ".$db_prefix."_userdaten where uid = ".$_SESSION['uid'].""); // UID in der Datenbank finden
$nick = @mysql_fetch_array($uid_finden); // Zugehörigen Nicknamen aufrufen
$admin_auslesen = db_query("Select * FROM ".$db_prefix."_shoutbox_admin");
$style_auslesen = db_query("Select * FROM ".$db_prefix."_shoutbox_style");
$smileys_auslesen = db_query("Select * FROM ".$db_prefix."_shoutbox_smileys");
$admin = mysql_fetch_assoc ($admin_auslesen);
$style = mysql_fetch_assoc ($style_auslesen);
if ($_GET['Eintraege'] != "alt")
{
echo ('<center>
<iframe src="module/Shoutbox/ausgabe.php" height="'.$style['iframe_height'].'" width="'.$style['iframe_width'].'" scrolling="'.$style['iframe_scrolling'].'" frameborder="'.$style['iframe_frameborder'].'"></iframe>');
} else {
echo ('<iframe src="module/Shoutbox/ausgabe.php?Eintraege=alt" height="'.$style['iframe_height'].'" width="'.$style['iframe_width'].'" scrolling="'.$style['iframe_scrolling'].'" frameborder="'.$style['iframe_frameborder'].'"></iframe></center>');
}
if ($_GET['Eintraege'] != 'alt'){
if ($admin['Gaeste'] == 'ja')
if (trim ($nick) == ""){
$nick['nickname'] = "Gast";
echo ("
<br />
<form name=\"Shoutbox\" method=\"post\" action=\"\">
<input name=\"Eintrag\" type=\"text\" size=\"65\" maxlength=\"".$admin['max_nachricht']."\" />
<input name=\"Submit\" type=\"submit\" value=\"Eintragen\" />
</form>
");
} elseif (trim ($nick) != "") {
echo ("
<br />
<form name=\"Shoutbox\" method=\"post\" action=\"\">
<input name=\"Eintrag\" type=\"text\" size=\"65\" maxlength=\"".$admin['max_nachricht']."\" />
<input name=\"Submit\" type=\"submit\" value=\"Eintragen\" />
</form>
");
}
if ($admin['Gaeste'] == 'nein') {
if (trim ($nick) != ""){
echo ("
<br />
<form name=\"Shoutbox\" method=\"post\" action=\"\">
<input name=\"Eintrag\" type=\"text\" size=\"65\" maxlength=\"".$admin['max_nachricht']."\" />
<input name=\"Submit\" type=\"submit\" value=\"Eintragen\" />
</form>
");
}
}
}
# Abfragen ob abgeschickt wurde (Das wusste ich auch noch xD)
if ($_POST['Submit'] == 'Eintragen'){
if (trim ($_POST['Eintrag']) != "" and strlen ($_POST['Eintrag']) > $admin['min_nachricht']){
# Time ist kein String sondern integer, deshalb da keine '' (THX an Gremlin)
mysql_query ("INSERT INTO ".$db_prefix."_shoutbox (Inhalt, Nickname, Datum) VALUES ('".addslashes(htmlspecialchars($_POST['Eintrag']))."', '".$nick['nickname']."', ".time().")");
if ($admin['bez_sb'] == 'ja' && $_SESSION['login'] == 'true') {
$reload_db = db_query ("SELECT * FROM ".$db_prefix."_shoutbox_reload WHERE Reload >= ".time()." AND UID = ".$_SESSION['uid']."");
if (!mysql_num_rows ($reload_db)) {
kontobuchung ('+', $admin['bez_verguetung'], $_SESSION['uid']);
db_query ("INSERT INTO ".$db_prefix."_shoutbox_reload SET Reload = ".(time() + $admin['bez_reload']).", UID = ".$_SESSION['uid']."");
}
db_query ("DELETE FROM ".$db_prefix."_shoutbox_reload WHERE Reload <= ".time()."");
}
# Wenn vorhanden dann Fehlermeldung ausgeben: (THX an Gremlin)
if (mysql_error()) echo mysql_error();
# wo db_connect(); da muss auch db_close(); hin ;) (THX an Gremlin)
mysql_close() or die(mysql_error());
} else {
echo "Fehler: Die eingegebene Nachricht ist zu kurz.<br /><br />";
}
}
if ($_GET['Eintraege'] == 'alt'){
echo "<br /><br /><strong><center><a href=\"javascript:history.back()\">Neue Einträge anzeigen</a></center><br /></strong>";
} else {
echo "<strong><center><a href=\"?Eintraege=alt\">Alte Einträge anzeigen</a></center><br /></strong>";
}
if ($_GET['Eintraege'] != 'alt'){
if (trim ($nick) != ""){
if(mysql_num_rows($smileys_auslesen)) {
echo "<div class=\"smileys\">";
while($row = mysql_fetch_assoc($smileys_auslesen)) {
echo "<a href=\"javascript:;\"><img src=\"module/Shoutbox/files/smileys/".$row['img_src']."\" border=\"0\" onclick=\"addValue('".$row['img_short']."')\" /></a> ";
}
echo "</div>";
}
}
}
// You can add everything here (e.g. "All rights reserved by YourSite.com") but it's strongly restricted to change or remove the Copyright!
// Begin Copyrigt
include "copyright.php";
// End Copyrigt
foot ();
?>
<a href="" onClick="history.back()">