Follow Me

Banned Blogger Commentators with jQuery

Banned Blogger Commentators with jQuery
Banned Blogger Commentators with jQuery - There are several reasons you want to ban comments from a blogger who often sends comments that are considered unethical, abusive, defamatory or contain SARA and of course the comments are not good to display.

Poor comments to display include:

Comments containing SARA: Can offend an individual, group / group, religion, or discrimination against a particular culture.

Comments containing SPAM: It is common for bloggers to comment on a link in the form of a link, hoping that someone will visit the link included in the comment.

To avoid these things, you need to enter certain code into the blog template.

Here's how to apply it:

The first way with jQuery

1. Open Blogger> Template> Edit HTML> Add the code below before </body>

<script type='text/javascript'>
//<![CDATA[
var spamlist=[
'http://www.blogger.com/profile/123456789xxx', /* sample commentator URL */
'http://you_blog.blogspot.com/',
'The commentator's URL address is 3' /* The last URL does not need to be given a comma */
];
for(var v=0; v<spamlist.length; v=v+1){
$("a[href='"+spamlist[v]+"']").each(function(){
$(this).closest(".comment-block").find(".comment-content")
.replaceWith("<div class='comment-content' style='color:red'>You have been banned! Please leave this blog!</div>"),
$(this).replaceWith("<span style='color:red'>BANNED USER!</span>");
})
}
//]]>
</script>

For those who use templates with a hack comment system, you can use this code

<script type='text/javascript'>
//<![CDATA[
var spamlist=[
'http://www.blogger.com/profile/123456789xxx', /* sample commentator URL */
'http://you_blog.blogspot.com/',
'The commentator's URL address is 3' /* The last URL does not need to be given a comma */
];
for(var v=0; v<spamlist.length; v=v+1){
$("a[href='"+spamlist[v]+"']").each(function(){
$(this).closest(".comment_inner").find(".comment_body")
.replaceWith("<div class='.comment_body' style='color:red'>You have been banned! Please leave this blog!</div>"),
$(this).replaceWith("<span style='color:red'>BANNED USER!</span>");
})
}
//]]>
</script>

2. Save the template.

The second way with a Conditional Tag
This method only applies to the Threaded Comment Hack system
1. Open Blogger> Template> Edit HTML> Search for the code below

<b:loop values​​='data:post.comments' var='comments'>


Then add this code below it

<!--blacklist-->
<b:if cond='data:comment.authorUrl != &quot;http://www.blogger.com/profile/12345678910&quot;'>
<!--blacklist-->

Replace http://www.blogger.com/profile/12345678910 with the URL that will be banned. After that, look for the code </b:loop>, add this code on it:

<!-blacklist->
  </ b: if>
<!-blacklist->

2. Save the template.

Good luck.
Next Post Previous Post
No Comment
Add Comment
comment url