Ảnh Minh Họa
Xin chào các bạn !!! Hôm nay mình quyết định sẽ hướng dẫn các bạn một thủ thuật nhỏ có thể làm cho Blog của bạn đẹp hơn đó chính là ẩn các từ ngữ thô tục - tục tĩu khi bình luận thành dạng ***** và đương nhiên nếu trang của bạn có một độ load không ổn định thì các bình luận dạng tục tĩu đó vẫn sẽ hiển thị ở lúc load trang. Không nói dài dòng nữa vào vấn đề chính nè !!!Để làm được như thế bạn chỉ cần thêm đoạn Javascript sau vào trước thẻ đóng </body> nhé :
<script type='text/javascript'>Vậy là xong chúc các bạn thành công !!!
//<![CDATA[
function replaceText(){if(!document.getElementById){return;}
bodyText = document.getElementById("comment-holder");
theText = bodyText.innerHTML;
theText = theText.replace(/\[img\].*?'.*?\[\/img\]/gi, "");
theText = theText.replace(/\[nct\].*?'.*?\[\/nct\]/gi, "");
theText = theText.replace(/\[youtube\].*?'.*?\[\/youtube\]/gi, "");
theText = theText.replace(/\[img\]/gi, "<a href='");
theText = theText.replace(/\[\/img\]/gi, "'>Xem ảnh</a>");
theText = theText.replace(/\[youtube\]https:\/\/youtu.be/gi, "<iframe width='480' height='390' src='https://www.youtube.com/embed");
theText = theText.replace(/\[youtube\]https:\/\/www.youtube.com\/watch\?v=/gi, "<iframe width='480' height='390' src='https://www.youtube.com/embed/");
theText = theText.replace(/&feature=/gi, "?rel=0' '");
theText = theText.replace(/\[\/youtube\]/gi, "?rel=0' frameborder='0' allowfullscreen></iframe>");
theText = theText.replace(/\[nct\]http:\/\/www.nhaccuatui.com\/nghe\?L=/gi, "<div style='overflow:hidden'><embed style='margin-top:-250px;width:300px;height:400px' src='http://www.nhaccuatui.com/l/");
theText = theText.replace(/\[nct\]http:\/\/www.nhaccuatui.com\/nghe\?M=/gi, "<div style='overflow:hidden'><embed style='margin-top:-350px;width:300px;height:400px' src='http://www.nhaccuatui.com/m/");
theText = theText.replace(/\[\/nct\]/gi, "' quality='high' wmode='transparent' type='application/x-shockwave-flash'></embed></div>");
theText = theText.replace(/:\)/gi, "<img class='starnhanit_emoticon' src='https://i.imgur.com/ChuzkwA.png'/>");
theText = theText.replace(/=\)/gi, "<img class='starnhanit_emoticon' src='https://i.imgur.com/csnz5ec.png'/>");
theText = theText.replace(/:\(/gi, "<img class='starnhanit_emoticon' src='https://i.imgur.com/sJKPKNL.png'/>");
theText = theText.replace(/:D/gi, "<img class='starnhanit_emoticon' src='https://i.imgur.com/jByThCS.png'/>");
theText = theText.replace(/:v/gi, "<img class='starnhanit_emoticon' src='https://i.imgur.com/yvUDfPP.png'/>");
theText = theText.replace(/<3/gi, "<img class='starnhanit_emoticon' src='https://i.imgur.com/yW9iN6j.png'/>");
theText = theText.replace(/;\)/gi, "<img class='starnhanit_emoticon' src='https://i.imgur.com/pYDVCDW.png'/>");
theText = theText.replace(/\^_\^/gi, "<img class='starnhanit_emoticon' src='https://i.imgur.com/kNnsdmT.png'/>");
theText = theText.replace(/:\(\(/gi, "<img class='starnhanit_emoticon' src='https://i.imgur.com/bUJjry0.png'/>");
theText = theText.replace(/\(y\)/gi, "<img class='starnhanit_emoticon' src='https://i.imgur.com/79F88wK.png'/>");
theText = theText.replace(/đụ mạ/gi, "****");
theText = theText.replace(/địt mẹ/gi, "****");
theText = theText.replace(/lồn/gi, "****");
theText = theText.replace(/lồ n/gi, "****");
theText = theText.replace(/l ồn/gi, "****");
theText = theText.replace(/đụmạ/gi, "****");
theText = theText.replace(/đ ụ mạ/gi, "****");
theText = theText.replace(/đụ m ạ/gi, "****");
theText = theText.replace(/đ ụ m ạ/gi, "****");
theText = theText.replace(/đụ/gi, "****");
theText = theText.replace(/cặc/gi, "****");
theText = theText.replace(/cặ c/gi, "****");
theText = theText.replace(/c ặc/gi, "****");
theText = theText.replace(/c ặ c/gi, "****");
bodyText.innerHTML = theText;
}replaceText();
//]]>
</script>
18 Nhận xét:
Chống khứa Tính Nhảm là quá hay
lúc 04:59 4 tháng 2, 2018:))
lúc 05:07 4 tháng 2, 2018Test.
lúc 06:54 4 tháng 2, 2018Đụ má mày
Ôh hay
lúc 06:55 4 tháng 2, 2018:)) Test trực tiếp :v
lúc 15:47 4 tháng 2, 2018test [ đụ má ]
lúc 20:41 4 tháng 2, 2018Địt
lúc 20:41 4 tháng 2, 2018=)) Địt mẹ mày. Đoụ má mày =)))
lúc 20:41 4 tháng 2, 2018Người có văn hóa chắc không cần cái này
lúc 02:11 5 tháng 2, 2018đ ị t m ẹ m à y
lúc 03:17 5 tháng 2, 2018:V Cái này mới
lúc 03:23 5 tháng 2, 2018=))) hay
lúc 03:23 5 tháng 2, 2018Cũng phòng trc :))
lúc 03:36 5 tháng 2, 2018Chất đấy :V
lúc 03:45 5 tháng 2, 2018:)) CMT thử 1 chữ tục test xem nào ?
lúc 03:46 5 tháng 2, 2018Là bác kêu em đấy nhé :V
lúc 03:48 5 tháng 2, 2018Đụ Mạ :V
lúc 03:48 5 tháng 2, 2018:v che rồi
lúc 03:51 5 tháng 2, 2018Emoticon