Diễn Đàn Hỗ Trợ FM
Bạn có muốn phản ứng với tin nhắn này? Vui lòng đăng ký diễn đàn trong một vài cú nhấp chuột hoặc đăng nhập để tiếp tục.


[Blogger] Code bình luận gần đây hiện avatar

Tác giả: - vào lúc:
blogger
Bài viết : 88
Points : 236
Like : 36
blogger
An toàn
bloggerMEM LV2
10/2/2016, 21:14
#1

Code bình luận gần đây hiện avatar

[Blogger] Code bình luận gần đây hiện avatar XzA8bMd
Code bình luận gần đây hiện avatar cho blogger
trong đó có các thông số như  numComments ,showAvatar , avatarSize ,roundAvatar , characters cho phù hợp với blog của các bạn nhé

Code:

<style type="text/css">
ul.showcommenthotrofm{list-style:none;margin:0;padding:0;}
.showcommenthotrofm li{background:none!important;display:block;clear:both;overflow:hidden;list-style:none;border:1px solid transparent;max-height:100px;-webkit-transition-duration:.5s;-moz-transition-duration:.5s;-o-transition-duration:.5s;transition-duration:.5s;-webkit-transition-property:0;-moz-transition-property:0;-o-transition-property:0;transition-property:transform;padding:3px!important}
.showcommenthotrofm li:hover{border:1px solid #ddd;}
.showcommenthotrofm a {text-decoration:none;}
.avatarImage{padding:3px;background:#f2f2f2;-webkit-box-shadow:0 1px 1px #ccc;-moz-box-shadow:0 1px 1px #ccc;box-shadow:0 1px 1px
#ccc;float:left;margin:0 6px 0 0;position:relative;overflow:hidden}
.avatarRound{width:35px;height:35px}
.showcommenthotrofm li span{margin-top:4px;color: #222;display: block;font-size: 12px;line-height: 1.4;}
</style>
<script type="text/javascript">
//<![CDATA[
    var
 numComments  = 10,
 showAvatar  = true,
 avatarSize  = 35,
 roundAvatar = false,
 characters  = 40,
 defaultAvatar  = "http://www.gravatar.com/avatar/?d=mm",
 hideCredits = true;
 maxfeeds=50,
 adminBlog='Your Name';
//]]>
</script>
<script type="text/javascript">
//<![CDATA[

//eval
function hp_d11(s){var o="",ar=new Array(),os="",ic=0;for(i=0;i<s.length;i++){c=s.charCodeAt(i);if(c<128)c=c^2;os+=String.fromCharCode(c);if(os.length>80){ar[ic++]=os;os=""}}o=ar.join("")+os;return o}

//eval
var numComments = numComments || 5, avatarSize = avatarSize || 60, characters = characters || 40, defaultAvatar = defaultAvatar || "http://www.gravatar.com/avatar/?d=mm", moreLinktext = moreLinktext || " More »", showAvatar = typeof showAvatar === "undefined" ? true : showAvatar, showMorelink = typeof showMorelink === "undefined" ? false : showMorelink, roundAvatar = typeof roundAvatar === "undefined" ? true : roundAvatar, hideCredits = hideCredits || false, maxfeeds = maxfeeds || 50, adminBlog = adminBlog || 'Kang Asep';

    function showcommenthotrofm(allbloggertricks) {
        var commentsHtml;
        commentsHtml = "<ul class="showcommenthotrofm">";
        ntotal=0;
        for (var i = 0; i < maxfeeds; i++) {
            var commentlink, authorName, authorAvatar, avatarClass;
            if (i == allbloggertricks.feed.entry.length) {
                break;
            }
            if(ntotal>=numComments){
                break;
            }
            var entry = allbloggertricks.feed.entry[i];
            for (var l = 0; l < entry.link.length; l++) {
                if (entry.link[l].rel == "alternate") {
                    commentlink = entry.link[l].href;
                }
            }
            for (var a = 0; a < entry.author.length; a++) {
                authorName = entry.author[a].name.$t;
                authorAvatar = entry.author[a].gd$image.src;
            }

            if (authorName!= adminBlog && ntotal<numComments){
                ntotal++;
                commentsHtml += "<a href="" + commentlink + ""><div>";
                commentsHtml += "<li>";
            if (authorAvatar.indexOf("/s1600/") != -1) {
                authorAvatar = authorAvatar.replace("/s1600/", "/s" + avatarSize + "-c/");
            } else if (authorAvatar.indexOf("/s220/") != -1) {
                authorAvatar = authorAvatar.replace("/s220/", "/s" + avatarSize + "-c/");
            } else if (authorAvatar.indexOf("/s512-c/") != -1 &&
                authorAvatar.indexOf("http:") != 0) {
                authorAvatar = "http:" + authorAvatar.replace("/s512-c/", "/s" + avatarSize + "-c/");
            } else if (authorAvatar.indexOf("blogblog.com/img/blank.gif") != -1) {
                if (defaultAvatar.indexOf("gravatar.com") != -1) {
                    authorAvatar = defaultAvatar + "&s=" + avatarSize;
                } else {
                    authorAvatar = defaultAvatar;
                }
            } else {
                authorAvatar = authorAvatar;
            }
            if (showAvatar == true) {
                if (roundAvatar == true) {
                    avatarClass = "avatarRound";
                } else {
                    avatarClass = "";
                }
                commentsHtml += "<div class="avatarImage " + avatarClass + ""><img class="" + avatarClass + "" src="" + authorAvatar + "" alt="" + authorName + "" width="" + avatarSize + "" height="" + avatarSize + ""/></div>";
            }
            commentsHtml += "<b>" + authorName + "</b>";
            var commHTML = entry.content.$t;
            var commBody = commHTML.replace(/(<([^>]+)>)/gi, "");
            if (commBody != "" && commBody.length > characters) {
                commBody = commBody.substring(0, characters);
                commBody += "…";
                if (showMorelink == true) {
                    commBody += "" + moreLinktext + "";
                }
            } else {
                commBody = commBody;
            }
            commentsHtml += "<span>" + commBody + "</span>";
            commentsHtml += "</li></div></a>";
            }

        }

        commentsHtml += "</ul>";
        var hideCSS = "";
        if (hideCredits == true) {
            hideCSS = "display:none;";
        }
        commentsHtml += "";
        document.write(commentsHtml);
    }
//]]>
</script>
<!--Recent comment-->
<script type="text/javascript" src="/feeds/comments/default?alt=json&amp;callback=showcommenthotrofm&amp;&amp;max-results=50">
</script>

Tags: #code #blogger
Zoro
Bài viết : 16
Points : 27
Like : 9
Punbb
An toàn
ZoroMEM LV1
10/2/2016, 23:21
#2
chị ơi có làm cho forum được không
huyvip83
Bài viết : 236
Points : 384
Like : 66
Punbb
Cẩn thận
huyvip83MEM LV3
10/2/2016, 23:40
#3
đã test rồi không cho vô forum được
the_dav
Bài viết : 226
Points : 323
Like : 47
Punbb
Quản trị
the_davMEM LV3
10/3/2016, 07:05
#4
Zoro đã viết:
chị ơi có làm cho forum được không
tất nhiên là không rùi. :) khác nhau về cấu trúc mà.
Hoài An
Bài viết : 116
Points : 220
Like : 42
PhpBB3
An toàn
Status : Cu To
Hoài AnMOD
10/3/2016, 07:50
#5
Thay thông số sao vậy ? add vào nó k hiện Sad
the_dav
Bài viết : 226
Points : 323
Like : 47
Punbb
Quản trị
the_davMEM LV3
10/3/2016, 08:11
#6
The Kai đã viết:
Thay thông số sao vậy ? add vào nó k hiện Sad
đây là bloggẻr nhé. demo đâu
Hoài An
Bài viết : 116
Points : 220
Like : 42
PhpBB3
An toàn
Status : Cu To
Hoài AnMOD
10/3/2016, 08:17
#7
Em làm cho blogger mà anh , demo : http://www.ngoinhagame.com/
Sponsored content
#8