1 [FMvi.Org] Shop avatar hoạt hình tự cập nhật 100% 21/4/2012, 8:45 am
duongcam.ict
Admin
Bước 1: ACP - Ganeral - Forum - Categories and forums
Click vào nút Add để tạo một chuyên mục mới để lưu hóa đơn mua Item.
Sau khi tạo xong chuyên mục, bạn ghi nhớ số thự tự chuyên mục đó để thực hiện các bước tiếp theo. Ví dụ link của Fmvi là http://www.fmvi.org/f30-hoa-don-mua-avatar thì số thứ tự là 30.
Bước 2: ACP - Users & Groups - Users - Profiles - Profile fields
Click vào nút Add để tạo khung dữ liệu cho avatar.
Sau khi làm xong bước này, các bạn vào trang chỉnh sửa Profile ( Ví dụ FMvi: http://www.fmvi.org/profile?mode=editprofile ). Tìm id của input avatar-dulieu bằng cách:
Bạn ghi nhớ dòng chữ đằng sau id=" như ở ví dụ trên là profile_field_13_1 để thực hiện các bước tiếp theo.
Bước 3: ACP - Display - Templates - Ganeral - viewtopic_body
Bước này sẽ sửa templates của forum, vì thế các bạn cần cẩn thục lưu lại code gốc trước khi thao tác. Tìm đoạn code sau ( Ctrl+F ):
Thay đoạn code trên bằng:
Cũng trong viewtopic_body, các bạn tìm đoạn:
... và thay nó bằng:
Đến bước này, các bạn có thể kiểm tra xem mình đã làm đúng chưa bằng cách vào trang chỉnh sửa Profile ( Ví dụ FMvi: http://www.fmvi.org/profile?mode=editprofile ). Nhập dòng code sau vào input avatar-dulieu:
Sau đó bạn mở bài viết của mình lên, nếu Avatar của bạn chuyển thành Avatar anime là thành công.
Bước 4: ACP - Modules - HTML & JAVASCRIPT - Javascript codes management
Click vào nút Create a new javascript, để tạo file javascript nhằm xóa input avatar-dulieu đi, và thành viên sẽ không thể chỉnh sửa nó nữa.
Lưu ý: Để sử dụng Javascript codes management bạn phải cập nhật Templates: http://help.forumotion.com/t92693-new-update-javascript-code-management
Click vào nút Add để tạo một chuyên mục mới để lưu hóa đơn mua Item.
- Choose the kind of forum you want : forum
- Forum name : Hóa đơn mua Item Avatar anime
Sau khi tạo xong chuyên mục, bạn ghi nhớ số thự tự chuyên mục đó để thực hiện các bước tiếp theo. Ví dụ link của Fmvi là http://www.fmvi.org/f30-hoa-don-mua-avatar thì số thứ tự là 30.
Bước 2: ACP - Users & Groups - Users - Profiles - Profile fields
Click vào nút Add để tạo khung dữ liệu cho avatar.
- Type : Text field
- Name : avatar-dulieu
- Necessarily filled ? : No
- Display : Messages
- Display type : Text
- Who can modify the profile field value ? : Moderators & Member himself
- Display this field for users that are at least : Guests
Sau khi làm xong bước này, các bạn vào trang chỉnh sửa Profile ( Ví dụ FMvi: http://www.fmvi.org/profile?mode=editprofile ). Tìm id của input avatar-dulieu bằng cách:
- Cách 1: Tìm id bằng các view mã nguồn (Ctrl+U) và tìm avatar-dulieu (Ctrl+F)
Nó sẽ có dạng như sau- Code:
<span style="color:#000000;">avatar-dulieu</span>: </span></td><td class="gensmall row2"><input type="text" class="post" id="profile_field_13_1" name="profile_field_13_1" style="width:250px" value="" />
- Cách 2: Dùng firebug cho Firefox (add-on) với chức năng Thăm dò phần tử hoặc chức năng Kiểm tra phần tử của Chrome hoặc Kiểm tra thành phần của Opera trong menu chuột phải.
Bạn ghi nhớ dòng chữ đằng sau id=" như ở ví dụ trên là profile_field_13_1 để thực hiện các bước tiếp theo.
Bước 3: ACP - Display - Templates - Ganeral - viewtopic_body
Bước này sẽ sửa templates của forum, vì thế các bạn cần cẩn thục lưu lại code gốc trước khi thao tác. Tìm đoạn code sau ( Ctrl+F ):
- Code:
{postrow.displayed.POSTER_AVATAR}
Thay đoạn code trên bằng:
- Code:
<div id="baivongshop{postrow.displayed.U_POST_ID}" style="display:none">
<!-- BEGIN profile_field -->
<span class="fmviShopauto">
{postrow.displayed.profile_field.LABEL}{postrow.displayed.profile_field.CONTENT}
</span>
<!-- END profile_field -->
</div>
<div class="bvavatar">
{postrow.displayed.POSTER_AVATAR}
</div>
<script>
$(function() {
if ($("#baivongshop{postrow.displayed.U_POST_ID} span.fmviShopauto:contains('avatar-dulieu')").text().length > 25) {
$("#baivongshop{postrow.displayed.U_POST_ID}").html('<object width="125" height="180" type="application/x-shockwave-flash" data="http://my.go.vn/swf/avatar2.swf" id="avatar_flash_object" style="visibility: visible;"><param name="flashvars" value="itempath=http://farm01.gox.vn/avatar/store/avatar_part_item/&browser=Other&itemlist=' + $("#baivongshop{postrow.displayed.U_POST_ID} span.fmviShopauto:contains(\'avatar-dulieu\')").text().slice($("#baivongshop{postrow.displayed.U_POST_ID} span.fmviShopauto:contains(\'avatar-dulieu\')").text().indexOf("dulieu") + 8) + '"></object>').show().next().remove();
};
});
</script>
Cũng trong viewtopic_body, các bạn tìm đoạn:
- Code:
<!-- BEGIN profile_field -->
{postrow.displayed.profile_field.LABEL} {postrow.displayed.profile_field.CONTENT}{postrow.displayed.profile_field.SEPARATOR}
<!-- END profile_field -->
... và thay nó bằng:
- Code:
<!-- BEGIN profile_field -->
<div class="fmviPro5">
{postrow.displayed.profile_field.LABEL}{postrow.displayed.profile_field.CONTENT}{postrow.displayed.profile_field.SEPARATOR}
</div>
<!-- END profile_field -->
Đến bước này, các bạn có thể kiểm tra xem mình đã làm đúng chưa bằng cách vào trang chỉnh sửa Profile ( Ví dụ FMvi: http://www.fmvi.org/profile?mode=editprofile ). Nhập dòng code sau vào input avatar-dulieu:
- Code:
57,11497|47,11462|50,11789|49,10853|64,12636|51,11473|48,12290|58,12170|66,11442
Sau đó bạn mở bài viết của mình lên, nếu Avatar của bạn chuyển thành Avatar anime là thành công.
Bước 4: ACP - Modules - HTML & JAVASCRIPT - Javascript codes management
Click vào nút Create a new javascript, để tạo file javascript nhằm xóa input avatar-dulieu đi, và thành viên sẽ không thể chỉnh sửa nó nữa.
- Title * : Xóa input dữ liệu Avatar Anime
- Placement : In all the pages
- Javascript Code * :
- punBB:
- Code:
$(function () {
$("img[src$=/.gif], .frm-set dl:contains('avatar-dulieu'), .fmviPro5:contains('avatar-dulieu')").remove();
});
- phpBB2:
- Code:
$(function () {
if (location.pathname === "/profile") {
$("td.row1:contains('avatar-dulieu')").parent().remove();
};
$("img[src$=/.gif], .fmviPro5:contains('avatar-dulieu')").remove();
});
Lưu ý: Để sử dụng Javascript codes management bạn phải cập nhật Templates: http://help.forumotion.com/t92693-new-update-javascript-code-management
Còn tiếp...