Demo:
Chú ý 1: (Cho newbies)
Để cài đặt được MOD này, các bạn phải kích hoạt Points trước, bằng cách: Modules >> Points and reputation >> Points system >> General options Chỉnh như sau: (In đậm tô đỏ là bắt buộc)
Activate points system : Yes
Display average points per message : Yes
"Points" field name : (Điền gì tùy bạn)
Display this field in : Profile & Messages (Check cả 2)
Display this field for users that are at least : Guests
Tham khảo hình sau: https://i.servimg.com/u/f81/17/70/31/89/per13.png
General >> Messages and e-mails >> Announcements:
General announcements options
Activate announcements : Yes
Announcements display : All pages
Scrolling : No
Tạo mới ()
Name : drop down
Content * :
General >> Forum >> Categories and forums >> Tạo chuyên mục mới: Tên : Linh Thú
Phân quyền:
Modules >> Points and reputation >> Points system >> Points management: Chỉnh như sau:
Users & Groups >> Users >> Profiles >> Tạo mới
View id mục này rồi thay vào profile_field_2_4 trong đoạn HTML ở bước dưới.
Tạo trang HTML mới (lưu 2 lần) [Đã fix lỗi Mắc cỡ ]
Nội dung đã được ẩn bạn phải bỏ phiếu đánh giá trước khi xem nội dung.
Ra ngoài 4r, vào chuyên mục vừa tạo >> Gửi bài mới, nội dung gì tùy bạn.
Sau khi tạo được topic mới, topic của bạn sẽ cón link dạng này: http://yupi.ace.st/t920-topic#4941
thì các bạn lấy số 920 thay vào số 927 trong đoạn HTML
Xong phần code shop để mua, giờ là phần cho hiển thị trong bài viết.
invision
punbb:
Đó là xong phần hiển thị.
Còn phần style nó thì các bạn tự làm nhé
VD: Cho đoạn này vào CSS:
Nguồn:CP
Chú ý 1: (Cho newbies)
Để cài đặt được MOD này, các bạn phải kích hoạt Points trước, bằng cách: Modules >> Points and reputation >> Points system >> General options Chỉnh như sau: (In đậm tô đỏ là bắt buộc)
Activate points system : Yes
Display average points per message : Yes
"Points" field name : (Điền gì tùy bạn)
Display this field in : Profile & Messages (Check cả 2)
Display this field for users that are at least : Guests
Tham khảo hình sau: https://i.servimg.com/u/f81/17/70/31/89/per13.png
General >> Messages and e-mails >> Announcements:
General announcements options
Activate announcements : Yes
Announcements display : All pages
Scrolling : No
Tạo mới ()
Name : drop down
Content * :
- Code:
<span class="name" id="userID" style="display:none">{USERLINK}</span>
<span style="display:none" id="numID"></span>
General >> Forum >> Categories and forums >> Tạo chuyên mục mới: Tên : Linh Thú
Phân quyền:
Modules >> Points and reputation >> Points system >> Points management: Chỉnh như sau:
Users & Groups >> Users >> Profiles >> Tạo mới
View id mục này rồi thay vào profile_field_2_4 trong đoạn HTML ở bước dưới.
Tạo trang HTML mới (lưu 2 lần) [Đã fix lỗi Mắc cỡ ]
Nội dung đã được ẩn bạn phải bỏ phiếu đánh giá trước khi xem nội dung.
Ra ngoài 4r, vào chuyên mục vừa tạo >> Gửi bài mới, nội dung gì tùy bạn.
Sau khi tạo được topic mới, topic của bạn sẽ cón link dạng này: http://yupi.ace.st/t920-topic#4941
thì các bạn lấy số 920 thay vào số 927 trong đoạn HTML
- Code:
$.post("/post?t=927&mode=reply", {
subject: b,
message: e,
post: 1
});
Xong phần code shop để mua, giờ là phần cho hiển thị trong bài viết.
invision
- click để xem:
Users & Groups >> Users >> Profiles (đây là bước cực kỳ quan trọng)
Đổi tên mục Giới tính thành Gender (đã có tên là Gender rồi thì thôi)
Đổi tên mục Tổng số bài viết thành Posts (đã có tên là Posts rồi thì thôi)
Đưa mục Gender lên trên mục Posts
Tạo javascript mới, đặt In the topics, nội dung như sau:
- Code:
function miarank(a, b, x, y) {
up = 60;
cong = 0;
pet = x;
lv = Math.ceil(b / up) + cong;
exp = Math.round(100 / up * (b % up));
9 < lv && (lv = 9, exp = 99);
return '<fieldset align="center" class="milevel"><img width="120px" height="120px" src="http://i69.servimg.com/u/f69/17/70/31/89/' + pet + '0' + lv + '10.gif"></div><div align="center" style="width:140px;"> <span style="font-size:10px!important;font-family:Tahoma;font-weight:normal;">Linh thú cấp độ: <b class="level">' + lv + '</b> (+' + exp + '%)</span><fieldset class="miachar"><img src="http://i15.servimg.com/u/f15/17/70/31/89/981010.gif" width="' + exp + '%" height="9px"><img src="http://i15.servimg.com/u/f15/17/70/31/89/871010.gif" width="2px" height="9px"></fieldset></div></fieldset>'
}
$(function () {
$(".post-container").each(function () {
var a = $(this).find(".postprofile-details dd:last").html(),
a = a.substring(a.indexOf("<img")),
b = a.substring(0, a.indexOf('">') + 2),
a = a.substring(a.indexOf("Posts<") + 21),
a = a.substring(0, a.indexOf("<br"));
var x = $(this).find(".postprofile-details dd:last").html(),
x = x.substring(x.indexOf("[") + 1),
y = x.substring(0, x.indexOf(']') - 0);
$(this).find('.postprofile-details.postdetails').children('dd:last').after(miarank(b, a, y, x))
});
});
punbb:
- click xem cách 1:
Users & Groups >> Users >> Profiles (đây là bước cực kỳ quan trọng)
Không bắt buộc đổi tên.
Sắp xếp các mục theo thứ tự sau:
Posts
Points
Reputation
Pet
nhớ là đưa 4 mục này lên đầu tiên.
Sửa lại HTML (đây cũng là bước cực kỳ quan trọng)
Quay lại trang HTML các bạn đã tạo, tìm đoạn
- Code:
var f = '[' + $(".thudo1").html() + ']';
- Code:
var f = $(".thudo1").html();
- Code:
<script>miarank(<!-- BEGIN profile_field -->'{postrow.displayed.profile_field.CONTENT}',<!-- END profile_field -->1);</script>
- Code:
function miarank(Posts, Hcoins, Reputation, Avatar) {
var d = (Posts * 5 + Hcoins * 1);
var h = ((Reputation * 10) + Math.floor((Posts * 2) + (Hcoins * 0)));
var ff = (Posts * 2 + Hcoins * 2 + Reputation * 2);
var f = Math.floor((Math.floor(ff)) / 1900);
var e = ((d + h + f) / 18000);
var g = hs = Math.floor(e + parseInt(1));
var up = 10;
var exp = Math.round(100 / up * (e % up));
if (hs > 9) {
hs = 9
}
document.write('<fieldset class="milevel"><legend><font color="red"><b>Cấp độ : ' + g + '</b></font> </legend><span class="pet" align="center" style="width:140px;margin-top:-4px;padding-left:5px"><img width="130px" height="130px" src="http://i69.servimg.com/u/f69/17/70/31/89/' + Avatar + '0' + hs + '10.gif"><fieldset class="miachar"><img src="http://i15.servimg.com/u/f15/17/70/31/89/981010.gif" width="' + exp + '%" height="9px"><img src="http://i15.servimg.com/u/f15/17/70/31/89/871010.gif" width="2px" height="9px"></fieldset></span></fieldset>')
}
- click để xem cách 2:
- Users & Groups >> Users >> Profiles (đây là bước cực kỳ quan trọng)
Đổi tên mục Giới tính thành Gender (đã có tên là Gender rồi thì thôi)
Đổi tên mục Tổng số bài viết thành Posts (đã có tên là Posts rồi thì thôi)
Đưa mục Gender lên trên mục Posts
Tạo javascript mới, đặt In the topics, nội dung như sau:
- Code:
function miarank(a, b, x, y) {
up = 60;
cong = 0;
pet = x;
lv = Math.ceil(b / up) + cong;
exp = Math.round(100 / up * (b % up));
9 < lv && (lv = 9, exp = 99);
return '<fieldset align="center" class="milevel"><img width="120px" height="120px" src="http://i69.servimg.com/u/f69/17/70/31/89/' + pet + '0' + lv + '10.gif"></div><div align="center" style="width:140px;"> <span style="font-size:10px!important;font-family:Tahoma;font-weight:normal;">Linh thú cấp độ: <b class="level">' + lv + '</b> (+' + exp + '%)</span><fieldset class="miachar"><img src="http://i15.servimg.com/u/f15/17/70/31/89/981010.gif" width="' + exp + '%" height="9px"><img src="http://i15.servimg.com/u/f15/17/70/31/89/871010.gif" width="2px" height="9px"></fieldset></div></fieldset>'
}
$(function () {
$(".post").each(function () {
var a = $(this).find(".user .user-info").html(),
a = a.substring(a.indexOf("<img")),
b = a.substring(0, a.indexOf('">') + 2),
a = a.substring(a.indexOf("Posts<") + 21),
a = a.substring(0, a.indexOf("<br"));
var x = $(this).find(".user .user-info").html(),
x = x.substring(x.indexOf("[") + 1),
y = x.substring(0, x.indexOf(']') - 0);
$(this).find('.postmain').children('.user-ident').after(miarank(b, a, y, x))
});
});
Đó là xong phần hiển thị.
Còn phần style nó thì các bạn tự làm nhé
VD: Cho đoạn này vào CSS:
- Code:
.michar > fieldset{font-size:10px;font-weight:700;margin-right:20px}
.miachar{text-align:left;white-space:nowrap;border:/*#add8e6*/#F25333 1px solid;padding:1px}
.memchar{height:130px;width:100%;background:no-repeat center bottom}
.milevel{position:absolute;border-radius:6px 6px;white-space:nowrap;width:140px;font-size:11px;border:2px dotted #666;padding:5px}
Nguồn:CP
Được sửa bởi noname2103 ngày Fri Jan 10, 2014 9:23 pm; sửa lần 1.