Talking about how to enable the nested comment problem after mail to commenter

Source: Internet
Author: User
Keywords Mail notification

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

Mail to commenter (MTC) is a very useful comment reply Email notification plug-ins, many blog sites are using this plug-in to implement the Comment mail notification function.

In the process of using this plug-in, most of the failures are focused on the issue of not sending mail.

In fact, the problem can not send mail is better resolved, as long as the confirmation host can use the SMTP service, and installed the Configure SMTP plug-in, basic can normally send mail.

Installation method See: Http://robin.sh/html/4_wp-plugin.html

Secondly, as long as the requirements of MTC, in the reply to the correct use of @+user format.

On the use of mail to commenter, there are too many textbooks on the internet. The Niang is everywhere, here no longer tired to describe.

In addition to the inability to send mail, MTC's biggest problem is the use of Wordpress (hereinafter referred to as WP) the default comment nested function is invalid.

The reason: MTC's comment button does not contain nested code, so once you use the MTC code to replace WP's comment button code, then the comments can not be nested.

There are few posts on the Internet to solve this problem, so Robin shares the solution to this problem:

1. Install and enable the MTC plugin

2. Find Get_comment_reply_link in comment-template.php file, navigate to method: function Get_comment_reply_link

3. Add a section of code to the Get_comment_reply_link method, as shown in line 2nd to 21st:

Function Get_comment_reply_link ($args = Array (), $comment = null, $post = null) {
//add by Robin Start
Global $comment;
$options = get_option (' mailtocommenter_options ');
$name = $comment->comment_author;
$comment _id = $comment->comment_id;
$value = Mailtocommenter_generate_name ($name);
if ($options [' button_content '] = = "Hyperlink") {
$value = "<a href=\ #comment-$comment _id\" > $value </a > ";
}elseif ($options [' button_content '] = = "Atreply") {
$value = substr ($value, 1);
$value = "@<a href=\" # comment-$comment _id\ "> $value </a>";
}elseif ($options [' button_content '] = = "Plain text") {
$value = "$value";
} else{
$value = <!--$value-->;
}
$value = Htmlspecialchars ($value);
$title = $options [' Button_title '];
$display = mailtocommenter_button_html ();
//add by Robin end
Global $user _id

4. Or in the Get_comment_reply_link method, find the line $link = "<a class= ' Comment-reply-link," replaced by the following code:

$link = "<a class= ' Comment-reply-link ' href=\" #commentform \ "onclick=\" Addcomment.moveform (' comment-'). get_ COMMENT_ID (). "','" . GET_COMMENT_ID (). "', ' respond ', '". $post->id; document.getElementById (' comment '). Value + = ' {$value} '; \ ">{$display}</a>";

Completing the steps above solves the problem of not commenting on nesting after you enable the MTC button.

This writer, Robin, comes from http://robin.sh

Reprint please indicate the link!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.