include "forum.ini";
if(chop($name)=="" || chop($topic)=="" || chop($body)==""){
if($postit==1){
$isError = true;
}
else{
$isError = false;
}
include "header.inc";
echo "
\n";
include "form.inc";
echo "\n";
include "footer.inc";
}
else{
if($Censor==1){
$blurb = "@!#$";
$sSQL = "Select * from profan";
$nProfan = mysql ( $sDB, $sSQL );
if ( $nProfan > 0 ){
$nRows = mysql_NumRows ( $nProfan );
if ( $nRows > 0 ){
$a=0;
While($a<$nRows){
$sWord = mysql_result ( $nProfan, $a, "word" );
$name = eregi_replace( $sWord, $blurb, $name );
$topic = eregi_replace( $sWord, $blurb, $topic );
$email = eregi_replace( $sWord, $blurb, $email );
$body = eregi_replace( $sWord, $blurb, $body );
$a++;
}
}
}
}
if(!eregi(".+@.+\\..+", $email)){
$email="";
}
if($MagicQuotes!=1){
$name = addslashes($name);
$email = addslashes($email);
$topic = addslashes($topic);
$body = addslashes($body);
}
$date = date("Y-m-d H:i:s");
$host = getenv('REMOTE_HOST');
$host = @GetHostByAddr($host);
$name = htmlspecialchars($name);
$email = htmlspecialchars($email);
$topic = htmlspecialchars($topic);
$body = htmlspecialchars($body);
if($UseCookies==1){
if((!IsSet($$cNameVar)) || ($$cNameVar != $name)) {
SetCookie("$cNameVar",$name,time()+ 31536000);
}
if((!IsSet($$cEmailVar)) || ($$cEmailVar != $email)) {
SetCookie("$cEmailVar",$email,time()+ 31536000);
}
}
$sSQL = "Insert Into $sTable (name, email, datestamp, topic, body, host, thread) values ('$name', '$email', '$date', '$topic', '$body', '$host', $thread)";
if(eregi(".+@.+\\..+", $Moderator)){
mail($Moderator, stripslashes($topic), stripslashes($body), "From: Phorum <$Moderator>");
}
$nResult = mysql_db_query ( $sDB, $sSQL, $nConnection );
$sUSQL = "Update $sTable set thread=id where thread = 0";
$nUResult = mysql_db_query ( $sDB, $sUSQL, $nConnection );
if($nResult==0){
echo "$nResult - $sSQL";
}
else{
Header ("Location: index.php3");
}
}
?>