Đư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

[Updated]Quick Reply - Trả lời nhanh

  • Please log in to post a topic
  • doannamthai

    doannamthai
    doannamthai

    doannamthai

    Group: Member

    Hiện đang:
    Bài viết : 362
    Points : 498
    Thanks : 86

    Member

    Member
    Bài viết thứ :1

    Đăng vào:6/12/2015, 11:30

    Member
    Lần trước mình đã viết code Trả lời nhanh không chuyển trang nhưng do FM có một số update nên nó lỗi. Bây giờ có tý thời gian nên fix lại code cười nhăn răng

    Xem Demo :


    - Không chuyển trang
    - Thời gian tối thiểu gửi bài : 5s
    - Viết ít nhất 10 ký tự



    Mình mới viết lại choi punBB các phiên bản khác chờ nhé

    ACP: Modules -> HTML&JAVASCRIPT -> JavaScript codes management -> [Create a new JavaScript]
    Title *: [2015]Quick Reply
    Placement : In the topics
    Javascript Code * :


    PunBB
    Code:
    //By doannamthai-getover || forumotion-forumvi ;
    $(function () {
    $('#quick_reply input[name="post"]').click(function(a){
    a.preventDefault();
    var g = $("#text_editor_textarea").sceditor('instance').val();
    var href = $('a[href*="mode=reply"]').attr("href");
    var value = $("#text_editor_textarea").sceditor("instance").val().replace(/\s/g, '').length;
    if(10 <= value){
    $('<div class="lreply" style="color: red;font-weight: bold; text-transform: uppercase;"><br>Your message is being posted...</div>').appendTo(".frm-buttons");
    $.post(href, {
                "message" : g,
                "auth[]": $("#quick_reply input[name='auth[]']:last").val(), 
                "lt" : $("#quick_reply input[name='lt']").val(),
                 "tid" : $("#quick_reply input[name='tid']").val(),
                "attach_sig" : "1" , 
                "post": "Send" 
    }, function(t) {
    console.log(t);
    if(t.indexOf("Flood") != -1){
    alert("Error!\nYou must wait 5 second before replying");
    $(".lreply").fadeOut(300);
    }
    if(t.indexOf("A new") != -1){
    alert("Error!\nSomeone had replied before you posted\nYou must refresh the page to continue.\nNotice : You should save or copy your message if you don't want it gone");
    $(".lreply").fadeOut(300);
    }
    if($(t).find(".message a:first").attr('href').length >1) {
    var f = $(t).find(".message a:first").attr('href'); 
    $.get(f , function(z){ 
    $("#quick_reply input[name='auth[]']:last").val($(z).find("#quick_reply input[name='auth[]']:last").val());
    $("#quick_reply input[name='lt']").val($(z).find("#quick_reply input[name='lt']").val());
    $(z).find(".post:last").hide().insertAfter(".post:last").slideDown(400);
    });
    $("#text_editor_textarea").sceditor('instance').val("");
    $(".lreply").fadeOut(300);
    }
    });
    }
    else {
    alert("Sorry\nThe content is too short to send!\nYou must write at least 10 characters.");
    }
    });
    });

    #1 - Posted 6/12/2015, 11:30
    doannamthai

    doannamthai
    doannamthai

    doannamthai

    Group: Member

    Hiện đang:
    Bài viết : 362
    Points : 498
    Thanks : 86

    Member

    Member
    Bài viết thứ :2

    Đăng vào:14/12/2015, 21:56

    Member
    Invison : 
    Code:
    // Invision Version;
    //By doannamthai-getover || forumotion-forumvi ;
    $(function () {
    $('#quick_reply input[name="post"]').click(function(a){
    a.preventDefault();
    var g = $("#text_editor_textarea").sceditor('instance').val();
    var href = $('a[href*="mode=reply"]').attr("href");
    var value = $("#text_editor_textarea").sceditor("instance").val().replace(/\s/g, '').length;
    if(10 <= value){
    $('<div class="lreply" style="color: red;font-weight: bold; text-transform: uppercase;"><br>Your message is being posted...</div>').appendTo("#quick_reply .center");
    $.post(href, {
                "message" : g,
                "auth[]": $("#quick_reply input[name='auth[]']:last").val(),
                "lt" : $("#quick_reply input[name='lt']").val(),
                "tid" : $("#quick_reply input[name='tid']").val(),
                "attach_sig" : "1" ,
                "post": "Send"
    }, function(t) {
    if(t.indexOf("Flood") != -1){
    alert("Error!\nYou must wait 5 second before replying");
    $(".lreply").fadeOut(300);
    }
    if(t.indexOf("A new") != -1){
    alert("Error!\nSomeone had replied before you posted\nYou must refresh the page to continue.\nNotice : You should save or copy your message if you don't want it gone");
    $(".lreply").fadeOut(300);
    }
    if($(t).find('.box-content  .msg a[href*="/viewtopic"]').attr('href').length >1) {
    var f = $(t).find('.box-content  .msg a[href*="/viewtopic"]:first').attr('href');
    var postid = f.split('#')[1];
    $.get(f , function(z){
    $("#quick_reply input[name='auth[]']:last").val($(z).find("#quick_reply input[name='auth[]']:last").val());
    $("#quick_reply input[name='lt']").val($(z).find("#quick_reply input[name='lt']").val());
    $(z).find("#p"+postid).hide().insertAfter(".post:last").slideDown(400);
    });
    $("#text_editor_textarea").sceditor('instance').val("");
    $(".lreply").fadeOut(300);
    }
    });
    }
    else {
    alert("Sorry\nThe content is too short to send!\nYou must write at least 10 characters.");
    }
    });
    });

    phpBB3

    Code:
    // phpBB3 version;
    //By doannamthai-getover || forumotion-forumvi ;
    $(function () {
    $('#quick_reply input[name="post"]').click(function(a){
    a.preventDefault();
    var g = $("#text_editor_textarea").sceditor('instance').val();
    var href = $('a[href*="mode=reply"]').attr("href");
    var value = $("#text_editor_textarea").sceditor("instance").val().replace(/\s/g, '').length;
    if(10 <= value){
    $('<span class="lreply" style="color: red;font-weight: bold; text-transform: uppercase;"><br>Your message is being posted...</span>').appendTo("#quick_reply div:last");
    $.post(href, {
                "message" : g,
                "auth[]": $("#quick_reply input[name='auth[]']:last").val(),
                "lt" : $("#quick_reply input[name='lt']").val(),
                "tid" : $("#quick_reply input[name='tid']").val(),
                "attach_sig" : "1" ,
                "post": "Send"
    }, function(t) {
    if(t.indexOf("Flood") != -1){
    alert("Error!\nYou must wait 5 second before replying");
    $(".lreply").fadeOut(300);
    }
    if(t.indexOf("A new") != -1){
    alert("Error!\nSomeone had replied before you posted\nYou must refresh the page to continue.\nNotice : You should save or copy your message if you don't want it gone");
    $(".lreply").fadeOut(300);
    }
    if($(t).find('.panel a[href*="/viewtopic"]:first').attr('href').length >1) {
    var f = $(t).find('.panel a[href*="/viewtopic"]:first').attr('href');
    var postid = f.split('#')[1];
    $.get(f , function(z){
    $("#quick_reply input[name='auth[]']:last").val($(z).find("#quick_reply input[name='auth[]']:last").val());
    $("#quick_reply input[name='lt']").val($(z).find("#quick_reply input[name='lt']").val());
    $(z).find("#p"+postid).hide().insertAfter(".post:last").slideDown(400);
    });
    $("#text_editor_textarea").sceditor('instance').val("");
    $(".lreply").fadeOut(300);
    }
    });
    }
    else {
    alert("Sorry\nThe content is too short to send!\nYou must write at least 10 characters.");
    }
    });
    });

    #2 - Posted 14/12/2015, 21:56
    fascicularia

    fascicularia
    fascicularia

    fascicularia

    Group: Member

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

    Member

    Member
    Bài viết thứ :3

    Đăng vào:20/1/2016, 23:33

    Member
    mơ giữa ban ngày phpbb2

    #3 - Posted 20/1/2016, 23:33
    mc nabulsy

    mc nabulsy
    mc nabulsy

    mc nabulsy

    Group: Member

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

    Member

    Member
    Bài viết thứ :4

    Đăng vào:19/4/2016, 15:32

    Member
    phpbb2  đang đợi đó

    #4 - Posted 19/4/2016, 15:32
    Anonymos

    Anonymos
    Anonymos

    Anonymos

    Group: Member

    Hiện đang:
    Bài viết : 253
    Points : 252
    Thanks : 1

    Member

    Member
    Bài viết thứ :5

    Đăng vào:12/10/2016, 04:05

    Member
    thanks

    #5 - Posted 12/10/2016, 04:05
    Mr.Dark

    Mr.Dark
    Mr.Dark

    Mr.Dark

    Group: Member

    Hiện đang:
    Bài viết : 262
    Points : 462
    Birthday : 27/02/1991
    Thanks : 154
    Đến từ : Hải Phòng

    Member
    Http://ClubTeen9x.Us.To

    Member
    Bài viết thứ :6

    Đăng vào:12/7/2019, 14:50

    Member
    bối rối

    #6 - Posted 12/7/2019, 14:50
    Http://ClubTeen9x.Us.To

    Sponsored content

    Sponsored content

    Group:
    Hiện đang:

    Bài viết thứ :7

    Đăng vào:

    #7 - Posted

    Đ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