Đánh giá vài viết với Like & Dislike cho phpBB2 & punBB
Forum 4ALL - Mái Nhà Tình Bạn
Lời ngỏ
Chào mừng các bạn đến với Forum 4ALL - Mái Nhà Tình Bạn. Mái Nhà Tình Bạn ra đời với mong muốn sẽ là nơi để mọi người quy tụ cùng nhau học hỏi, thư giãn và chia sẻ mọi nỗi buồn vui trong cuộc sống, là nơi tình bạn được vinh danh, cho dù đó chỉ là những con người ảo nhưng ẩn bên trong là những trái tim đầy ấp chân tình và niềm tin yêu đáng quý. Chúc các bạn luôn hạnh phúc và thành công trong cuộc sống.
Chú ý
» Hãy đăng ký hoặc đăng nhập để có thể xem toàn bộ nội dung các chuyên mục. » Xin xem phần nội quy và trợ giúp để biết cách sử dụng diễn đàn. » Rất mong tìm kiếm trước khi đặt câu hỏi. » Yêu cầu viết tiêu để cụ thể rõ ràng. Không sử dụng ngôn từ thiếu văn hóa trên diễn đàn. » Báo danh hoặc tìm kiếm nick chat tại đây.
THÔNG BÁO: 1. Yêu cầu không xóa tên người thiết kế và rip skins bất luận là skins nào. 4all sẽ không hỗ trợ những forum làm như thế.
2. Những bài viết với tiêu đề mơ hồ, không rõ ràng kiểu như "cứu em với", "giúp mình chút", cho hỏi cái này", "hỏi một tí" v.v... sẽ bị xóa.
Tuổi : 24 Số bài gửi : 44 Sinh nhật : 01/07/1999 Đến từ : http://vn-answer.123.st Tham gia : 04/09/2012 Châm ngôn sống : http://vn-answer.123.st Thankes : 12 Xu 4all : 124
Tiêu đề: Đánh giá vài viết với Like & Dislike cho phpBB2 & punBB
Tiêu đề:
Chức năng:
Hiển thị số lượt đánh giá chuyên nghiệp.
Thực hiện nhiều đánh giá một lúc mà không bị chuyển trang.
Ghi chú: Code được viết bởi [You must be registered and logged in to see this link.], tham khảo ý tưởng của [You must be registered and logged in to see this link.] và [You must be registered and logged in to see this link.]. Nếu bạn muốn sao chép hướng dẫn này đi nơi khác vui lòng không thay đổi bất kỳ thành phần nào trong code và phải ghi bản quyền thuộc [You must be registered and logged in to see this link.]
Bước 1: Tìm đoạn mã sau trong viewtopic_body và xóa nó đi:
Code:
<!-- BEGIN switch_vote_active --> <div class="vote gensmall"> <!-- BEGIN switch_vote --> <div class="vote-button"> <a href="{postrow.displayed.switch_vote_active.switch_vote.U_VOTE_PLUS}">+</a> </div> <!-- END switch_vote --> <!-- BEGIN switch_bar --> <div class="vote-bar" title="{postrow.displayed.switch_vote_active.L_VOTE_TITLE}"> <!-- BEGIN switch_vote_plus --> <div class="vote-bar-plus" style="height:{postrow.displayed.switch_vote_active.switch_bar.switch_vote_plus.HEIGHT_PLUS}px;"> </div> <!-- END switch_vote_plus --> <!-- BEGIN switch_vote_minus --> <div class="vote-bar-minus" style="height:{postrow.displayed.switch_vote_active.switch_bar.switch_vote_minus.HEIGHT_MINUS}px;"> </div> <!-- END switch_vote_minus --> </div> <!-- END switch_bar --> <!-- BEGIN switch_no_bar --> <div title="{postrow.displayed.switch_vote_active.L_VOTE_TITLE}" class="vote-no-bar"> ---- </div> <!-- END switch_no_bar --> <!-- BEGIN switch_vote --> <div class="vote-button"> <a href="{postrow.displayed.switch_vote_active.switch_vote.U_VOTE_MINUS}">-</a> </div> <!-- END switch_vote --> </div> <!-- END switch_vote_active -->
... và đặt một trong hai đoạn code dưới đây vào vị trí muốn hiển thị, nếu bạn chưa có kinh nghiệm chỉnh sửa templates thì tốt nhất nên thay đoạn này vào vị trí vừa xóa:
+ Đặt bên phải:
Code:
<span class="loadFMvi"> <img alt="Loading" src="http://farm04.go.vn/photo/data/20111012/10798851/946D73AB7E9F949624C2BF756D1ED794.gif" /> </span> <div class="voteTopic"> <!-- BEGIN switch_vote_active --> <div class="vote gensmall"> <!-- BEGIN switch_vote --> <div class="vote-button"> <a href="{postrow.displayed.switch_vote_active.switch_vote.U_VOTE_PLUS}">+</a> </div> <!-- END switch_vote --> <!-- BEGIN switch_bar --> <div class="vote-bar" title="{postrow.displayed.switch_vote_active.L_VOTE_TITLE}"> <!-- BEGIN switch_vote_plus --> <div class="vote-bar-plus" style="height:{postrow.displayed.switch_vote_active.switch_bar.switch_vote_plus.HEIGHT_PLUS}px;"> </div> <!-- END switch_vote_plus --> <!-- BEGIN switch_vote_minus --> <div class="vote-bar-minus" style="height:{postrow.displayed.switch_vote_active.switch_bar.switch_vote_minus.HEIGHT_MINUS}px;"> </div> <!-- END switch_vote_minus --> </div> <!-- END switch_bar --> <!-- BEGIN switch_no_bar --> <div title="{postrow.displayed.switch_vote_active.L_VOTE_TITLE}" class="vote-no-bar"> ---- </div> <!-- END switch_no_bar --> <!-- BEGIN switch_vote --> <div class="vote-button"> <a href="{postrow.displayed.switch_vote_active.switch_vote.U_VOTE_MINUS}">-</a> </div> <!-- END switch_vote --> </div> <!-- END switch_vote_active --> </div>
+ Đặt bên trái:
Code:
<div class="voteTopic"> <!-- BEGIN switch_vote_active --> <div class="vote gensmall"> <!-- BEGIN switch_vote --> <div class="vote-button"> <a href="{postrow.displayed.switch_vote_active.switch_vote.U_VOTE_PLUS}">+</a> </div> <!-- END switch_vote --> <!-- BEGIN switch_bar --> <div class="vote-bar" title="{postrow.displayed.switch_vote_active.L_VOTE_TITLE}"> <!-- BEGIN switch_vote_plus --> <div class="vote-bar-plus" style="height:{postrow.displayed.switch_vote_active.switch_bar.switch_vote_plus.HEIGHT_PLUS}px;"> </div> <!-- END switch_vote_plus --> <!-- BEGIN switch_vote_minus --> <div class="vote-bar-minus" style="height:{postrow.displayed.switch_vote_active.switch_bar.switch_vote_minus.HEIGHT_MINUS}px;"> </div> <!-- END switch_vote_minus --> </div> <!-- END switch_bar --> <!-- BEGIN switch_no_bar --> <div title="{postrow.displayed.switch_vote_active.L_VOTE_TITLE}" class="vote-no-bar"> ---- </div> <!-- END switch_no_bar --> <!-- BEGIN switch_vote --> <div class="vote-button"> <a href="{postrow.displayed.switch_vote_active.switch_vote.U_VOTE_MINUS}">-</a> </div> <!-- END switch_vote --> </div> <!-- END switch_vote_active --> </div> <span class="loadFMvi"> <img alt="Loading" src="http://farm04.go.vn/photo/data/20111012/10798851/946D73AB7E9F949624C2BF756D1ED794.gif" /> </span>
Bước 2: Chèn một trong hai đoạn mã sau đây vào cuối viewtopic_body:
+ Đặt bên phải:
Code:
<style type="text/css"> .voteTopic { padding: 4px; background: #fff; color: #000; border:1px solid # a0b0c0; font - size: 12px; font - weight: bold; margin: 0 10px; height: 17px; display: inline; } .voteTopic a { cursor: default; vertical - align: middle; } .voteTopic span, .voteTopic a { display: inline; } .voteTopic .plusFMvi { background: url(http://i48.servimg.com/u/f48/16/58/89/73/like_b12.png) no-repeat scroll center center transparent; padding: 0 12px; } .voteTopic .xplusFMvi { background: url(http://i48.servimg.com/u/f48/16/58/89/73/like_n11.png) no-repeat scroll center center transparent; padding: 0 12px; } .xminusFMvi { background: url(http://i48.servimg.com/u/f48/16/58/89/73/dislik16.png) no-repeat scroll center center transparent; padding: 0 12px; } .voteTopic .minusFMvi{ background: url(http://i48.servimg.com/u/f48/16/58/89/73/dislik15.png) no-repeat scroll center center transparent; padding: 0 12px; } .loadFMvi, .vote { display:none; margin: 0; } </style> <script type="text/javascript"> $('.voteTopic').each(function (index) { $(this).prev().attr('alt', 'vote'+index); $(this).before('<iframe name="vote' + index + '" height="0px" width="0px" frameborder="0"></iframe>'); $(this).attr('alt', 'vote'+index).prepend('<span alt="vote'+index+'" class="xplusFMvi"></span><span class="cong" alt="vote'+index+'">0</span> <span alt="vote'+index+'" class="xminusFMvi"></span><span class="tru" alt="vote'+index+'">0</span>'); var altthis = $(this).attr('alt'); var plink = $(this).find('a[href$="eval=plus"]').attr('href'); var mlink = $(this).find('a[href$="eval=minus"]').attr('href'); if ($(this).find('.vote a').length > 0) { $('.xplusFMvi[alt="'+altthis+'"]').replaceWith('<a style="display: inline-block" target="' + altthis + '" href="'+plink+'"><span alt="'+altthis+'" class="plusFMvi"></span></a>'); $('.xminusFMvi[alt="'+altthis+'"]').replaceWith('<a target="' + altthis + '" href="'+mlink+'"><span alt="'+altthis+'" class="minusFMvi"></span></a>'); }; if ($(this).find('.vote-bar').length > 0) { var z = $(this).find('.vote-bar').attr('title').split(' '); var m = parseInt(z[3].replace(/%/, '')) / 100; var n = parseInt(z[4].replace(/\(/, '')); c = String(Math.round(n * m)); d = String(n - c); $('.cong[alt="'+altthis+'"]').replaceWith('<span class="cong" alt="'+altthis+'">'+c+'</span>'); $('.tru[alt="'+altthis+'"]').replaceWith('<span class="tru" alt="'+altthis+'">'+d+'</span>'); }; $('.plusFMvi').click(function () { var altcong = $(this).attr('alt'); var x = Number($('.cong[alt="'+altcong+'"]').text())+1; $('.plusFMvi[alt="'+altcong+'"]').replaceWith('<span class="xplusFMvi"></span>'); $('.minusFMvi[alt="'+altcong+'"]').replaceWith('<span class="xminusFMvi"></span>'); $('.loadFMvi[alt="'+altcong+'"]').show().fadeOut(1000, function(){ $('.cong[alt="'+altcong+'"]').replaceWith('<span class="cong">'+x+'</span>'); }); }); $('.minusFMvi').click(function () { var alttru = $(this).attr('alt'); var y = Number($('.tru[alt="'+alttru+'"]').text())+1; $('.plusFMvi[alt="'+alttru+'"]').replaceWith('<span class="xplusFMvi"></span>'); $('.minusFMvi[alt="'+alttru+'"]').replaceWith('<span class="xminusFMvi"></span>'); $('.loadFMvi[alt="'+alttru+'"]').show().fadeOut(1000, function(){ $('.tru[alt="'+alttru+'"]').replaceWith('<span class="cong">'+y+'</span>'); }); }); }); </script>
+ Đặt bên trái:
Code:
<style type="text/css"> .voteTopic { padding: 4px; background: #fff; color: #000; border:1px solid # a0b0c0; font - size: 12px; font - weight: bold; margin: 0 10px; height: 17px; display: inline; } .voteTopic a { cursor: default; vertical - align: middle; } .voteTopic span, .voteTopic a { display: inline; } .voteTopic .plusFMvi { background: url(http://i48.servimg.com/u/f48/16/58/89/73/like_b12.png) no-repeat scroll center center transparent; padding: 0 12px; } .voteTopic .xplusFMvi { background: url(http://i48.servimg.com/u/f48/16/58/89/73/like_n11.png) no-repeat scroll center center transparent; padding: 0 12px; } .xminusFMvi { background: url(http://i48.servimg.com/u/f48/16/58/89/73/dislik16.png) no-repeat scroll center center transparent; padding: 0 12px; } .voteTopic .minusFMvi{ background: url(http://i48.servimg.com/u/f48/16/58/89/73/dislik15.png) no-repeat scroll center center transparent; padding: 0 12px; } .loadFMvi, .vote { display:none; margin: 0; } </style> <script type="text/javascript"> $('.voteTopic').each(function (index) { $(this).next().attr('alt', 'vote'+index); $(this).before('<iframe name="vote' + index + '" height="0px" width="0px" frameborder="0"></iframe>'); $(this).attr('alt', 'vote'+index).prepend('<span alt="vote'+index+'" class="xplusFMvi"></span><span class="cong" alt="vote'+index+'">0</span> <span alt="vote'+index+'" class="xminusFMvi"></span><span class="tru" alt="vote'+index+'">0</span>'); var altthis = $(this).attr('alt'); var plink = $(this).find('a[href$="eval=plus"]').attr('href'); var mlink = $(this).find('a[href$="eval=minus"]').attr('href'); if ($(this).find('.vote a').length > 0) { $('.xplusFMvi[alt="'+altthis+'"]').replaceWith('<a style="display: inline-block" target="' + altthis + '" href="'+plink+'"><span alt="'+altthis+'" class="plusFMvi"></span></a>'); $('.xminusFMvi[alt="'+altthis+'"]').replaceWith('<a target="' + altthis + '" href="'+mlink+'"><span alt="'+altthis+'" class="minusFMvi"></span></a>'); }; if ($(this).find('.vote-bar').length > 0) { var z = $(this).find('.vote-bar').attr('title').split(' '); var m = parseInt(z[3].replace(/%/, '')) / 100; var n = parseInt(z[4].replace(/\(/, '')); c = String(Math.round(n * m)); d = String(n - c); $('.cong[alt="'+altthis+'"]').replaceWith('<span class="cong" alt="'+altthis+'">'+c+'</span>'); $('.tru[alt="'+altthis+'"]').replaceWith('<span class="tru" alt="'+altthis+'">'+d+'</span>'); }; $('.plusFMvi').click(function () { var altcong = $(this).attr('alt'); var x = Number($('.cong[alt="'+altcong+'"]').text())+1; $('.plusFMvi[alt="'+altcong+'"]').replaceWith('<span class="xplusFMvi"></span>'); $('.minusFMvi[alt="'+altcong+'"]').replaceWith('<span class="xminusFMvi"></span>'); $('.loadFMvi[alt="'+altcong+'"]').show().fadeOut(1000, function(){ $('.cong[alt="'+altcong+'"]').replaceWith('<span class="cong">'+x+'</span>'); }); }); $('.minusFMvi').click(function () { var alttru = $(this).attr('alt'); var y = Number($('.tru[alt="'+alttru+'"]').text())+1; $('.plusFMvi[alt="'+alttru+'"]').replaceWith('<span class="xplusFMvi"></span>'); $('.minusFMvi[alt="'+alttru+'"]').replaceWith('<span class="xminusFMvi"></span>'); $('.loadFMvi[alt="'+alttru+'"]').show().fadeOut(1000, function(){ $('.tru[alt="'+alttru+'"]').replaceWith('<span class="cong">'+y+'</span>'); }); }); }); </script>
Tuổi : 26 Số bài gửi : 9 Sinh nhật : 13/08/1997 Đến từ : Bình Thuận Tham gia : 05/09/2012 Châm ngôn sống : Sống để làm cho người mình yêu luôn vui Thankes : 3 Xu 4all : 14
Tiêu đề: Re: Đánh giá vài viết với Like & Dislike cho phpBB2 & punBB
Tiêu đề:
có demo k cậu
Đánh giá vài viết với Like & Dislike cho phpBB2 & punBB
Trang 1 trong tổng số 1 trang
Forum 4ALL - Mái Nhà Tình Bạn
* Bài viết sưu tầm nên ghi rõ nguồn hoặc viết (ST). * Không dùng những ngôn từ thiếu lịch sự. * Tránh spam nhảm những chủ đề không liên quan. * Bấm nút A/a bên góc phải nếu gặp vấn đề khi chèn hình vui. * Nếu thấy bài viết hay, hãy bấm nút để khích lệ người viết. Yêu cầu viết tiếng Việt có dấu.