Thu Sep 06, 2012 6:24 pm
1. Đầu tiên là làm 1 nút vote không reload trang:
+Vào ACP (Bảng điều khiển của người quản lý) ----> Display ---> Templates ---> Quản lí tổng thể ---> Viewtopic_body
Thêm đoạn code sau vào 1 nơi tùy thích, hoặc đối với người mới thì tìm:
+Vào ACP (Bảng điều khiển của người quản lý) ----> Display ---> Templates ---> Quản lí tổng thể ---> Overall_header
Tìm </head> thêm phía trên nó :
Đã xong bước 1 (Tạo nút vote không reload trang)
2. Bấm vote hiện nội dung ẩn:
+ Để bấm vote hiện nội dung ẩn thì trước hết phải ẩn cái nội dung đó đi cái đã )
MXT đã thực hiện công việc ẩn nó đi rồi, có thể xem trong js bên trên:
Tìm cụm từ postbody thì nó sẽ cho kết quả:
Ví dụ trong khi viết bài muốn ẩn nội dung nào đó thì:
+Vào ACP (Bảng điều khiển của người quản lý) ----> Display ---> Templates ---> Post & tin nhắn ---> Posting_body tìm:
Sẽ phân tích source sau
+Vào ACP (Bảng điều khiển của người quản lý) ----> Display ---> Templates ---> Quản lí tổng thể ---> Viewtopic_body
Thêm đoạn code sau vào 1 nơi tùy thích, hoặc đối với người mới thì tìm:
- Code:
<td valign="middle">
{postrow.displayed.PROFILE_IMG} {postrow.displayed.PM_IMG} {postrow.displayed.EMAIL_IMG}<!-- BEGIN contact_field --> {postrow.displayed.contact_field.CONTENT}<!-- END contact_field --> {postrow.displayed.ONLINE_IMG}
</td>
- Code:
<td>
<!-- BEGIN switch_vote_active -->
<div id="leosmall{postrow.displayed.U_POST_ID}">
<table>
<tr>
<!-- BEGIN switch_vote -->
<script>jQuery(document).ready(function(){
jQuery('#vote{postrow.displayed.U_POST_ID} .hidetag').hide();
})</script>
<td><div class='votecong' onClick="voteajax({postrow.displayed.U_POST_ID}, 'plus');"></div></td>
<td><div class='votetru' onClick="voteajax({postrow.displayed.U_POST_ID}, 'minus');"></div></td>
<!-- END switch_vote -->
<td><span class='votetitle'>{postrow.displayed.switch_vote_active.L_VOTE_TITLE}</span></td>
</tr>
</table>
</div>
<!-- END switch_vote_active -->
</td>
+Vào ACP (Bảng điều khiển của người quản lý) ----> Display ---> Templates ---> Quản lí tổng thể ---> Overall_header
Tìm </head> thêm phía trên nó :
- Code:
<script type='text/javascript'>
function voteajax(a, b) {
jQuery.post(location.pathname + "?p_vote=" + a + "&eval=" + b);
jQuery('#vote' + a + ' .hidetag').show();
jQuery('#leosmall' + a).fadeOut('slow');
jQuery('#leosmall' + a).html('Đã vote');
jQuery('#leosmall' + a).fadeIn('slow');
}
</script>
- Code:
.votecong {
width:29px;
height:29px;
background: url(http://www.servimg.com/u/f30/16/00/79/58/voteba10.png);
background-position: 0px 0px;
cursor: pointer;
}
.votecong:hover {
background-position: 0px -32px;
}
.votetru {
width:29px;
height:29px;
background: url(http://www.servimg.com/u/f30/16/00/79/58/voteba10.png);
background-position: 0px -95px;
cursor:pointer;
}
.votetru:hover {
background-position: 0px -127px;
}
Đã xong bước 1 (Tạo nút vote không reload trang)
2. Bấm vote hiện nội dung ẩn:
+ Để bấm vote hiện nội dung ẩn thì trước hết phải ẩn cái nội dung đó đi cái đã )
MXT đã thực hiện công việc ẩn nó đi rồi, có thể xem trong js bên trên:
- Code:
jQuery('#vote{postrow.displayed.U_POST_ID} .hidetag').hide();
Tìm cụm từ postbody thì nó sẽ cho kết quả:
- Code:
<div class="postbody">
- Code:
<div class="postbody" id='vote{postrow.displayed.U_POST_ID}'>
Ví dụ trong khi viết bài muốn ẩn nội dung nào đó thì:
- Code:
[table border="1" class="hidetag"]
[tr]
[td]ẩn ẩn ẩn maria đề o zá quà ;)) [/td]
[/tr]
[/table]
+Vào ACP (Bảng điều khiển của người quản lý) ----> Display ---> Templates ---> Post & tin nhắn ---> Posting_body tìm:
- Code:
<button class="button2" onclick="selectWysiwyg(this,'font')" onmouseover="helpline('ft')" type="button" title="{L_BBCODE_FONT}"><img src="{PATH_IMG_FA}wysiwyg/font.png" alt="{L_BBCODE_FONT}" /></button>
- Code:
<button onclick="bbfontstyle('[table class=thankan][tr][td]Nội dung đã được ẩn bạn phải [b]Thank[/b] để xem nội dung.[/td][/tr][/table][table class=hidetag][tr][td]Nội dung đây','[/td][/tr][/table]');selectWysiwyg(this,'notes');return false">Thank Tag</button>
Sẽ phân tích source sau
- Code:
http://www.youtube.com/watch?v=NFIZwhGQ010