Hôm
nay Namkna sẽ chia sẻ thêm các bạn một tiện ích liên quan là "Top
Commentators Cloud", tiện ích cũng sẽ thống kê là những người comment
nhiều và hiển thị chúng theo kiểu đám mây, hơn nữa tiện ích sẽ tự động
sắp xếp tên những người comment theo bảng chữ cái.
Hình minh họa:
» Bắt đầu thủ thuật- Đăng nhập vào tài khoản Blogger
- Vào phần Thiết kế (Design)
- Thêm 1 HTML/Javascript và thêm vào code bên dưới
<style> .topcommentors_cloud {padding:8px;border:2px solid #ccc;background:#eee;width:350px;} .topcommentors_cloud a{color:#023d5c;} .topcommentors_cloud a:hover{color:#666;}/* Edit by http://namkna.blogspot.com/ */ </style> <div class="topcommentors_cloud"> <script type="text/javascript"> function cCloud(feed) { max = 0; min = 10000; //finding highest and lowest count for (i=0;i<feed.count;i++) { ccCount = feed.value.items[i].commentcount * 1; if (ccCount > max) { max = ccCount; } if (ccCount < min) { min = ccCount; } } ccCountD = ""; display = ""; for (j=0;j<feed.count;j++) { ccdiff = feed.value.items[j].commentcount - min; ccFontsize = 80 + (ccdiff * 100) / (max - min) + "%"; ccUrl = "'" + feed.value.items[j].authorurl + "'"; ccCountD = "(" + feed.value.items[j].commentcount + ")"; ccName = feed.value.items[j].title + ccCountD; ccLName = "<a style='font-size:" + ccFontsize + "' href=" + ccUrl + " target='_blank'>" + ccName + "</a>"; display = display + ccLName + " "; } document.write(display); } document.write("<script src=\"http://pipes.yahoo.com/pipes/pipe.run?YourBlogUrl=http://namkna.blogspot.com/&Exclusions=Anonymous,Greenlava&ShowHowMany=25&Order=alphabet&_callback=cCloud&_id=c57989056c453fead48afbbb0a0ea8b9&_render=json\"><\/script>"); </script></div>
Trong đó:
- Thay http://namkna.blogspot.com/ thành địa chỉ blog của bạn.
- Thay số 25 (trong ShowHowMany=25) bằng số người comment trên blog bạn muốn hiển thị.
- background:#eee là màu nền của tiện ích.
0 nhận xét:
Đăng nhận xét