Đến thời điểm mọi người tham khảo bài này thì người chơi blogspot không còn nhiều tính đam mê nữa mà phần nhiều blog dùng cho mục đích kiếm tiền do vậy nhu cầu sử dụng icon emo hay thể hiện tình cảm bằng ảnh hay video cũng không nhiều. Code này chắc chỉ có ích cho lượng nhỏ người dùng blog mà thôi.
DEMO
Trong code chỉ nhặt ra những icon thông dụng nhất như hình dưới cho nhẹ code
:) :)) :-* :D =)) :(( :( ~X :-h :-? b-) *-: ~O) @};- >:D< -*X X( :-O =D> :@) :P :"> ;;) ;) :x =(( :-/
Chèn Emoticons Yahoo, ảnh và youtube cho comments Soho và Contempo của blogspot
Tiến hành cài đặt:
Bước 1- Đăng nhập Blog,vào Thiết kế chọn Mẫu.
Bước 2- Vào chỉnh sửa HTML(Mở rộng mẫu tiện ích)
Bước 3- Tìm tới đoạn code:
<data:blogTeamBlogMessage/>Đây là bước hiện biểu tượng yahoo cùng với ký tự tương ứng
Thường thì có 4 đoạn như vậy ta dán code dưới đây vào ngay sau đoạn thứ 2 và 4.
Nếu có 3 đoạn như trên thì dán sau đoạn thứ 2 và 3.
Với những template mới được chia sẻ trên mạng vào thời gian này thì hầu như không còn đoạn HTML trên nên cần tìm đoạn
<b:include data='post' name='comments'/>và dán code bên dưới ngay sau nó.
<b:if cond='data:view.isPost'> <script> /*<![CDATA[*/ function moreSmilies() { document.getElementById('smiley-more').style.display = 'inline'; document.getElementById('smiley-toggle').innerHTML = '<a href="javascript:lessSmilies()">←</a></span>'; } function lessSmilies() { document.getElementById('smiley-more').style.display = 'none'; document.getElementById('smiley-toggle').innerHTML = '<a href="javascript:moreSmilies()">→</a>'; } /*]]>*/ </script> <div class='emoticons'> <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjN40ebUKJ-eOwDw9yBzY84WI9PXnch2difZJyM1swcgjKhphYadVrC4WbIwllXLMTdNIq3Ty71vdzsPFNjQ3ZJP9EYr2_26N4gahMkmiHTdcAekf32GOxZyI_IGWkkl21dfb5_YZa_7C0U/s1600/1.gif'/> :) <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1HsIeCIjFXNxjDQOG9HHOaq1HYgR1ATavA0xSZJZ-rKVpqOpRUDmXizJr5NWDI6o2dPsrkLnoBSzHs3fXcFVki4Lk5BaHGvm79YVV02zh75zpruxW46-cluTz9MXFo3p2jB31toe2y94D/s1600/2.gif'/> :)) <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgk9zvO7PBzBot2pTB32LDnf18ib9IJYlzSuyQ4Nn5xsbcj_noTLHO3a-fh6l3id7S24jVf1E8Lq2O7ug4icjvMg164KBOXHCHYxTdaxP2CSNHtMFCeWAgWiCrF53nuKBgwiAEQ61pCua_7/s1600/3.gif'/> :-* <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGJ0SG5yvI-5ctUWIdA_G4hAegerGKzXhbfKL2Qx47NGkyoSHTHqt9uNbgjguksHI1w1bnFqma0RVA4EidhY4FInmzl5v3yEMfERNyZtBXNGZAtXSh2v7TZu-xNvaBG-ppYEE42uvAEzNw/s1600/4.gif'/> :D <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1tCXxcDEc-S3RYkhciM7cGAXWpa0Zi-i6HoNdROAPhqh18j0H4KKssZw0O3prRNav3Vlbts-UxLehC6vO2Dr-QaREl2XgZj_JexkkNYKJynN30LzeYglOuDTY9LgTiMy_yU3Ehjh4Wsap/s1600/5.gif'/> =)) <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMXp19U9m1wuJXmGfZjH1NUqhPGMG044WDnFcWtu4uNzcVZ7T_smmHA8FPX-wAfwdUVAebrBRVCjlnB8qhBik1PyXrP1sKXBb5onI5jmsyI38BXjtvNZKwmWDKqB8_aS-KIHBr10s9X0ic/s1600/6.gif'/> :(( <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF4otmgsXk5FNNKAWXr7l7lokaYvjQRdrDnCn_QjxUBACFFvFpUsWxcPV5LCP1iWFBIVuW998EW2DC-c3hyGsUwBCe04yBYp07NlcgC_bNGKD50EM5T88m5X6C6zRrbZwOuD0JoYlKrqDI/s1600/7.gif'/> :( <span id='smiley-more' style='display: none;'> <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVC9eF2DpzKRHlKHG7tqGy8n-LBPpt19mLJ8DDsAaXTEe9HaybvSo4xkbjQZE8DaqRS8q_UbzJtoBQpanDgeD83FqmOkiSiYyrqOVkyO72fw_Y87mOx04lUwyNOCOFzPkIXGIEOsCMaCqT/s1600/8.gif'/> ~X <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfVkzj99UwuEXSL5D7ynLbvFJcJYYcsp8nlRxdTPd8KOlFJQaDgjKwNMNJszCnaA9YAxEakCD43HeGKP6CRkMZz23SOgqiARcDKko0WkjZV5WpwkRo895Ox7vv8xXIVcLGbwkp-t-rE3N3/s1600/9.gif'/> :-h <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqnbvQYuYwRAh5dnsT1naYOmoSIMxnzieKVRHnG2Yz8ooCrb5ggZdNSIF7sJ7GAz9Zijalw8zi5CKxRQ5rojVgfJn4TC1gd2_SYiU4RsWfPeCH5Owv8TKGXLuAg2XQC9GR1w1yr0JpxRDS/s1600/10.gif'/> :-? <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ-aZkbZ_igHP0oAgQgCMUV-q-a5w8qNdo974uky0l54uCBoBGolIN9j47ftBBaXHCOzKaXwOS9WdzISJn-RFm_33HGPBp_7jhdDCZG4mTB0XC1Ytx9c9EDP1_VZmJgyyp38TU6FmzD4UO/s1600/11.gif'/> b-) <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7P9XeBqXWTJzlP8bZpWnonVnZd8u5buZ7-BeBESBh5MR7q_H2a18l-fFxOhz4B00G4qEYODPda6iSyx4YTI3zSzyn78RT92M_AjMxSs7iYVqSA-xVvKCU0nIBnOGBX87WIpKHUmNtGIIH/s1600/12.gif'/> *-: <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9k-eAHrCLCKM7dWVFnUpO0YO1_nRW-twI-JKmijiPW8OJC5ZzNNrtsLhapOMrUYRrCHEKq-cuWxGb8mk2CeDbEDk5lqtOqoU2t_qQ8QGBR1kWl3da2SWZsU6ceMKp6miuUsfR6sgP8rsm/s1600/13.gif'/> ~O) <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhND0X3Mu1ITs4Bsb2zxex1v5-XDaSJ1PmIrZgDkkmEQmA_Ei39KFVC_aFHswMAstHlyIHB_kHuyltsJ0Tu9virDdermuDeMg9ZgTrqA-sNqHnNOCBcoST324YLGZ5eRBSduANKWFy-bhBk/s1600/14.gif'/> @};- <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-AFi0ec-yjivxcA_XRiWJsSCRWfAOQeLSAZZ_fEf3GgqNoY4JHFj3OoKp7k0H6bsK1-pogP3Jb40L1_skZgIKxdrrM36QrH_LySJpJc5b119_r0sZHCGKFhNcAMBYEga73lBO-MNQiR2t/s1600/15.gif'/> >:D< <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBEiIBlelIEp3Ew_3Xu4Dz2-l9fc2joSimFK4vi5PePGRILKfJhaGWMA8Sro6PMYN4fwIzHzzwPmPegieTdFzsNY6ImY1EiQgCxfNaynYUesZpMY3MANzeohsYDacq_Rm0prSktBjDm8H5/s1600/16.gif'/> -*x <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga4CeeSGx5uqh1LVddkJHWbVcxS4uM4ukdd6G1AbKwxup14e_qRKSTXWH_gxLgiZ2zAvwc24g-rm_33F96TIlp3iu5EayYLP0Jyi-BcYQOP5YZ_5UKKxb9HCrzmOVP1kKZPs3FCU1y_xMW/s1600/17.gif'/> X( <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh62sKF2ptOQc5BWGqWJ2leujumj3Vw9-0mEsFb2sOW1I0CD8EQLgAASaSXVkEpAaLnWh0xTyOUEvwJAvOjCQouBkWwnTJxcBJfUb0gQDAM58EFEEfzvoaR9meS3kYYoXkWt9gFJdoM4Pp4/s1600/18.gif'/> :-O <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn9xm42mlLc8BWzRqMO6cqtuleilwYTSyaJtmreH9lnNHjhs5Sf2DYBsedvkt7GLdAOFbFCWnpCD69ljtGCqYnkz6WsQ1kOLD_CbathptF8LMkbjtaCZ438ZK4qJ9XJ8y9hWWMAKRLsM_D/s1600/20.gif'/> =D> <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCHYHcRg5eEvkpi7vL0GLPKNlexJiPusxWrQxY70BoUOhtA4nSP2AsuLtLy99-8tjTcVA38f8cIrX2Dzqxb31r68mzRg09r0W9uf-IPR8WaLAOngvfM_d_5NrdBWG1XWHMw5O3HtWP-sgp/s1600/21.gif'/> :@) <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQDzaM6dZsAMBtiO_89ebor4eivWgV8_7Yia1izKB-gOynUnX_V2GMRKyBW1HcsaF2T8fp2BP7K4KmC53nsWgU8yR8awtiVXDXkfbAPMq3ApIde2PuR8Y6FbeUy9MSrvtx_Mz8juoSPhJ1/s1600/22.gif'/> :P <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGLhBX5TnK8SqZ-OT_3D7QeNqFDiRBcOxnfBgaIp6xLISEz-czbsiISDBZFDj9M20Al8zpsrz9xbNLiIjlz13XVke84gQZlx1ClYOVwqprw624YnGAY4VOrjvznv1VCFjTucIViSkqYVRF/s1600/23.gif'/> :"> <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKghXsZBiYfox2FES2i3eQV4LiA1YeHIc6mnjjQxCToc7jGouVz02sarBMinUJ2PR3_CsrFzNTz6SjTjF99YPwiOwNEw99AQI51e0QoCjVijGHTsH0x1KS2cRfWaOVRS2gDpFdszhA3mPa/s1600/24.gif'/> ;;) <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiNx2nDQF_saYmJtdClhR2jEM5inB40p2KJq5auXyWOU4FuF8YhbMKpV3SUyuzWAOqN0MtaXkjQBgfOaDeUgaaiEjdtDkY1setlvH2C3_dLnK9L8HCq2Q7qN6JzCj69cjmEtnyV83G9wpH/s1600/25.gif'/> ;) <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_n7rTJvMUz0O8R-YeCgt0vzrBIFtdztsvhKwX3ukQ5tUvqLV2SvGEXePZ2ARMIOmUXNe684PRm6CjnCAaJ0djxpc66G63vEYejVhuLFNib9PGbHzBBwQNyrTANN70rCgblcMWXcpwA2xR/s1600/26.gif'/> :x <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKi-9_2ZvIY02ydFrVle8lRMJsZci40HIqxk1_MMAka1fH9Sw5KGg0Dp2aDyGeQVTA6CFlussiFj8fY42XU5IjFhPSPZl0G8__fKPtUMHk6R1hHY6kF2I6LLolKgjSXwffdHQKmcWlxMki/s1600/27.gif'/> =(( <img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiamN5SyNCRFfvfJDmjr5xbXv3-aXs4I7K32jLAWrdJQLIi_NYgZRVPzPvo-_Fwm8YFwIOSt8lbUW6TjBYa-G35IjFId0T2CPU4sNwSqjlDT01Jq3ilb2TFA8slo79xdQFdVKdv54QB2fAv/s1600/28.gif'/> :-/ </span> <span id='smiley-toggle'> <a href='javascript:moreSmilies()'> → </a> </span> </div> </b:if>Bước 4- Tìm tới thẻ: </body>
Chèn đoạn code sau vào trước nó
<b:if cond='data:view.isPost'> <script> /*<![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(dummy) { var d = [], i=0, def = ['comment-block','comment-body','comment-post-messages']; for(i=0;i<def.length;i++) { var content = document.getElementsByClassName(def[i]); for(var j=0;j<content.length;j++) d.push(content[j]); } for(var i=0;i<d.length;i++) { var theText = d[i].innerHTML; //Multimedia theText = theText.replace(/(\b)https:\/\/(youtu.be\/|www.youtube.com\/watch\?v\=)([A-z0-9]{1,})(\b)/g, "<iframe width='100%' height='358' src='https://www.youtube.com/embed/$3?rel=0' frameborder='0' allowfullscreen></iframe>"); theText = theText.replace(/(\b)(https?:\/\/[^\<]{1,}\.)(gif|jpg|jpeg|png|bmp)(\b)/g,"$1<div style='clear:both'></div><img style='float:left;margin:10px 0;border:1px solid #DDD;max-width:590px;background:#FFF;padding:4px' alt='com-img' src='$2$3' /><div style='clear:both'></div>$4"); //Emoticons theText = theText.replace(/\:\(\(/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMXp19U9m1wuJXmGfZjH1NUqhPGMG044WDnFcWtu4uNzcVZ7T_smmHA8FPX-wAfwdUVAebrBRVCjlnB8qhBik1PyXrP1sKXBb5onI5jmsyI38BXjtvNZKwmWDKqB8_aS-KIHBr10s9X0ic/s1600/6.gif' />") theText = theText.replace (/\:\(/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF4otmgsXk5FNNKAWXr7l7lokaYvjQRdrDnCn_QjxUBACFFvFpUsWxcPV5LCP1iWFBIVuW998EW2DC-c3hyGsUwBCe04yBYp07NlcgC_bNGKD50EM5T88m5X6C6zRrbZwOuD0JoYlKrqDI/s1600/7.gif'/>") theText = theText.replace (/\:\)\)/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1HsIeCIjFXNxjDQOG9HHOaq1HYgR1ATavA0xSZJZ-rKVpqOpRUDmXizJr5NWDI6o2dPsrkLnoBSzHs3fXcFVki4Lk5BaHGvm79YVV02zh75zpruxW46-cluTz9MXFo3p2jB31toe2y94D/s1600/2.gif'/>") theText = theText.replace (/\~X\(/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVC9eF2DpzKRHlKHG7tqGy8n-LBPpt19mLJ8DDsAaXTEe9HaybvSo4xkbjQZE8DaqRS8q_UbzJtoBQpanDgeD83FqmOkiSiYyrqOVkyO72fw_Y87mOx04lUwyNOCOFzPkIXGIEOsCMaCqT/s1600/8.gif'/>") theText = theText.replace (/\:\-h/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfVkzj99UwuEXSL5D7ynLbvFJcJYYcsp8nlRxdTPd8KOlFJQaDgjKwNMNJszCnaA9YAxEakCD43HeGKP6CRkMZz23SOgqiARcDKko0WkjZV5WpwkRo895Ox7vv8xXIVcLGbwkp-t-rE3N3/s1600/9.gif'/>") theText = theText.replace (/\:-\?/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqnbvQYuYwRAh5dnsT1naYOmoSIMxnzieKVRHnG2Yz8ooCrb5ggZdNSIF7sJ7GAz9Zijalw8zi5CKxRQ5rojVgfJn4TC1gd2_SYiU4RsWfPeCH5Owv8TKGXLuAg2XQC9GR1w1yr0JpxRDS/s1600/10.gif'/>") theText = theText.replace (/b-\)/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ-aZkbZ_igHP0oAgQgCMUV-q-a5w8qNdo974uky0l54uCBoBGolIN9j47ftBBaXHCOzKaXwOS9WdzISJn-RFm_33HGPBp_7jhdDCZG4mTB0XC1Ytx9c9EDP1_VZmJgyyp38TU6FmzD4UO/s1600/11.gif'/>") theText = theText.replace(/\*\-\:\)/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7P9XeBqXWTJzlP8bZpWnonVnZd8u5buZ7-BeBESBh5MR7q_H2a18l-fFxOhz4B00G4qEYODPda6iSyx4YTI3zSzyn78RT92M_AjMxSs7iYVqSA-xVvKCU0nIBnOGBX87WIpKHUmNtGIIH/s1600/12.gif'/>") theText = theText.replace(/\~O\)/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9k-eAHrCLCKM7dWVFnUpO0YO1_nRW-twI-JKmijiPW8OJC5ZzNNrtsLhapOMrUYRrCHEKq-cuWxGb8mk2CeDbEDk5lqtOqoU2t_qQ8QGBR1kWl3da2SWZsU6ceMKp6miuUsfR6sgP8rsm/s1600/13.gif'/>") theText = theText.replace (/\@\}\;\-/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhND0X3Mu1ITs4Bsb2zxex1v5-XDaSJ1PmIrZgDkkmEQmA_Ei39KFVC_aFHswMAstHlyIHB_kHuyltsJ0Tu9virDdermuDeMg9ZgTrqA-sNqHnNOCBcoST324YLGZ5eRBSduANKWFy-bhBk/s1600/14.gif'/>") theText = theText.replace(/\>\:\D\</ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-AFi0ec-yjivxcA_XRiWJsSCRWfAOQeLSAZZ_fEf3GgqNoY4JHFj3OoKp7k0H6bsK1-pogP3Jb40L1_skZgIKxdrrM36QrH_LySJpJc5b119_r0sZHCGKFhNcAMBYEga73lBO-MNQiR2t/s1600/15.gif' alt='>:-D<'/>") theText =theText.replace(/\=\)\)/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1tCXxcDEc-S3RYkhciM7cGAXWpa0Zi-i6HoNdROAPhqh18j0H4KKssZw0O3prRNav3Vlbts-UxLehC6vO2Dr-QaREl2XgZj_JexkkNYKJynN30LzeYglOuDTY9LgTiMy_yU3Ehjh4Wsap/s1600/5.gif' alt='=)'/>") theText = theText.replace (/\:\)/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjN40ebUKJ-eOwDw9yBzY84WI9PXnch2difZJyM1swcgjKhphYadVrC4WbIwllXLMTdNIq3Ty71vdzsPFNjQ3ZJP9EYr2_26N4gahMkmiHTdcAekf32GOxZyI_IGWkkl21dfb5_YZa_7C0U/s1600/1.gif'/>") theText = theText.replace(/\:\-\*/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgk9zvO7PBzBot2pTB32LDnf18ib9IJYlzSuyQ4Nn5xsbcj_noTLHO3a-fh6l3id7S24jVf1E8Lq2O7ug4icjvMg164KBOXHCHYxTdaxP2CSNHtMFCeWAgWiCrF53nuKBgwiAEQ61pCua_7/s1600/3.gif' />") theText = theText.replace(/\:D/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGJ0SG5yvI-5ctUWIdA_G4hAegerGKzXhbfKL2Qx47NGkyoSHTHqt9uNbgjguksHI1w1bnFqma0RVA4EidhY4FInmzl5v3yEMfERNyZtBXNGZAtXSh2v7TZu-xNvaBG-ppYEE42uvAEzNw/s1600/4.gif' alt=':-D'/>") theText = theText.replace(/\[-*x/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBEiIBlelIEp3Ew_3Xu4Dz2-l9fc2joSimFK4vi5PePGRILKfJhaGWMA8Sro6PMYN4fwIzHzzwPmPegieTdFzsNY6ImY1EiQgCxfNaynYUesZpMY3MANzeohsYDacq_Rm0prSktBjDm8H5/s1600/16.gif' alt='[-X'/>") theText = theText.replace(/\s*x\(/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga4CeeSGx5uqh1LVddkJHWbVcxS4uM4ukdd6G1AbKwxup14e_qRKSTXWH_gxLgiZ2zAvwc24g-rm_33F96TIlp3iu5EayYLP0Jyi-BcYQOP5YZ_5UKKxb9HCrzmOVP1kKZPs3FCU1y_xMW/s1600/17.gif' alt='X('/>") theText = theText.replace(/\:-O/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh62sKF2ptOQc5BWGqWJ2leujumj3Vw9-0mEsFb2sOW1I0CD8EQLgAASaSXVkEpAaLnWh0xTyOUEvwJAvOjCQouBkWwnTJxcBJfUb0gQDAM58EFEEfzvoaR9meS3kYYoXkWt9gFJdoM4Pp4/s1600/18.gif' alt=':-O'/>") theText = theText.replace(/\>:P/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWW3cpW7AlhWNyZSnhq7Z5j_cWClu_1qPbVVGNb_2tj_wMH1PSM5bBhmnUaeuXVvtFAKppT0ROE53MiD3Fc7_ppDNZPQ8GhpGKXirQkbWwU0olVORT0ZaVAAOCuXYSXJn4gMGX9dPQUPmB/s1600/19.gif' alt='>:P'/>") theText = theText.replace(/\=D>/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn9xm42mlLc8BWzRqMO6cqtuleilwYTSyaJtmreH9lnNHjhs5Sf2DYBsedvkt7GLdAOFbFCWnpCD69ljtGCqYnkz6WsQ1kOLD_CbathptF8LMkbjtaCZ438ZK4qJ9XJ8y9hWWMAKRLsM_D/s1600/20.gif' alt='=D>'/>") theText = theText.replace (/\:\@\)/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCHYHcRg5eEvkpi7vL0GLPKNlexJiPusxWrQxY70BoUOhtA4nSP2AsuLtLy99-8tjTcVA38f8cIrX2Dzqxb31r68mzRg09r0W9uf-IPR8WaLAOngvfM_d_5NrdBWG1XWHMw5O3HtWP-sgp/s1600/21.gif'/>") theText = theText.replace (/\:\P/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQDzaM6dZsAMBtiO_89ebor4eivWgV8_7Yia1izKB-gOynUnX_V2GMRKyBW1HcsaF2T8fp2BP7K4KmC53nsWgU8yR8awtiVXDXkfbAPMq3ApIde2PuR8Y6FbeUy9MSrvtx_Mz8juoSPhJ1/s1600/22.gif'/>") theText = theText.replace (/\:\"\>/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGLhBX5TnK8SqZ-OT_3D7QeNqFDiRBcOxnfBgaIp6xLISEz-czbsiISDBZFDj9M20Al8zpsrz9xbNLiIjlz13XVke84gQZlx1ClYOVwqprw624YnGAY4VOrjvznv1VCFjTucIViSkqYVRF/s1600/23.gif'/>") theText = theText.replace(/\;;\)/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKghXsZBiYfox2FES2i3eQV4LiA1YeHIc6mnjjQxCToc7jGouVz02sarBMinUJ2PR3_CsrFzNTz6SjTjF99YPwiOwNEw99AQI51e0QoCjVijGHTsH0x1KS2cRfWaOVRS2gDpFdszhA3mPa/s1600/24.gif' />") theText = theText.replace(/\;\)/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiNx2nDQF_saYmJtdClhR2jEM5inB40p2KJq5auXyWOU4FuF8YhbMKpV3SUyuzWAOqN0MtaXkjQBgfOaDeUgaaiEjdtDkY1setlvH2C3_dLnK9L8HCq2Q7qN6JzCj69cjmEtnyV83G9wpH/s1600/25.gif' alt=';)'/>") theText = theText.replace(/\:x/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_n7rTJvMUz0O8R-YeCgt0vzrBIFtdztsvhKwX3ukQ5tUvqLV2SvGEXePZ2ARMIOmUXNe684PRm6CjnCAaJ0djxpc66G63vEYejVhuLFNib9PGbHzBBwQNyrTANN70rCgblcMWXcpwA2xR/s1600/26.gif'alt=':X'/>") theText = theText.replace(/\=\(\(/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKi-9_2ZvIY02ydFrVle8lRMJsZci40HIqxk1_MMAka1fH9Sw5KGg0Dp2aDyGeQVTA6CFlussiFj8fY42XU5IjFhPSPZl0G8__fKPtUMHk6R1hHY6kF2I6LLolKgjSXwffdHQKmcWlxMki/s1600/27.gif' alt='=('/>") theText = theText.replace(/\:\-\//ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiamN5SyNCRFfvfJDmjr5xbXv3-aXs4I7K32jLAWrdJQLIi_NYgZRVPzPvo-_Fwm8YFwIOSt8lbUW6TjBYa-G35IjFId0T2CPU4sNwSqjlDT01Jq3ilb2TFA8slo79xdQFdVKdv54QB2fAv/s1600/28.gif' alt=':-C'/>") //Font-size & Color theText = theText.replace(/\[size=\"(?:(\d{1,2}))\"\]/gi,"<span style=\'font-size:$1px\'>"); theText = theText.replace(/\[\/size\]/gi,"</span>"); theText = theText.replace(/\[color=\"(?:([a-z]{3,}|#[a-f0-9]{3,6}))\"\]/gi,"<span style=\'color:$1\'</span>"); theText = theText.replace(/\[\/color\]/gi,"</span>"); d[i].innerHTML = theText; } } function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { oldonload(); func(); } } } addLoadEvent(function(){ addSmiley(); }); /*]]>*/ </script> </b:if>Bước 5- Tìm tới thẻ ]]></b:skin> và dán đoạn code sau trước nó:
.emoticons {-moz-background-clip: -moz-initial;-moz-background-origin: -moz-initial;-moz-background-inline-policy: -moz-initial;text-align: left;} .emoticons a, .emoticons {font-size: 13px;margin-left: 20px;text-decoration:none;} .comment-block img { max-width: 100% !important; }Để blog tải nhanh khi khách truy cập bạn có thể up 2 phần code trên lên host lấy link sau đó sử dụng javascript với tính năng chỉ tải khi cuộn trang như adsense vì phần comments nằm ở cuối bài viết.
Chèn Emoticons Yahoo cho comments Soho và Contempo... với blog có sẵn phần ảnh và video youtube
Với các mẫu blog v3 chia sẻ bây giờ như template của ify chẳng hạn thì họ đã tích hợp sẵn chức năng post ảnh và video của youtube vào comments do vậy nếu dùng code trên khi post ảnh sẽ bị lỗi hiện 2 ảnh cho một lần post do vậy cần thay đổi một chút code ở bước 4 còn các bước từ 3 trở về trước vẫn thực hiện nguyên vậy.
Tại bước 4 ta sử dụng code sau:
<b:if cond='data:view.isPost'> <script> /*<![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(dummy) { var d = [], i=0, def = ['comment-block','comment-body','comment-post-messages']; for(i=0;i<def.length;i++) { var content = document.getElementsByClassName(def[i]); for(var j=0;j<content.length;j++) d.push(content[j]); } for(var i=0;i<d.length;i++) { var theText = d[i].innerHTML; //Emoticons theText = theText.replace(/\:\(\(/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMXp19U9m1wuJXmGfZjH1NUqhPGMG044WDnFcWtu4uNzcVZ7T_smmHA8FPX-wAfwdUVAebrBRVCjlnB8qhBik1PyXrP1sKXBb5onI5jmsyI38BXjtvNZKwmWDKqB8_aS-KIHBr10s9X0ic/s1600/6.gif' />") theText = theText.replace (/\:\(/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF4otmgsXk5FNNKAWXr7l7lokaYvjQRdrDnCn_QjxUBACFFvFpUsWxcPV5LCP1iWFBIVuW998EW2DC-c3hyGsUwBCe04yBYp07NlcgC_bNGKD50EM5T88m5X6C6zRrbZwOuD0JoYlKrqDI/s1600/7.gif'/>") theText = theText.replace (/\:\)\)/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1HsIeCIjFXNxjDQOG9HHOaq1HYgR1ATavA0xSZJZ-rKVpqOpRUDmXizJr5NWDI6o2dPsrkLnoBSzHs3fXcFVki4Lk5BaHGvm79YVV02zh75zpruxW46-cluTz9MXFo3p2jB31toe2y94D/s1600/2.gif'/>") theText = theText.replace (/\~X\(/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVC9eF2DpzKRHlKHG7tqGy8n-LBPpt19mLJ8DDsAaXTEe9HaybvSo4xkbjQZE8DaqRS8q_UbzJtoBQpanDgeD83FqmOkiSiYyrqOVkyO72fw_Y87mOx04lUwyNOCOFzPkIXGIEOsCMaCqT/s1600/8.gif'/>") theText = theText.replace (/\:\-h/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfVkzj99UwuEXSL5D7ynLbvFJcJYYcsp8nlRxdTPd8KOlFJQaDgjKwNMNJszCnaA9YAxEakCD43HeGKP6CRkMZz23SOgqiARcDKko0WkjZV5WpwkRo895Ox7vv8xXIVcLGbwkp-t-rE3N3/s1600/9.gif'/>") theText = theText.replace (/\:-\?/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqnbvQYuYwRAh5dnsT1naYOmoSIMxnzieKVRHnG2Yz8ooCrb5ggZdNSIF7sJ7GAz9Zijalw8zi5CKxRQ5rojVgfJn4TC1gd2_SYiU4RsWfPeCH5Owv8TKGXLuAg2XQC9GR1w1yr0JpxRDS/s1600/10.gif'/>") theText = theText.replace (/b-\)/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ-aZkbZ_igHP0oAgQgCMUV-q-a5w8qNdo974uky0l54uCBoBGolIN9j47ftBBaXHCOzKaXwOS9WdzISJn-RFm_33HGPBp_7jhdDCZG4mTB0XC1Ytx9c9EDP1_VZmJgyyp38TU6FmzD4UO/s1600/11.gif'/>") theText = theText.replace(/\*\-\:\)/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7P9XeBqXWTJzlP8bZpWnonVnZd8u5buZ7-BeBESBh5MR7q_H2a18l-fFxOhz4B00G4qEYODPda6iSyx4YTI3zSzyn78RT92M_AjMxSs7iYVqSA-xVvKCU0nIBnOGBX87WIpKHUmNtGIIH/s1600/12.gif'/>") theText = theText.replace(/\~O\)/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9k-eAHrCLCKM7dWVFnUpO0YO1_nRW-twI-JKmijiPW8OJC5ZzNNrtsLhapOMrUYRrCHEKq-cuWxGb8mk2CeDbEDk5lqtOqoU2t_qQ8QGBR1kWl3da2SWZsU6ceMKp6miuUsfR6sgP8rsm/s1600/13.gif'/>") theText = theText.replace (/\@\}\;\-/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhND0X3Mu1ITs4Bsb2zxex1v5-XDaSJ1PmIrZgDkkmEQmA_Ei39KFVC_aFHswMAstHlyIHB_kHuyltsJ0Tu9virDdermuDeMg9ZgTrqA-sNqHnNOCBcoST324YLGZ5eRBSduANKWFy-bhBk/s1600/14.gif'/>") theText = theText.replace(/\>\:\D\</ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-AFi0ec-yjivxcA_XRiWJsSCRWfAOQeLSAZZ_fEf3GgqNoY4JHFj3OoKp7k0H6bsK1-pogP3Jb40L1_skZgIKxdrrM36QrH_LySJpJc5b119_r0sZHCGKFhNcAMBYEga73lBO-MNQiR2t/s1600/15.gif' alt='>:-D<'/>") theText =theText.replace(/\=\)\)/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1tCXxcDEc-S3RYkhciM7cGAXWpa0Zi-i6HoNdROAPhqh18j0H4KKssZw0O3prRNav3Vlbts-UxLehC6vO2Dr-QaREl2XgZj_JexkkNYKJynN30LzeYglOuDTY9LgTiMy_yU3Ehjh4Wsap/s1600/5.gif' alt='=)'/>") theText = theText.replace (/\:\)/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjN40ebUKJ-eOwDw9yBzY84WI9PXnch2difZJyM1swcgjKhphYadVrC4WbIwllXLMTdNIq3Ty71vdzsPFNjQ3ZJP9EYr2_26N4gahMkmiHTdcAekf32GOxZyI_IGWkkl21dfb5_YZa_7C0U/s1600/1.gif'/>") theText = theText.replace(/\:\-\*/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgk9zvO7PBzBot2pTB32LDnf18ib9IJYlzSuyQ4Nn5xsbcj_noTLHO3a-fh6l3id7S24jVf1E8Lq2O7ug4icjvMg164KBOXHCHYxTdaxP2CSNHtMFCeWAgWiCrF53nuKBgwiAEQ61pCua_7/s1600/3.gif' />") theText = theText.replace(/\:D/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGJ0SG5yvI-5ctUWIdA_G4hAegerGKzXhbfKL2Qx47NGkyoSHTHqt9uNbgjguksHI1w1bnFqma0RVA4EidhY4FInmzl5v3yEMfERNyZtBXNGZAtXSh2v7TZu-xNvaBG-ppYEE42uvAEzNw/s1600/4.gif' alt=':-D'/>") theText = theText.replace(/\[-*x/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBEiIBlelIEp3Ew_3Xu4Dz2-l9fc2joSimFK4vi5PePGRILKfJhaGWMA8Sro6PMYN4fwIzHzzwPmPegieTdFzsNY6ImY1EiQgCxfNaynYUesZpMY3MANzeohsYDacq_Rm0prSktBjDm8H5/s1600/16.gif' alt='[-X'/>") theText = theText.replace(/\s*x\(/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga4CeeSGx5uqh1LVddkJHWbVcxS4uM4ukdd6G1AbKwxup14e_qRKSTXWH_gxLgiZ2zAvwc24g-rm_33F96TIlp3iu5EayYLP0Jyi-BcYQOP5YZ_5UKKxb9HCrzmOVP1kKZPs3FCU1y_xMW/s1600/17.gif' alt='X('/>") theText = theText.replace(/\:-O/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh62sKF2ptOQc5BWGqWJ2leujumj3Vw9-0mEsFb2sOW1I0CD8EQLgAASaSXVkEpAaLnWh0xTyOUEvwJAvOjCQouBkWwnTJxcBJfUb0gQDAM58EFEEfzvoaR9meS3kYYoXkWt9gFJdoM4Pp4/s1600/18.gif' alt=':-O'/>") theText = theText.replace(/\>:P/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWW3cpW7AlhWNyZSnhq7Z5j_cWClu_1qPbVVGNb_2tj_wMH1PSM5bBhmnUaeuXVvtFAKppT0ROE53MiD3Fc7_ppDNZPQ8GhpGKXirQkbWwU0olVORT0ZaVAAOCuXYSXJn4gMGX9dPQUPmB/s1600/19.gif' alt='>:P'/>") theText = theText.replace(/\=D>/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn9xm42mlLc8BWzRqMO6cqtuleilwYTSyaJtmreH9lnNHjhs5Sf2DYBsedvkt7GLdAOFbFCWnpCD69ljtGCqYnkz6WsQ1kOLD_CbathptF8LMkbjtaCZ438ZK4qJ9XJ8y9hWWMAKRLsM_D/s1600/20.gif' alt='=D>'/>") theText = theText.replace (/\:\@\)/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCHYHcRg5eEvkpi7vL0GLPKNlexJiPusxWrQxY70BoUOhtA4nSP2AsuLtLy99-8tjTcVA38f8cIrX2Dzqxb31r68mzRg09r0W9uf-IPR8WaLAOngvfM_d_5NrdBWG1XWHMw5O3HtWP-sgp/s1600/21.gif'/>") theText = theText.replace (/\:\P/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQDzaM6dZsAMBtiO_89ebor4eivWgV8_7Yia1izKB-gOynUnX_V2GMRKyBW1HcsaF2T8fp2BP7K4KmC53nsWgU8yR8awtiVXDXkfbAPMq3ApIde2PuR8Y6FbeUy9MSrvtx_Mz8juoSPhJ1/s1600/22.gif'/>") theText = theText.replace (/\:\"\>/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGLhBX5TnK8SqZ-OT_3D7QeNqFDiRBcOxnfBgaIp6xLISEz-czbsiISDBZFDj9M20Al8zpsrz9xbNLiIjlz13XVke84gQZlx1ClYOVwqprw624YnGAY4VOrjvznv1VCFjTucIViSkqYVRF/s1600/23.gif'/>") theText = theText.replace(/\;;\)/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKghXsZBiYfox2FES2i3eQV4LiA1YeHIc6mnjjQxCToc7jGouVz02sarBMinUJ2PR3_CsrFzNTz6SjTjF99YPwiOwNEw99AQI51e0QoCjVijGHTsH0x1KS2cRfWaOVRS2gDpFdszhA3mPa/s1600/24.gif' />") theText = theText.replace(/\;\)/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiNx2nDQF_saYmJtdClhR2jEM5inB40p2KJq5auXyWOU4FuF8YhbMKpV3SUyuzWAOqN0MtaXkjQBgfOaDeUgaaiEjdtDkY1setlvH2C3_dLnK9L8HCq2Q7qN6JzCj69cjmEtnyV83G9wpH/s1600/25.gif' alt=';)'/>") theText = theText.replace(/\:x/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_n7rTJvMUz0O8R-YeCgt0vzrBIFtdztsvhKwX3ukQ5tUvqLV2SvGEXePZ2ARMIOmUXNe684PRm6CjnCAaJ0djxpc66G63vEYejVhuLFNib9PGbHzBBwQNyrTANN70rCgblcMWXcpwA2xR/s1600/26.gif'alt=':X'/>") theText = theText.replace(/\=\(\(/ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKi-9_2ZvIY02ydFrVle8lRMJsZci40HIqxk1_MMAka1fH9Sw5KGg0Dp2aDyGeQVTA6CFlussiFj8fY42XU5IjFhPSPZl0G8__fKPtUMHk6R1hHY6kF2I6LLolKgjSXwffdHQKmcWlxMki/s1600/27.gif' alt='=('/>") theText = theText.replace(/\:\-\//ig,"<img style='border: 0; padding:0' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiamN5SyNCRFfvfJDmjr5xbXv3-aXs4I7K32jLAWrdJQLIi_NYgZRVPzPvo-_Fwm8YFwIOSt8lbUW6TjBYa-G35IjFId0T2CPU4sNwSqjlDT01Jq3ilb2TFA8slo79xdQFdVKdv54QB2fAv/s1600/28.gif' alt=':-C'/>") //Font-size & Color theText = theText.replace(/\[size=\"(?:(\d{1,2}))\"\]/gi,"<span style=\'font-size:$1px\'>"); theText = theText.replace(/\[\/size\]/gi,"</span>"); theText = theText.replace(/\[color=\"(?:([a-z]{3,}|#[a-f0-9]{3,6}))\"\]/gi,"<span style=\'color:$1\'</span>"); theText = theText.replace(/\[\/color\]/gi,"</span>"); d[i].innerHTML = theText; } } function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { oldonload(); func(); } } } addLoadEvent(function(){ addSmiley(); }); /*]]>*/ </script> </b:if>