The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
+14
Abdalah_98
mc nabulsy
Poser
Beyonder
Chromo
sutnor
brandon_g
Van-Helsing
TheCrow
SLGray
Diana
Rhino.Freak
Take Notes
doannamthai
18 posters

    [Tutorial] Quick Reply without refreshing

    doannamthai
    doannamthai
    Forumember


    Posts : 45
    Reputation : 11
    Language : English, Vietnamese

    [Tutorial] Quick Reply without refreshing  - Page 2 Empty [Tutorial] Quick Reply without refreshing

    Post by doannamthai December 5th 2015, 7:38 pm

    First topic message reminder :

    Hello everyone, Today I am going to share you a tutorial -  quick reply without refreshing page
    It seems to be a familiar tutorials with somepeople, but strange with someone too Smile.


    First, let see my demo :


    - No Page Change
    - Fast and Minimum for sending message : 5s
    - Write at least 10 characters



    Now you know what it is for ? Let take the Javascript code :

    In your 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 ;
    // My website - goobap.com ;
    $(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.");
    }
    });
    });


    Invison
    Code:
    // Invision Version;
    //By doannamthai-getover || forumotion-forumvi ;
    // My website - goobap.com ;
    $(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 ;
    // My website - goobap.com ;
    $(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.");
    }
    });
    });

    phpBB2


    Last edited by doannamthai on October 6th 2016, 5:13 am; edited 7 times in total
    vietkanpy
    vietkanpy
    Forumember


    Male Posts : 89
    Reputation : 33
    Language : vietnam

    [Tutorial] Quick Reply without refreshing  - Page 2 Empty Re: [Tutorial] Quick Reply without refreshing

    Post by vietkanpy October 6th 2016, 6:20 am

    doannamthai wrote:Ok I would like to know whether it woks

    Thái . anh việt (the_Dav) đây. về hotrofm.net đi e.
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51554
    Reputation : 3523
    Language : English
    Location : United States

    [Tutorial] Quick Reply without refreshing  - Page 2 Empty Re: [Tutorial] Quick Reply without refreshing

    Post by SLGray October 6th 2016, 7:18 am

    vietkanpy wrote:
    doannamthai wrote:Ok I would like to know whether it woks

    Thái . anh việt (the_Dav) đây. về hotrofm.net đi e.
    Please speak in English, as this is an English support forum. If you need support in another language, please look at the widget to the right that says ''Official Support Forums.''
    Please read our forum rules:  ESF General Rules



    [Tutorial] Quick Reply without refreshing  - Page 2 Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    avatar
    GAMSgr
    Forumember


    Posts : 94
    Reputation : 1
    Language : greek,english

    [Tutorial] Quick Reply without refreshing  - Page 2 Empty Re: [Tutorial] Quick Reply without refreshing

    Post by GAMSgr February 4th 2017, 12:52 pm

    thanks!
    smurfavr
    smurfavr
    Active Poster


    Male Posts : 1881
    Reputation : 22
    Language : Bulgarian

    [Tutorial] Quick Reply without refreshing  - Page 2 Empty Re: [Tutorial] Quick Reply without refreshing

    Post by smurfavr February 6th 2017, 4:08 am

    can we have it for phpbb2 ?

      Current date/time is November 12th 2024, 2:22 am