Cikgu Kacamata


27
Widget Komen Terkini Dengan Avatar Berpusing


Widget Komen Terkini Tanpa Komen Anda adalah widget update daripada Widget Komen Terkini Blogger dan Widget Komen Terkini Dengan Avatar yang CK postkan sebelum ini. Widget ini sangat menarik kerana terdapat banyak kelebihan berbanding yang terdahulu dan harus dimiliki setiap blog.



Antara kelebihan yang terdapat pada widget ini:



Ikuti langkah-langkah mudah untuk memasukkan widget ini ke sidebar blog anda:

1. Masuk ke akaun blogger anda -->>> "More options"

2. Pilih "Layout"


3. "Add a Gadget"


4. Scroll ke bawah sedikit dan klik "HTML/JavaScript"


5. "Copy" kod di bawah dan "paste" ke dalam kotak Content

<style type="text/css">
.rc{padding-left:24px; padding-top: 6px;}
.rc a:hover {color: #ff0000;text-decoration: none;}
.rc-ico{margin-left:-20px;margin-top:4px;float:left; margin-right:3px}
.rc-ico img {margin-top: -2px;margin-right:5px; border: 2px solid #ffffff;-webkit-border-radius: 100px;-moz-border-radius: 100px;border-radius: 100px;-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .4);-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, .4);box-shadow: 0 1px 2px rgba(0, 0, 0, .4);
-webkit-transition: all 1s ease-in-out;
-moz-transition: all 1s ease-in-out;
-o-transition: all 1s ease-in-out;
-ms-transition: all 1s ease-in-out; }
.rc-ico img:hover {-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-o-transform: rotate(360deg);
-ms-transform: rotate(360deg);}
.rc-header{font-size: 13px;}
.rc-header a{}
.rc-body{font-style: italic; font-size:11px;padding: 0px 4px 1px 10px;border: 1px solid transparent;}
.rc-footer{font-size:11px; float: right;}
#rcw-cr {font-family: Arial,Tahoma;font-size:9px;padding-top:7px;display:block;}
</style>
<script type="text/javascript">
var numRecentComments = 5;
var maxCommentChars = 50;
var trueAvatars = true;
var urlMyAvatar = '';
var urlMyProfile = '';
var cropAvatar = true;
var sizeAvatar = 50;
var urlNoAvatar = "http://1.bp.blogspot.com/-EuNpJ48c_X8/UcITqryxVmI/AAAAAAAABCE/resw623kKeU/s1600/ck-avatar.jpg";
var urlAnoAvatar = 'http://1.bp.blogspot.com/-EuNpJ48c_X8/UcITqryxVmI/AAAAAAAABCE/resw623kKeU/s1600/ck-avatar.jpg' + sizeAvatar;
var txtMore = 'Berikutnya »';
var txtWrote = 'komen:';
var txtAnonymous = '';
var maxResultsComments = "";
var numPerPost = 10;
var maxPostTitleChars = 30;
var getTitles = true;javascript:void(0)
var maxResultsPosts = "";
var txtTooltip = '';
var urlToTitle = {};
function replaceVars(text, user, title, date) {
text = text.replace('[user]', user);
text = text.replace('[date]', date.toLocaleDateString());
text = text.replace('[datetime]', date.toLocaleString());
text = text.replace('[time]', date.toLocaleTimeString());
text = text.replace('[title]', title.replace(/\"/g,'"'));
var i = text.indexOf("[date ");
if(i > -1) {
var format = /\[date\s+(.+?)\]/.exec(text)[1];
if(format != '') {
var txtDate = format.replace(/yyyy/i, date.getFullYear());
txtDate = txtDate.replace(/yy/i, date.getFullYear().toString().slice(-2));
txtDate = txtDate.replace("MM", String("0"+(date.getMonth()+1)).slice(-2));
txtDate = txtDate.replace("mm", String("0"+date.getMinutes()).slice(-2));
txtDate = txtDate.replace("ss", String("0"+date.getSeconds()).slice(-2));
txtDate = txtDate.replace("dd", String("0"+date.getDate()).slice(-2));
//or: txtDate = txtDate.replace("dd", date.getDate());
txtDate = txtDate.replace("hh", String("0"+date.getHours()).slice(-2));
//or: txtDate = txtDate.replace("hh", date.getHours());
text = text.replace(/\[date\s+(.+?)\]/, txtDate)
}
}
return text;
}
if(urlMyProfile == "") {
var elements = document.getElementsByTagName("*");
var expr = /(^| )profile-link( |$)/;
for(var i=0 ; i<elements.length ; i++)
if(expr.test(elements[i].className)) {
urlMyProfile = elements[i].href;
break;
}
}
function getPostUrlsForComments(json) {
for(var i = 0 ; i < json.feed.entry.length ; i++ ) {
var entry = json.feed.entry[i];
for (var k = 0; k < entry.link.length; k++ ) {
if (entry.link[k].rel == 'alternate') {
href = entry.link[k].href;
break;
}
}
urlToTitle[href] = entry.title.$t;
}
}
function showRecentComments(json) {
var postHandled = {};
var j = 0;
if(numPerPost) {
while(numPerPost < numRecentComments) {
for(var i = 0 ; i < json.feed.entry.length ; i++ ) {
var entry = json.feed.entry[i]; if(entry.author[0].name.$t=="Blogger User") continue;
if(entry["thr$in-reply-to"]) {
if(!postHandled[entry["thr$in-reply-to"].href])
postHandled[entry["thr$in-reply-to"].href] = 1;
else
postHandled[entry["thr$in-reply-to"].href]++;
if(postHandled[entry["thr$in-reply-to"].href] <= numPerPost)
j++;
}
}
if(j >= numRecentComments)
break;
numPerPost++;
j = 0;
postHandled = {};
}
if(numRecentComments == numPerPost)
numPerPost = 0;
}
postHandled = {};
j = 0;
for(var i = 0 ; j < numRecentComments && i < json.feed.entry.length ; i++ ) {
var entry = json.feed.entry[i]; if(entry.author[0].name.$t=="Blogger User") continue;
if(numPerPost && postHandled[entry["thr$in-reply-to"].href] && postHandled[entry["thr$in-reply-to"].href] >= numPerPost)
continue;
if(entry["thr$in-reply-to"]) {
if(!postHandled[entry["thr$in-reply-to"].href])
postHandled[entry["thr$in-reply-to"].href] = 1;
else
postHandled[entry["thr$in-reply-to"].href]++;
j++;
var href='';
for (var k = 0; k < entry.link.length; k++ ) {
if (entry.link[k].rel == 'alternate') {
href = entry.link[k].href;
break;
}
}
if(href=='') {j--; continue; }
var hrefPost = href.split("?")[0];
var comment = "";
if("content" in entry) comment = entry.content.$t;
else comment = entry.summary.$t;
comment = comment.replace(/<br[^>]*>/ig, " ");
comment = comment.replace(/<\S[^>]*>/g, "");
var postTitle="-";
if(urlToTitle[hrefPost]) postTitle=urlToTitle[hrefPost];
else {
if(hrefPost.match(/\/([^/]*)\.html/)) postTitle = hrefPost.match(/\/([^/]*)\.html/)[1].replace(/_\d{2}$/, "");
postTitle = postTitle.replace(/-/g," ");
postTitle = postTitle[0].toUpperCase() + postTitle.slice(1);
}
if(maxPostTitleChars && postTitle.length > maxPostTitleChars) {
postTitle = postTitle.substring(0, maxPostTitleChars);
var indexBreak = postTitle.lastIndexOf(" ");
postTitle = postTitle.substring(0, indexBreak) + "...";
}

var authorName = entry.author[0].name.$t;
var authorUri = "";
if(entry.author[0].uri && entry.author[0].uri.$t != "")
authorUri = entry.author[0].uri.$t;
var avaimg = urlAnoAvatar;
var bloggerprofile = "http://www.blogger.com/profile/";
if(trueAvatars && entry.author[0].gd$image && entry.author[0].gd$image.src && authorUri.substr(0,bloggerprofile.length) == bloggerprofile)
avaimg = entry.author[0].gd$image.src;
else {
var parseurl = document.createElement('a');
if(authorUri != "") {
parseurl.href = authorUri;
avaimg = 'http://www.google.com/s2/favicons?domain=' + parseurl.hostname;
}
}
if(urlMyProfile != "" && authorUri == urlMyProfile && urlMyAvatar != "")
avaimg = urlMyAvatar;
if(avaimg == "http://img2.blogblog.com/img/b16-rounded.gif" && urlNoAvatar != "")
avaimg = urlNoAvatar;
var newsize="s"+sizeAvatar;
avaimg = avaimg.replace(/\/s\d\d+-c\//, "/"+newsize+"-c/");
if(cropAvatar) newsize+="-c";
avaimg = avaimg.replace(/\/s\d\d+(-c){0,1}\//, "/"+newsize+"/");
if(authorName == 'Anonymous' && txtAnonymous != '' && avaimg == urlAnoAvatar)
authorName = txtAnonymous;
var imgcode = '<img height="'+sizeAvatar+'" width="'+sizeAvatar+'" title="'+authorName+'" src="'+avaimg+'" />';
if (authorUri!="") imgcode = '<a href="'+authorUri+'">'+imgcode+'</a>';
var clsAdmin = "";
if(urlMyProfile != "" && authorUri == urlMyProfile)
clsAdmin = " rc-admin";
var datePart = entry.published.$t.match(/\d+/g); // assume ISO 8601
var cmtDate = new Date(datePart[0],datePart[1]-1,datePart[2],datePart[3],datePart[4],datePart[5]);

var txtHeader = txtWrote;
if(txtWrote.indexOf('[')==-1)
txtHeader = authorName + ' ' + txtWrote;
else
txtHeader = replaceVars(txtHeader, authorName, postTitle, cmtDate);

var tooltip = replaceVars(txtTooltip, authorName, postTitle, cmtDate);
if(!/#/.test(href)) href += "#comments";
document.write('<div title="'+tooltip+'" class="rc'+clsAdmin+'">');
document.write('<div title="'+tooltip+'" class="rc-header'+clsAdmin+'"><div title="'+tooltip+'" class="rc-ico'+clsAdmin+'">'+imgcode+'</div><a title="'+tooltip+'" href="' + href + '">' + txtHeader + ' </a></div>');
if(comment.length < maxCommentChars)
document.write('<div title="'+tooltip+'" class="rc-body'+clsAdmin+'">' + comment + '</div>');
else {
comment = comment.substring(0, maxCommentChars);
var indexBreak = comment.lastIndexOf(" ");
comment = comment.substring(0, indexBreak);
document.write('<div title="'+tooltip+'" class="rc-body'+clsAdmin+'">' + comment + '...</div>');
if(txtMore != "") {
var moretext = replaceVars(txtMore, authorName, postTitle, cmtDate);
document.write('<div title="'+tooltip+'" class="rc-footer'+clsAdmin+'"><a title="'+tooltip+'" href="' + href + '">' + moretext + '</a></div>');
}
}
document.write('<div style="clear:both;"></div></div>');
}
}
}
if(getTitles)
document.write('<script type="text/javascript" src="http://'+window.location.hostname+'/feeds/posts/summary?redirect=false'+maxResultsPosts+'&alt=json-in-script&callback=getPostUrlsForComments"></'+'script>');
document.write('<script type="text/javascript" src="http://'+window.location.hostname+'/feeds/comments/default?redirect=false'+maxResultsComments+'&alt=json-in-script&callback=showRecentComments"></'+'script>');
</script>
<span id=ck-wkt><a href=http://cikgukacamata.blogspot.com/2013/06/widget-komen-terkini-dengan-avatar.html target=_blank>Widget Komen Terkini Dengan Avatar</a></span>
<style type=text/css>
#ck-wkt {font-family: Arial,Tahoma;font-size:9px;font-style:italic;padding-top:7px;display:block;text-align:right;}
</style>


Nota:

6. Klik "Save"

Selesai!







Sila Share Post CK Ini Sekiranya Anda Suka
Dapatkan Widget Ini!

27 comments:

  1. salam... saya dah cuba widget nie, cuma nak tanya, yg nama sendiri tu nak ganti ngan url blog ke camner erk..?

    ReplyDelete
    Replies
    1. Maaf, CK lupa nak inpom. Ganti dengan nama daftar blog. Contoh: "Blogger User" diganti dengan "Mohd Fauzli". Ada dua tempat kena tukar...

      Delete
    2. This comment has been removed by the author.

      Delete
  2. wah..bagus tuto nie..thanks sharing

    ReplyDelete
  3. wah...smart...CJM nak share dkt blog ya CK :)

    ReplyDelete
    Replies
    1. Thanks CJM. Ya, dipersilakan untuk share ;)

      Delete
  4. Pusing pusing . suka tengok . Nice CK :)

    ReplyDelete
    Replies
    1. Jangan kepala yg pusing2 udah...hehe. Thanks Cik Natasya ;)

      Delete
  5. salam cikgu.. L ambil tuto ni utk blog n bt tuto.. sgt menarik!! thenx cikgu..

    ReplyDelete
  6. camne nak sembunyikan comment sy?

    ReplyDelete
  7. tq cikgu..

    http://mie-jf-video.blogspot.com/

    ReplyDelete
  8. menarik widget ni... tapi macam malas lak nak pasang, hehehe

    ReplyDelete


  9. • kami sekeluarga tak lupa mengucapkan puji syukur kepada ALLAH S,W,T dan terima kasih banyak kepada MBAH atas nomor togel.nya yang MBAH berikan 4 angkah *1242* alhamdulillah ternyata itu benar2 tembus MBAH. dan alhamdulillah sekarang saya bisa melunasi semua utan2 saya yang ada sama tetangga.dan juga BANK BRI dan bukan hanya itu MBAH. insya allah saya akan coba untuk membuka usaha sendiri demi mencukupi kebutuhan keluarga saya sehari-hari itu semua berkat bantuan MBAH.. sekali lagi makasih banyak ya MBAH… bagi saudara yang suka main togel .
    • yang ingin merubah nasib seperti saya silahkan hubungi MBAH SUKRO,,di 0853/3000/1769,, http://ramalantogel77.blogspot.com/ insya allah anda bisa seperti saya…menang togel 175 juta, wassalam.
    • makasih yang punya room….

    Singapura Kamis 30 Mei 2014 | Cyber4rD

    ReplyDelete
  10. AWESOME..Shad nak try dkt blog shad juga.. blogwalking sini sambil klik nuff..
    http://akuvsdiashadhira.blogspot.com

    ReplyDelete
  11. best sangat dapat buat ni...terima kasih byk2.......siap letak dlm blog list,utk rujukan .... hihihi

    ReplyDelete
  12. cikgu, nak share..terima kasih yer..

    ReplyDelete
  13. salam singgah. Selamat hari raya maaf zahir batin :D

    ReplyDelete