By
at
On July 24, 2011
Origanlly by: Wisnu Hartanto
Tips to put smiley icon on your blog not only to customize your comment box but also your blog.post.
1. Go to Design > edit HTML > Expand Widget Templates
then under this code ]]></b:skin> (press Ctrl+F on your keyboard to find it easily, then will appear search box, just paste and find ]]></b:skin> )
2. After found it, just copy the greeny addsmileyJs below under code ]]></b:skin>
<script src='http://www.freewebtown.com/indopolitik/Script_blog/addSmiley.js' type='text/javascript'/>
3. Then click save template, it will auto appear on your blog.post or comment box when you write special character as shown below.
Special command list character for Smiley Icon Kaskus:
:) or :-) result
:D or :-D result
:$ or :-$ result
:( or :-( result
:p or :-p result
;) or ;-) result
:k or :-k result
:@ or :-@ result
:# or :-# result
:x or :-x result
:o or :-o result
If the greeny Js code above didn't work and has crashed with your template, you can add it manual into your blogger templates itself. To solve error on smiley icon, Copy and paste all the script listed on box below exactly under </body>
<script type='text/javascript'>
//<![CDATA[
document.getElementsByClassName = function(clsName){
var retVal = new Array();
var elements = document.getElementsByTagName("*");
for(var i = 0;i < elements.length;i++){
if(elements[i].className.indexOf(" ") >= 0){
var classes = elements[i].className.split(" ");
for(var j = 0;j < classes.length;j++){
if(classes[j] == clsName)
retVal.push(elements[i]);
}
}
else if(elements[i].className == clsName)
retVal.push(elements[i]);
}
return retVal;
}
function addSmiley(){
var postBodyClass = (postBodyClass) ? postBodyClass : 'post-body';
var d = document.getElementsByClassName(postBodyClass);
for(var i=0;i<d.length;i++){
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\)/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/005.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s;-*\)/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/001.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\$/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/1.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\(/g, ' <img src="http://www.kaskus.us/images/smilies/berduka.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*D/g, ' <img src="http://www.kaskus.us/images/smilies/ngakak.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*p/g, '<img src="http://www.kaskus.us/images/smilies/sumbangan/6.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*k/g, ' <img src="http://www.kaskus.us/images/smilies/s_sm_maho.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\@/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/8.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\#/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/5.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*x/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/7.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*o/g, ' <img src="http://www.kaskus.us/images/smilies/I-Luv-Indonesia.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
}
var d = document.getElementsByClassName('comment-body');
for(var i=0;i<d.length;i++){
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\)/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/005.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s;-*\)/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/001.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\$/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/1.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\(/g, ' <img src="http://www.kaskus.us/images/smilies/berduka.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*D/g, ' <img src="http://www.kaskus.us/images/smilies/ngakak.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*p/g, '<img src="http://www.kaskus.us/images/smilies/sumbangan/6.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*k/g, ' <img src="http://www.kaskus.us/images/smilies/s_sm_maho.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\@/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/8.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\#/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/5.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*x/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/7.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*o/g, ' <img src="http://www.kaskus.us/images/smilies/I-Luv-Indonesia.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
}
var d = document.getElementsByClassName('comment-body-author');
for(var i=0;i<d.length;i++){
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\)/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/005.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s;-*\)/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/001.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\$/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/1.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\(/g, ' <img src="http://www.kaskus.us/images/smilies/berduka.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*D/g, ' <img src="http://www.kaskus.us/images/smilies/ngakak.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*p/g, '<img src="http://www.kaskus.us/images/smilies/sumbangan/6.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*k/g, ' <img src="http://www.kaskus.us/images/smilies/s_sm_maho.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\@/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/8.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\#/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/5.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*x/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/7.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*o/g, ' <img src="http://www.kaskus.us/images/smilies/I-Luv-Indonesia.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
}
var d = document.getElementsByClassName('widget-content');
for(var i=0;i<d.length;i++){
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\)/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/005.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s;-*\)/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/001.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\$/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/1.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\(/g, ' <img src="http://www.kaskus.us/images/smilies/berduka.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*D/g, ' <img src="http://www.kaskus.us/images/smilies/ngakak.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*p/g, '<img src="http://www.kaskus.us/images/smilies/sumbangan/6.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*k/g, ' <img src="http://www.kaskus.us/images/smilies/s_sm_maho.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\@/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/8.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*\#/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/5.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*x/g, ' <img src="http://www.kaskus.us/images/smilies/sumbangan/7.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
d[i].innerHTML = d[i].innerHTML.replace(/\s:-*o/g, ' <img src="http://www.kaskus.us/images/smilies/I-Luv-Indonesia.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
}
}
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}
addLoadEvent(addSmiley);
//]]>
</script>
Hope its works. If still crash and not work, you can check and analyze your script code on comment-body, comment-body-author, dan widget-content manually. Now i dont use this smiley icon because it has made my blog running slow. When you interested and search tips for smiley icon. You can try it on your blog, hope this article helping you.
wisnuku.blogspot.com
Rate:
Dont have comment yet for: "Cara pasang Smiley Icon Kaskus di Blogger"
Post a Comment