Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- /* Copy this script into the footer of your template at the very bottom of your blog, but before the ending body tag. */
- jQuery("li.comment article.contain").each(function (index, comment) {
- var up = parseInt(jQuery(".rating-icons :nth-child(2)", comment).text(), 10);
- var down = parseInt(jQuery(".rating-icons :nth-child(4)", comment).text(), 10);
- var id = jQuery(comment).attr('id');
- /* This checks under which condition a comment should be hidden. In this example:
- * down >= up + 2 Hide a comment when there are at least two more down votes than up votes
- * down >= 3 and there are at least three downvotes in total. Both must be true.
- * Adjust this to taste. */
- if (down >= up + 2 && down >= 3) {
- jQuery('<div id="'+id+'-hider"><a href="#" style="display: block; text-decoration: none; color: #989eae; background-color: #111; border: 1px solid #444855; border-top-left-radius: 7px; border-bottom-left-radius: 7px; padding: 5px 0 5px 1em; box-sizing: border-box; width: 100%;" onclick="'+ "jQuery('#"+id+"-hider').css('display', 'none');jQuery('#"+id+"').css('display', 'block');return false;" +'">Comment hidden.</a></p>').insertBefore("#"+id);
- jQuery(comment).css("display", "none");
- }
- });
- </script>
Add Comment
Please, Sign In to add comment