Change background image
T o w o r l d

Go downThông điệp [Trang 1 trong tổng số 1 trang]

© FMvi.vn

Thu Sep 06, 2012 6:24 pm
Rim
Rim

Level 100

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:
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>
Thêm vào bên dưới:
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>
+Vào ACP (Bảng điều khiển của người quản lý) ----> Display ---> Pictures and Colors ---> Colors ---> CSS Stylesheet thêm vào:
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();
+Vào lại ACP (Bảng điều khiển của người quản lý) ----> Display ---> Templates ---> Quản lí tổng thể ---> Viewtopic_body nào:
Tìm cụm từ postbody thì nó sẽ cho kết quả:
Code:
<div class="postbody">
Thêm cho nó 1 id, hay nói 1 cách đơn giản là sửa nó lại thành:
Code:
    <div class="postbody" id='vote{postrow.displayed.U_POST_ID}'>
Bây giờ có thể ẩn nội dung cần ẩn với cách sử dụng thêm class='hidetag'vào cái cần ẩn.
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]
Để tiện lợi hơn thì tạo cho nó 1 button:
+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>
Thêm bên dưới nó:
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>
Bây giờ post thử 1 bài và sử dụng nút thanktag xem nào
Sẽ phân tích source sau
Code:
http://www.youtube.com/watch?v=NFIZwhGQ010
nguồn fmvi.org
https://toworld.forum-viet.com

Thích

Báo xấu [0]

Gửi một bình luận lên tường nhà Rim
Trả lời nhanh

Về Đầu TrangThông điệp [Trang 1 trong tổng số 1 trang]

  © FMvi.vn

« Xem bài trước | Xem bài kế tiếp »

Bài viết liên quan

    Quyền hạn của bạn:

    Bạn không có quyền trả lời bài viết