Breaking News
Loading...
Thứ Sáu, 17 tháng 2, 2012

Tiện ích "Top Commentators Cloud" dành cho Blogspot

19:31
Traidatmui.com – Trước đây mình có chia sẻ cùng các bạn một tiện ích "Top Commentators", tuy nhiên thì tiện ích trước đây chỉ liệt kê những người comment nhiều và sắp xếp dạng list từ cao đến thấp. Hôm nay mình xin được 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.


» Bắt đầu thủ thuật

1. Đăng nhập vào tài khoản Blogger
2. Vào phần thiết kế (Design)
3. 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;}
</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://sauciu.blogspot.com&Exclusions=Anonymous,Greenlava&ShowHowMany=25&Order=alphabet&_callback=cCloud&_id=c57989056c453fead48afbbb0a0ea8b9&_render=json\"><\/script>");
</script></div>

Bạn thay (http://sauciu.blogspot.com) thành địa chỉ blog của bạn và thay (25) thành số người comment bạn muốn hiển thị trong tiện ích.

4. Save tiện ích lại là xong

Chúc bạn thành công

Tham khảo bloggersentral.com

0 nhận xét:

Đăng nhận xét

 
Toggle Footer