Recent Tutorials
Who is online?
In total there are 7 users online :: 1 Registered, 0 Hidden and 6 Guests :: 1 Bot

smurfavr

[ View the whole list ]


Most users ever online was 172 on Fri 19 Feb 2016, 05:17

Quick Reply without refreshing is not working on Forumactif Edge

View previous topic View next topic Go down

bodahassan

Title :
Gender : Male
Posts : 28
Points : 175
Reputation : 0
Location : Egypt
Language : arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile

Postbodahassan on Mon 19 Sep 2016, 20:38

Good evening I have a problem in quick Reply code

I made sure it works on original phpbb3 version but it does not work in Forumactif Edge

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);
        location.href = f;
        });
        $("#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.");
        }
        });
        });

I tried hard to fix the problem but it did not work with me.

Rose Rose Rose
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4088
Points : 8387
Reputation : 2008
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Google Chrome Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Tue 20 Sep 2016, 11:39

Hello @bodahassan,

Try using the updated script below.
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('.content-block a[href*="/viewtopic"]:first').attr('href').length >1) {
var f = $(t).find('.content-block 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);
location.href = f;
});
$("#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.");
}
});
});

I only replaced the class
Code:
.panel
with the equivalent class in Forumactif Edge ;
Code:
.content-block
. Let me know if it works for you. Salute
bodahassan

Title :
Gender : Male
Posts : 28
Points : 175
Reputation : 0
Location : Egypt
Language : arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile

Postbodahassan on Tue 20 Sep 2016, 12:46

Thank you @Ange Tuteur

Yes I have tried previously to change this class
But the code also not working with me

For you
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4088
Points : 8387
Reputation : 2008
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Google Chrome Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Tue 20 Sep 2016, 13:19

You're welcome, everything is working okay with it now ? ^^
bodahassan

Title :
Gender : Male
Posts : 28
Points : 175
Reputation : 0
Location : Egypt
Language : arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile

Postbodahassan on Tue 20 Sep 2016, 13:35

No, unfortunately still not working
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4088
Points : 8387
Reputation : 2008
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Google Chrome Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Wed 21 Sep 2016, 12:09

Hmm.. see if this works :
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('.content-block a[href*="/viewtopic"]:first').attr('href').length >1) {
var f = $(t).find('.content-block 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);
location.hash = "#p"+postid;
});
$("#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.");
}
});
});
bodahassan

Title :
Gender : Male
Posts : 28
Points : 175
Reputation : 0
Location : Egypt
Language : arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile

Postbodahassan on Wed 21 Sep 2016, 12:51

sorry but still not working
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4088
Points : 8387
Reputation : 2008
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Google Chrome Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Wed 21 Sep 2016, 13:02

It worked for me.. Shocked

What's the URL of your forum ?
bodahassan

Title :
Gender : Male
Posts : 28
Points : 175
Reputation : 0
Location : Egypt
Language : arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile

Postbodahassan on Wed 21 Sep 2016, 13:09

@Ange Tuteur Weird !!
I've sent you earlier account test

http://sd.koutstore.com
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4088
Points : 8387
Reputation : 2008
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Google Chrome Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Wed 21 Sep 2016, 13:43

Ah thanks, I almost forgot about that. When I test it there was an error, try this script to see if it resolves the error :
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($('.content-block a[href^="/viewtopic?t="]:first', t).length) {
var f = $('.content-block a[href^="/viewtopic?t="]:first', t).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);
location.hash = "#"+postid;
});
$("#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.");
}
});
});
bodahassan

Title :
Gender : Male
Posts : 28
Points : 175
Reputation : 0
Location : Egypt
Language : arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile

Postbodahassan on Wed 21 Sep 2016, 14:12

thank u @Ange Tuteur I'm afraid to tell you that the code still does not work Whisper

I deleted cookies
i have disabled all other JavaScript codes and still don't know the cause of the problem

The code works but does not post a reply and also shows no replay after i click send





Sorry if i waste your time.

Rose
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4088
Points : 8387
Reputation : 2008
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Google Chrome Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Thu 22 Sep 2016, 10:16

@bodahassan no problem, I think I've found the cause. Go to admin panel > general > security and set the following option to "no" :
- Unauthorize unofficial forms to post messages and private messages on the forum

Let me know if that fixes the problem. Salute
bodahassan

Title :
Gender : Male
Posts : 28
Points : 175
Reputation : 0
Location : Egypt
Language : arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile

Postbodahassan on Thu 22 Sep 2016, 11:15

@Ange Tuteur Yes I made sure that this option is no
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4088
Points : 8387
Reputation : 2008
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Google Chrome Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Thu 22 Sep 2016, 11:31

Any changes, or is it still not working ?
bodahassan

Title :
Gender : Male
Posts : 28
Points : 175
Reputation : 0
Location : Egypt
Language : arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile

Postbodahassan on Thu 22 Sep 2016, 11:42

not working
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4088
Points : 8387
Reputation : 2008
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Google Chrome Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Thu 22 Sep 2016, 11:57

Alright, could you try removing the script on your forum ? I'm going to log into the test account you gave me and debug it via console. Wink
bodahassan

Title :
Gender : Male
Posts : 28
Points : 175
Reputation : 0
Location : Egypt
Language : arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile

Postbodahassan on Thu 22 Sep 2016, 12:02

Well I've deleted the script
Rose
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4088
Points : 8387
Reputation : 2008
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Google Chrome Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Thu 22 Sep 2016, 12:11

Thanks Rose

Give this a try and let me know if it works :
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");
$("#text_editor_textarea").val($("#text_editor_textarea").sceditor('instance').val());
$.post('/post', $('#quick_reply').serialize() + '&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('.content-block a[href*="/viewtopic"]:first').attr('href').length >1) {
var f = $(t).find('.content-block 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);
location.href = f;
});
$("#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.");
}
});
});
bodahassan

Title :
Gender : Male
Posts : 28
Points : 175
Reputation : 0
Location : Egypt
Language : arabic
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB3
Awards :
View all awards
View user profile

Postbodahassan on Thu 22 Sep 2016, 12:39

Yes thank you very much @Ange Tuteur script works now

Thank you again and I apologize for any inconvenience I may have caused you.

For you
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4088
Points : 8387
Reputation : 2008
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Google Chrome Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Thu 22 Sep 2016, 12:48

You're welcome, it was no problem ! ^^

Have a good day. Smile

View previous topic View next topic Back to top

Create an account or log in to leave a reply

You need to be a member in order to leave a reply.

Create an account

Join our community by creating a new account. It's easy!


Create a new account

Log in

Already have an account? No problem, log in here.


Log in

 
Permissions in this forum:
You cannot reply to topics in this forum