Ả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
Test.
Đụ má mày
Ôh hay
test [ đụ má ]
Địt
=)) Địt mẹ mày. Đoụ má mày =)))
Người có văn hóa chắc không cần cái này
đ ị t m ẹ m à y
:V Cái này mới
=))) hay
Cũng phòng trc
)
Chất đấy :V
Là bác kêu em đấy nhé :V
Đụ Mạ :V
:v che rồi
Emoticon