$name_san = cmtx_sanitize($name); $email_san = cmtx_sanitize($email); $website_san = cmtx_url_encode_spaces($website); $website_san = cmtx_sanitize($website_san); $town_san = cmtx_sanitize($town); $country_san = cmtx_sanitize($country); $rating_san = cmtx_sanitize($rating); $comment_san = cmtx_sanitize($comment, false, true); $reply_san = cmtx_sanitize($reply, false, true); $page_id_san = cmtx_sanitize($page_id); $reply_to_san = cmtx_sanitize($reply_to); $is_approved_san = cmtx_sanitize($is_approved); $is_sticky_san = cmtx_sanitize($is_sticky); $is_locked_san = cmtx_sanitize($is_locked); if (!$is_approved) { cmtx_unapprove_replies($id); } if (isset($_POST['send']) && $_POST['send'] == "1") { cmtx_notify_subscribers($name, $comment, $id, $page_id); $is_approved_san = "1"; } if (isset($_POST['verify'])) { cmtx_db_query("UPDATE `" . $cmtx_mysql_table_prefix . "comments` SET `reports` = '0' WHERE `id` = '{$id_san}'"); cmtx_db_query("UPDATE `" . $cmtx_mysql_table_prefix . "comments` SET `is_verified` = '1' WHERE `id` = '{$id_san}'"); $is_approved_san = "1"; } cmtx_db_query("UPDATE `" . $cmtx_mysql_table_prefix . "comments` SET `name` = '{$name_san}' WHERE `id` = '{$id_san}'"); cmtx_db_query("UPDATE `" . $cmtx_mysql_table_prefix . "comments` SET `email` = '{$email_san}' WHERE `id` = '{$id_san}'"); cmtx_db_query("UPDATE `" . $cmtx_mysql_table_prefix . "comments` SET `website` = '{$website_san}' WHERE `id` = '{$id_san}'"); cmtx_db_query("UPDATE `" . $cmtx_mysql_table_prefix . "comments` SET `town` = '{$town_san}' WHERE `id` = '{$id_san}'"); cmtx_db_query("UPDATE `" . $cmtx_mysql_table_prefix . "comments` SET `country` = '{$country_san}' WHERE `id` = '{$id_san}'");
function cmtx_unapprove_replies($id) { //unapprove replies of given comment global $cmtx_mysql_table_prefix; $query = cmtx_db_query("SELECT * FROM `" . $cmtx_mysql_table_prefix . "comments` WHERE `reply_to` = '{$id}'"); while ($comments = cmtx_db_fetch_assoc($query)) { $id = $comments['id']; cmtx_db_query("UPDATE `" . $cmtx_mysql_table_prefix . "comments` SET `is_approved` = '0' WHERE `id` = '{$id}'"); cmtx_unapprove_replies($id); } }