2014-06-05, 05:39 PM
Guys is this the correct way to check if the title is matching message?
Also why it doesn't work with quick reply???
Please help me with this code?
Also why it doesn't work with quick reply???
Please help me with this code?
function nosubjectpost(&$post)
{
global $mybb, $db;
$msgmessage = $post->data['message'];
$msgsubject = $post->data['subject'];
if($msgsubject == $msgmessage)
{
$post->set_error('ERROR - works');
}
$script = basename($_SERVER["SCRIPT_FILENAME"]);
if ($script == 'editpost.php' || $script == 'xmlhttp.php') {
$query = $db->simple_select("threads", "*", "`firstpost`=".intval($_GET['pid']));
$thepost = $db->fetch_array($query);
if (!empty($thepost)) {
$firstpost = true;
}
}
if (($script == 'editpost.php' && $firstpost)) {
if($msgsubject == $msgmessage)
{
$post->set_error('ERROR - works');
}
}
if (($script == 'xmlhttp.php' && $firstpost)) {
if($msgsubject == $msgmessage) {
$post->set_error('ERROR - works');
}
}
}