get_col("DESC $wpdb->comments", 0) as $column) { if ($column == $column_name) { return true; } } $q = $wpdb->query("ALTER TABLE $wpdb->comments ADD COLUMN comment_reply_ID INT NOT NULL DEFAULT 0;"); foreach ($wpdb->get_col("DESC $wpdb->comments", 0) as $column) { if ($column == $column_name) { return true; } } return false; } function commentreply_load_scripts() { echo ''; } function add_reply_id_formfield() { echo ''; } function add_reply_ID($id) { global $wpdb; $reply_id = mysql_escape_string($_REQUEST['comment_reply_ID']); $q = $wpdb->query("UPDATE $wpdb->comments SET comment_reply_ID='$reply_id' WHERE comment_ID='$id'"); } // choose your comment comtemplate function change_comments_template($file) { return ABSPATH . "/wp-content/plugins/ajaxcomment/comments.php"; } function email_back($id) { global $wpdb, $email_send_comment; $reply_id = mysql_escape_string($_REQUEST['comment_reply_ID']); $post_id = mysql_escape_string($_REQUEST['comment_post_ID']); if ( $reply_id == 0 || ($_REQUEST["email"]!=get_settings('admin_email')) && !isset($_REQUEST['comment_email_back'])) return; $comment = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_ID='$id' LIMIT 0, 1"); $reply_comment = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_ID='$reply_id' LIMIT 0, 1"); $post = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE ID='$post_id' LIMIT 0, 1"); $comment = $comment[0]; $reply_comment = $reply_comment[0]; $post = $post[0]; $title = $post->post_title; $author = $reply_comment->comment_author; $url = get_permalink($post_id); $to = $reply_comment->comment_author_email; if ($to == "") return; $subject = "The author replied your comment at [".get_bloginfo()."]'".$title; $date = mysql2date('Y.m.d H:i', $reply_comment->comment_date); $message = "
Dear $author:
{$comment->comment_content}
{$reply_comment->comment_content}