Đưa Skin mới vào diễn đàn sử dụng ! Nếu quá trình sử dụng diễn đàn xảy ra lỗi, xin vui lòng liên hệ Admin để báo lỗi ! Cảm ơn !

You are not connected. Please login or register

[Code] Trích dẫn nhanh (Quick Quote)

  • Please log in to post a topic
  • huyhoang1997

    huyhoang1997
    huyhoang1997

    huyhoang1997

    Group: Moderagerator

    Hiện đang:
    Bài viết : 670
    Points : 905
    Birthday : 14/06/1997
    Thanks : 73
    Đến từ : Ninh Thuận

    Moderagerator

    Moderagerator
    Bài viết thứ :1

    Đăng vào:16/3/2016, 01:03

    Moderagerator
    Demo:
    Khi bấm vào nút quote:
    [You must be registered and logged in to see this link.]
    Kết quả:
    [You must be registered and logged in to see this link.]
    Hướng dẫn:
    - Tạo 1 trang js mới
    Title: Quick Quote
    Placement: In all the pages
    Code:
    $(function(){
      var forum_version = 1,
      new_button = false,
      quote_image = 'http://icons.iconarchive.com/icons/fatcow/farm-fresh/16/document-quote-icon.png';
     
      if (forum_version == 0) n = [".postbody div",".name strong a"];
      if (forum_version == 1) n = [".postbody .content div",".postprofile dl dt strong a"];
      if (forum_version == 2) n = [".entry-content div",".username a"];
      if (forum_version == 3) n = [".post-entry div",".postprofile-details dt a + br + a"];
      if (new_button == true) { q = ".quickquote"; $(forum_version==1?"li:has(.i_icon_quote)":"a:has(.i_icon_quote)").after($('<li style="display:inline-block;list-style:none;"><a href="#quick_reply"><img src="'+quote_image+'" class="quickquote" alt="Trích dẫn nhanh" title="Trích dẫn nhanh" /></a></li>')) }
      if (new_button == false) { q = "a:has(.i_icon_quote)"; $("a:has(.i_icon_quote)").attr("href", "#quick_reply"); $(".i_icon_quote").attr("title", "Reply with quote") }
      
      $(document).on('mouseup',n[0],function(e){
        qtext = $(this).parents(".post");
        if (window.getSelection) theSelection = window.getSelection().toString();
        else if (document.getSelection) theSelection = document.getSelection();
        else if (document.selection) theSelection = document.selection.createRange().text;
      });  
      
      $(q).click(function () {
        if (typeof qtext == 'undefined') return;
        uname = qtext.find(n[1]).text();
        $("div.sceditor-toolbar + iframe").contents().find("body").append('<blockquote><cite>' + uname + '</cite>' + theSelection + '</blockquote> <br />');
        $('.sceditor-container textarea')[0].value += '[quote="' + uname + '"]' + theSelection + '[/quote]'
      });
      var n,q;
    });
    - Chọn phiên bản để code có thể hoạt động:
    tìm
    Code:
     var forum_version = 1,
    sửa số 1 thành số phiên bản mà bạn đang sử dụng (VD: diễn đàn bạn sử dụng phiên bản punbb thì thay số 1 thành số 2)
    0 = phpbb2
    1 = phpbb3
    2 = punbb
    3 = invision
    Tùy biến button và hình ảnh button:
    new_button :
    true = tạo 1 nút trích dẫn nhanh
    false = sử dụng nút trích dẫn mặc định

    Ở code trên mình đã edit link ảnh cho phù hợp các bạn chỉ cần sửa phiên bản và có sử dụng button hay ko thôi cười nhăn răng

    *Chú ý: - Các bạn nên bôi đen đoạn cần trích dẫn trước khi sử dụng
    - Ở demo trên mình đã mở button quick quote nên mới có thêm một button như v cười nhăn răng
    [Code] Trích dẫn nhanh (Quick Quote) Captur30

    #1 - Posted 16/3/2016, 01:03
    Franco

    Franco
    Franco

    Franco

    Group: Member

    Hiện đang:
    Bài viết : 12
    Points : 12
    Thanks : 0

    Member

    Member
    Bài viết thứ :2

    Đăng vào:12/12/2016, 00:47

    Member
    (y)

    #2 - Posted 12/12/2016, 00:47

    Đang kiểm tra dữ liệu...

    Bạn phải điền đầy đủ thông tin đăng ký.

    Số ký tự phải từ 3 trở lên
    Hãy chọn tài khoản khác
    Có thể dùng tài khoản này
    Không sử dụng địa chỉ này
    E-mail sẽ được kiểm sau
    Số ký tự phải từ 3 trở lên
    Trùng tên đăng nhập
    Chưa đúng
    Chính xác

    Free forum | ©phpBB | Free forum support | Báo cáo lạm dụng | Thảo luận mới nhất
    YOUR BANNER HERE
    728x90