-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrcnaOKREK.js
85 lines (78 loc) · 4.16 KB
/
rcnaOKREK.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//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 okrek_recent(okrek) {
var commentsHtml;
commentsHtml = "<ul class=\"okrek_recent\">";
ntotal=0;
for (var i = 0; i < maxfeeds; i++) {
var commentlink, authorName, authorAvatar, avatarClass;
if (i == okrek.feed.entry.length) {
break;
}
if(ntotal>=numComments){
break;
}
var entry = okrek.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 + "\" target='_blank'><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 += "<span style=\"font-size:8px;display:block;text-align:right;" + hideCSS + "\">dimodifikasi oleh <a href=\"http://afandi.ok-rek.com\" target=\"_blank\">Afandi Kusuma</a><br>dari: way2blogging</span>";
document.write(commentsHtml);
}