Como poner emoticones en los comentarios

0
Si quieres añadir emoticonos para los comentarios de tu blog de blogspot debes hacer lo siguiente:





Nota: Actualmente hay en plantillas que no funciona por algún script o modificación en las plantillas. Estoy tratando de buscar una mejor opción. Lamento las molestias ocasionadas. De todas formas pruébalo porque en tu blog puede funcionar sin problemas.



1)
Vamos a Diseño2) Edición de HTML -> Marcamos la casilla "expandir artilugios".
3) Buscamos el código </head> (tecleamos Ctrl + F para buscar más rápido)
4) Antes de </head> pegamos el siguiente código:


<!-- (Script Emoticones) -->
<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(/:-)/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon0.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
        d[i].innerHTML = d[i].innerHTML.replace(/:-S/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon1.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
        d[i].innerHTML = d[i].innerHTML.replace(/:-P/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon2.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
        d[i].innerHTML = d[i].innerHTML.replace(/:-[/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon3.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
        d[i].innerHTML = d[i].innerHTML.replace(/:-D/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon4.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
        d[i].innerHTML = d[i].innerHTML.replace(/}:-]/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon5.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
        d[i].innerHTML = d[i].innerHTML.replace(/x*/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon6.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
        d[i].innerHTML = d[i].innerHTML.replace(/;-D/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon7.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
        d[i].innerHTML = d[i].innerHTML.replace(/:-|/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon8.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
        d[i].innerHTML = d[i].innerHTML.replace(/:-}/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon9.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
        d[i].innerHTML = d[i].innerHTML.replace(/:*)/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon10.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
      d[i].innerHTML = d[i].innerHTML.replace(/:-(/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon11.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
      d[i].innerHTML = d[i].innerHTML.replace(/;-)/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon12.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
      d[i].innerHTML = d[i].innerHTML.replace(/XD/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon13.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(/:-)/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon0.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
        d[i].innerHTML = d[i].innerHTML.replace(/:-S/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon1.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
        d[i].innerHTML = d[i].innerHTML.replace(/:-P/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon2.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
        d[i].innerHTML = d[i].innerHTML.replace(/:-[/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon3.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
        d[i].innerHTML = d[i].innerHTML.replace(/:-D/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon4.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
        d[i].innerHTML = d[i].innerHTML.replace(/}:-]/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon5.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
        d[i].innerHTML = d[i].innerHTML.replace(/x*/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon6.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
        d[i].innerHTML = d[i].innerHTML.replace(/;-D/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon7.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
        d[i].innerHTML = d[i].innerHTML.replace(/:-|/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon8.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
        d[i].innerHTML = d[i].innerHTML.replace(/:-}/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon9.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
        d[i].innerHTML = d[i].innerHTML.replace(/:*)/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon10.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
      d[i].innerHTML = d[i].innerHTML.replace(/:-(/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon11.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
      d[i].innerHTML = d[i].innerHTML.replace(/;-)/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon12.gif" style="border:0; margin:0; padding:0;" id="new" /> ');
      d[i].innerHTML = d[i].innerHTML.replace(/XD/gi, ' <img src="http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon13.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>
<!-- (Fin Script Emoticones) -->



5) Ahora buscamos <p><data:blogCommentMessage/></p> y justo antes pegamos el siguiente código:


<!-- ini tabla emoticones -->
<table border='0' cellpadding='0' cellspacing='1'>
  <tr>
    <td align='center' width='26'><img height='21' src='http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon0.gif' width='20'/></td>
    <td align='center' width='26'><img height='21' src='http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon1.gif' width='20'/></td>
    <td align='center' width='26'><img height='21' src='http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon2.gif' width='20'/></td>
    <td align='center' width='26'><img height='21' src='http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon3.gif' width='20'/></td>
    <td align='center' width='26'><img height='21' src='http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon4.gif' width='20'/></td>
    <td align='center' width='26'><img height='21' src='http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon5.gif' width='20'/></td>
    <td align='center' width='26'><img height='21' src='http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon6.gif' width='20'/></td>
    <td align='center' width='26'><img height='21' src='http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon7.gif' width='20'/></td>
    <td align='center' width='26'><img height='21' src='http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon8.gif' width='20'/></td>
    <td align='center' width='26'><img height='21' src='http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon9.gif' width='20'/></td>
    <td align='center' width='26'><img height='21' src='http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon10.gif' width='20'/></td>
    <td align='center' width='26'><img height='21' src='http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon11.gif' width='20'/></td>
    <td align='center' width='26'><img height='21' src='http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon12.gif' width='20'/></td>
    <td align='center' width='26'><img height='20' src='http://i754.photobucket.com/albums/xx182/zavaletaster/emoticon13.gif' width='20'/></td>
  </tr>
  <tr>
    <td align='center' width='26'>:-)</td>
    <td align='center' width='26'>:-S</td>
    <td align='center' width='26'>:-P</td>
    <td align='center' width='26'>:-[</td>
    <td align='center' width='26'>:-D</td>
    <td align='center' width='26'>}:-]</td>
    <td align='center' width='26'>X*</td>
    <td align='center' width='26'>;-D</td>
    <td align='center' width='26'>:-|</td>
    <td align='center' width='26'>:-}</td>
    <td align='center' width='26'>:*)</td>
    <td align='center' width='26'>:-(</td>
    <td align='center' width='26'>;-)</td>
    <td align='center' width='26'>XD</td>
  </tr>
</table>
<!-- fin tabla emoticones -->






Clicamos en vista previa y si todo está bien, guardamos la plantilla.