Oº°‘¨ [C]hia [S]ẻ [O]nline ¨‘°ºO
♥️Chào Mừng Các Bạn Ghé Thăm Forum Chia Sẻ Online♥️
Rất mong các bạn đăng ký làm thành viên để cùng
nhau chia sẻ mọi nỗi buồn vui
Chúc các bạn có những phút thư giãn vui vẻ
♥️Welcome to forum Chia Sẻ Online♥️
Oº°‘¨ [C]hia [S]ẻ [O]nline ¨‘°ºO
♥️Chào Mừng Các Bạn Ghé Thăm Forum Chia Sẻ Online♥️
Rất mong các bạn đăng ký làm thành viên để cùng
nhau chia sẻ mọi nỗi buồn vui
Chúc các bạn có những phút thư giãn vui vẻ
♥️Welcome to forum Chia Sẻ Online♥️
Welcome Guest, is this your first visit? Register
All times are GMT. The time now is 07:28 AM.

You are not connected. Please login or register

[Codes] Đánh giá vài viết với Like & Dislike cho phpBB3 & Invision

4 posters

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

Admin

Admin
Administrators
Administrators

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.


Hướng dẫn:

Bước 1: ACP - Display - Pictures and Colors - Colors - CSS Stylesheet:

phpBB3
Code:
ul.profile - icons li.voteTopic {
   padding: 6px;
   line - height: 20px;
   background: #fff;
   color: #000;border:1px solid # a0b0c0;
   font - size: 12px;
   font - weight: bold
   width: 70px;
   height: 17px
}
ul.profile - icons li.voteTopic a {
       cursor: default;
   vertical - align:
   middle;
}
ul.profile-icons li span, ul.profile-icons li 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;
}

Invision

Code:
ul.post-info li.voteTopic {
   padding: 6px;
   line - height: 20px;
   background: #fff;
   color: #000;border:1px solid # a0b0c0;
   font - size: 12px;
   font - weight: bold
   width: 70px;
   height: 17px
}
ul.post-info li.voteTopic a {
       cursor: default;
   vertical - align:
   middle;
}
ul.post-info li span, ul.post-info li 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;
}


Bước 2: ACP - Modules - HTML & JAVASCRIPT - Javascript codes management:
  • Title * : Like & Dislike
  • Placement : In the topics
  • Javascript Code * :
    phpBB3
    Code:
    $(function () {
       $('.profile-icons').each(function (index) {
          $(this).attr('alt', 'vote' + index).prepend('<li alt="vote' + index + '" class="voteTopic"><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><li>');
          $(this).prepend('<iframe name="vote' + index + '" height="0px" width="0px" frameborder="0"></iframe><li alt="vote' + index + '" class="loadFMvi"><img alt="Loading" src="http://farm04.go.vn/photo/data/20111012/10798851/946D73AB7E9F949624C2BF756D1ED794.gif" /></li>');
          var altthis = $(this).attr('alt');
          var plink = $(this).parent().find('a[href$="eval=plus"]').attr('href');
          var mlink = $(this).parent().find('a[href$="eval=minus"]').attr('href');
          if ($(this).parent().find('.vote a').length > 0) {
             $('.xplusFMvi[alt="' + altthis + '"]').replaceWith('<a 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).parent().find('.vote-bar').length > 0) {
             var z = $(this).parent().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>');
             });
          });
       });
    });

    Invision

    Code:
    $(function () {
       $('.post-info').each(function (index) {
          $(this).attr('alt', 'vote' + index).prepend('<li alt="vote' + index + '" class="voteTopic"><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><li>');
          $(this).prepend('<iframe name="vote' + index + '" height="0px" width="0px" frameborder="0"></iframe><li alt="vote' + index + '" class="loadFMvi"><img alt="Loading" src="http://farm04.go.vn/photo/data/20111012/10798851/946D73AB7E9F949624C2BF756D1ED794.gif" /></li>');
          var altthis = $(this).attr('alt');
          var plink = $(this).parent().parent().find('a[href$="eval=plus"]').attr('href');
          var mlink = $(this).parent().parent().find('a[href$="eval=minus"]').attr('href');
          if ($(this).parent().parent().find('.vote a').length > 0) {
             $('.xplusFMvi[alt="' + altthis + '"]').replaceWith('<a 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).parent().parent().find('.vote-bar').length > 0) {
             var z = $(this).parent().parent().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>');
             });
          });
       });
    });

---o0o Hết o0o---


Viết bởi baivong - www.FMvi.vn



Được sửa bởi Trà My ngày Mon Jun 04, 2012 12:22 pm; sửa lần 1.

https://chiaseonline.forumvi.com/

nh0k_pro

nh0k_pro
Thành Viên
Thành Viên

tks

http://chiaseonline.us.to

severkid

severkid
Thành Viên
Thành Viên

tk

http://smilevangia.forumvi.com

Iwillnotlove

Iwillnotlove
Moderator
Moderator

tks

Sponsored content



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

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