[Đóng góp] Cài mật khẩu cho trang cá nhân (rảnh rỗi)

  Bài viết hay nhất1
Nói chung thì cái này chỉ để cho vui thôi, có ai giúp méo gắn thêm cái chống F12 và click chuột phải nữa là hoàn hảo :v
Demo: [You must be registered and logged in to see this link.]
Mật khẩu đang để: mktest123
Nhập vào input rồi click vào button bên cạnh là xong

Cách làm:
ACP >> QUẢN LÝ NGƯỜI DÙNG & QUẢN LÝ NHÓM >> Quản lý người dùng >> Profiles >> [You must be registered and logged in to see this image.]
Type : Text field
Name : Mật khẩu
Necessarily filled? : Không
Display : Lý lịch
Display type : Text
Who can modify the profile field value ? : Check hết cả hai ô
Display this field for users that are at least : Guest
Separator : Back to the line

Text field:
Default content : nothing

Sau khi tạo xong mục profile mật khẩu, click [You must be registered and logged in to see this image.] Replace the content

Vào trang cá nhân của bất kì thành viên, rê chuột vào mục tên Mật khẩu mới tạo, click chuột phải, click vào ô Kiểm tra phần tử

[You must be registered and logged in to see this image.]

Lấy field_id của mục Mật khẩu. VD: field-id của forum méo là field_id2 thì lấy 2 làm số id

[You must be registered and logged in to see this image.]

Code Javascript:
Code:
$(function(){
  if (window.location.pathname.indexOf('/u') == 0){
    $('body').attr('style','overflow-y:hidden');
    $('body').append('<div class="user-pass"><input class="user-passin" type="text" placeholder="Nhập mật khẩu"></input><button class="user-passcheck"></button></div>');
    $('.user-passcheck').click(function(){
      mk = $('#field_id<ID> .field_uneditable').html();
      mk2 = $('.user-passin').val();
      if($('#field_id<ID> .field_uneditable').html() == 'nothing'){$('.user-pass').addClass('user-passup');$('body').attr('style','');}
      else if(mk2 == mk){$('.user-pass').addClass('user-passup');$('.user-passcheck').mousedown(function(){$('.user-pass').css('background','white')});$('body').attr('style','');}
      else {$('.user-pass').show()}
    });
    $('.user-passcheck').mousedown(function(){$('.user-pass').css('background','red')});
    $('.user-passcheck').mouseup(function(){$('.user-pass').css('background','white')});
  }
});
$(function(){if($('#field_id<ID> .field_uneditable').html() == 'nothing'){$('.user-pass').hide()}
});

Code Css
Code:
/* User */
.user-passup {margin-top:-100%!important}
.user-pass {transition:margin 1s ease;margin-top:0;z-index: 999;position: fixed;width: 100%;top: 0;height: 100%;background:#fff;}
.user-passin {outline:none!important;padding: 10px;width: 300px;position: relative;border: 0;box-shadow: 0 0 10px cadetblue;margin-left: calc(50% - 160px);margin-top: calc(20% - 18px);border-radius: 2px;}
.user-passcheck {padding: 10px;position: relative;border: 0;border-radius: 3px;background: cadetblue url(http://www.iconsdb.com/icons/preview/white/arrow-m.png) no-repeat center;width: 32px;height: 32px;margin-left: 10px;cursor: pointer;outline:none!important}
#field_id<ID>, #field_id<ID> + .separator {display:none!important}

Thay tất cả <ID> thành số id đã lấy ở bước trước
  Bài viết hay nhất2
Rảnh vãi :v
  Bài viết hay nhất3
Ta biết mà :v làm giúp ta cái chống F12 và chuột phải đi @KirigayaKazuto :v
  Bài viết hay nhất4
Thay cái <ID> thành 1 biến riêng để ai xài chỉ cần đổi giá trị của cái biến đó thôi đỡ phải đổi nhiều, còn cái #field_id<ID>, #field_id<ID> + .separator trong CSS bỏ đi rồi làm luôn phần ẩn ngay từ trong JS. Còn nếu chỉ cần tránh mỗi F12 thôi ấy thì t nghĩ làm luôn 1 cái JS đặt nội dung mật khẩu vào 1 biến xong xoá cái field đó đi là xong, nhưng vẫn dò dc bằng Ctrl+U :v
  Bài viết hay nhất5
You cannot reply to topics in this forum