include $cfg[path]."inc/ebb.inc.php4";
$tmpl_reply = precache("tmpl_reply");
$tmpl_replyprev = precache("tmpl_replyprev");
if(!$userstatus)
{
ebb_err("Zuerst Registrieren/einloggen ... :D");
}
$tdata = mysql_query("SELECT threadname,boardid,status FROM ebb_threads WHERE id='$id'");
if(!list($threadname,$boardid,$tstat) = mysql_fetch_row($tdata)) {
ebb_err("Thread existiert nicht!");
}
if($tstat == 2 || $tstat == 0) {
ebb_err("Dieser Thread wurde geschlossen.");
}
$bdata = mysql_query("SELECT name,forum FROM ebb_boards WHERE id='$boardid'");
list($boardname,$forumid) = mysql_fetch_row($bdata);
$cdata = mysql_query("SELECT name FROM ebb_forums WHERE id='$forumid'");
list($forumname) = mysql_fetch_row($cdata);
forum_styles($forumid);
if (!$write)
{
$hirachie = hp(
array($forumname,$boardname,$threadname,"Antwort erstellen"),
array("forum.php4?id=$forumid","board.php4?id=$boardid","$PHP_SELF?id=$id")
);
eval ("echo \"$tmpl_header\";");
eval ("echo \"$tmpl_reply\";");
eval ("echo \"$tmpl_footer\";");
}
else
{
if(!$bodytext)
{
ebb_err("Ohne Text wird das nichts ;) !");
}
$ttime = time();
if($signatur == "yes") {
$sig = 1;
} else {
$sig = 0;
}
if($email == "yes") {
$email = 1;
} else {
$email = 0;
}
// board updaten!
mysql_query("UPDATE ebb_boards SET posts=posts+1,lastmodified='$ttime' WHERE id='$boardid'");
// thread updaten!
mysql_query("UPDATE ebb_threads SET lastreply='$ttime',replies=replies+1 WHERE id='$id'");
// posting einfügen!
mysql_query("INSERT INTO ebb_posts VALUES('','$id','$user[id]','$ttime','$bodytext','$email','$sig')");
// user-postings +1
mysql_query("UPDATE ebb_user SET posts=posts+1 WHERE id='$user[id]'");
/*
if($cfg[emailoptions] == 1) {
$emailaddresses = mysql_query("SELECT DISTINCT ebb_user.email FROM ebb_user,ebb_posts WHERE ebb_posts.threadid='$id' AND notify='1' AND ebb_posts.author=ebb_user.id");
echo mysql_error();
while($emailaddresses = mysql_fetch_array($emailaddresses)) {
mail("$emailaddresses[0]","New reply at $cfg[name]","Hallo!\n\nIm Topic \"$threadname\" gibt es eine neue Antwort!\n$syscfg[path]thread.php4?id=$id","From: \"$cfg[name] Mailer\" <$cfg[webmaster_mail]>");
}
}
*/
if($smilies == "yes") {
$bodytext = codeparse($bodytext,1,1,1,1);
} else {
$bodytext = codeparse($bodytext,1,1,1,1);
}
$bodytext = stripslashes($bodytext);
eval ("echo \"$tmpl_header\";");
eval ("echo \"$tmpl_replyprev\";");
eval ("echo \"$tmpl_footer\";");
}
?>