Menu
Code:
<!-- BEGIN profile_field -->
{postrow.displayed.profile_field.LABEL}{postrow.displayed.profile_field.CONTENT}{postrow.displayed.profile_field.SEPARATOR}
<!-- END profile_field -->
Code:
<!-- BEGIN profile_field -->
<p class="profile_field_mess">
{postrow.displayed.profile_field.LABEL}{postrow.displayed.profile_field.CONTENT}{postrow.displayed.profile_field.SEPARATOR}
</p>
<!-- END profile_field -->
Code:
<div class="rank_mess"></div>
Code:
/*!
* zzRank v0.2.1 by Zzbaivong <devs.forumvi.com>
* Thêm huân chương dựa theo số lượng bài viết
*/
$(function() {
var data_rank = {
10: {
title: "10 bài viết",
desc: "Huân chương tưởng thưởng cho thành viên tích cực, đăng 10 bài viết trở lên. Điểm thưởng tối thiểu là 20.",
icon: "http://blog.uhm.vn/emo/laluot/2.gif",
point: 20
},
50: {
title: "50 bài viết",
desc: "Huân chương tưởng thưởng cho thành viên tích cực, đăng 50 bài viết trở lên. Điểm tưởng lớn hơn hoặc bằng số bài viết.",
icon: "http://blog.uhm.vn/emo/laluot/5.gif",
point: ">"
},
100: {
title: "100 bài viết",
desc: "Huân chương tưởng thưởng cho thành viên tích cực, đăng 100 bài viết trở lên. Được cảm ơn từ 10 lần trở lên.",
icon: "http://blog.uhm.vn/emo/laluot/20.gif",
thank: 10
},
500: {
title: "500 bài viết",
desc: "Huân chương tưởng thưởng cho thành viên tích cực, đăng 500 bài viết trở lên. Điểm tưởng lớn hơn hoặc bằng số bài viết. Được cảm ơn từ 99 lần trở lên.",
icon: "http://blog.uhm.vn/emo/laluot/10.gif",
point: ">",
thank: 99
},
x500: {
title: "Spamer",
desc: "Thành viên đăng 500 bài viết trở lên, nhưng điểm thưởng thấp hơn số bài viết.",
icon: "http://blog.uhm.vn/emo/laluot/24.gif",
point: "<"
}
};
function checkif(key, check, val, post) {
var cPost = data_rank[key][check];
if (($.type(cPost) === "number" && cPost <= val) || ($.type(cPost) === "string" && cPost === ">" && val >= post) || ($.type(cPost) === "string" && cPost === "<" && val < post)) {
return true;
} else {
return false;
}
}
function getNumber(t, txt) {
return parseInt($(t).closest(".post").find(".profile_field_mess:contains('" + txt + " : ')").text().match(/\d+/)[0], 10);
}
$(".rank_mess").html(function() {
var all = "";
var post_mess = getNumber(this, "Posts"),
point_mess = getNumber(this, "Points"),
thank_mess = getNumber(this, "Thanked");
$.each(data_rank, function(key, val) {
var point = data_rank[key].point,
thank = data_rank[key].thank;
if (post_mess >= parseInt(key.match(/\d+/)[0], 10)) {
if ((point === undefined && thank === undefined) || (point !== undefined && thank === undefined && checkif(key, "point", point_mess, post_mess)) || (point === undefined && thank !== undefined && checkif(key, "thank", thank_mess, post_mess)) || (point !== undefined && checkif(key, "point", point_mess, post_mess) && thank !== undefined && checkif(key, "thank", thank_mess, post_mess))) {
all += '<fieldset><legend>' + data_rank[key].title + '</legend><img src="' + data_rank[key].icon + '" alt="' + data_rank[key].title + '" title="' + data_rank[key].desc + '" /></fieldset>';
}
}
});
return all;
});
});
Code:
// Đây là thiết lập cho một rank, ở một mức bài viết
10: { // 10 là số bài tối thiểu để đạt được huân chương
title: "10 bài viết", // Ghi chú ngắn gọn cho huân chương
desc: "Huân chương tưởng thưởng cho thành viên tích cực, đăng 10 bài viết trở lên.", // Ghi chú chi tiết cho huân chương
icon: "http://blog.uhm.vn/emo/laluot/2.gif" // Ảnh huân chương sẽ hiển thị
}
Code:
point: ">" // point >= post
point: "<" // point < post
point: 3 // point >= 3
|
|