$count++; } if ($SETTINGS->enableCaptcha) { if (!PhpCaptcha::Validate($code)) { $code_error = true; $count++; } } if ($count == 0) { $MW_COMMENT->prefix = $database['prefix']; $MW_COMMENT->date = date($SETTINGS->dateformat, strtotime("" . $SETTINGS->timeOffset . " hours")); // Add comments.. $MW_COMMENT->add_comment_sql($_POST, $name, $comments, $email); // Send notification to webmaster if enabled.. if ($BLOG->notify) { $MW_MAIL->addTag('{BLOGTITLE}', $BLOG->title); $MW_MAIL->addTag('{BLOGURL}', $SETTINGS->modR ? $SETTINGS->w_path . '/blog/' . $id . '/' . addTitleToUrl(cleanData($BLOG->title)) . '.html' : $SETTINGS->w_path . '/index.php?cmd=blog&post=' . $id); $MW_MAIL->addTag('{COMMENTS}', $comments); $MW_MAIL->addTag('{VISITOR}', $name); $MW_MAIL->addTag('{EMAIL}', $email); $MW_MAIL->addTag('{IP}', $_SERVER['REMOTE_ADDR']); $MW_MAIL->addTag('{DATE}', date($SETTINGS->dateformat, strtotime("" . $SETTINGS->timeOffset . " hours"))); $MW_MAIL->addTag('{SITEPATH}', $SETTINGS->w_path); $MW_MAIL->sendMail($SETTINGS->name, $SETTINGS->email, $name, $email, '[' . $SETTINGS->website . '] ' . $msg_viewblog5, $MW_MAIL->template('themes/email/notification.txt')); } // Reload to blog page.. $url = $SETTINGS->modR ? $SETTINGS->w_path . '/blog/' . $id . '/' . addTitleToUrl(cleanData($BLOG->title)) . '.html' : $SETTINGS->w_path . '/index.php?cmd=blog&post=' . $id; header("Location: {$url}"); exit; } }