[Tutorial] Quick Reply without refreshing
+14
Abdalah_98
mc nabulsy
Poser
Beyonder
Chromo
sutnor
brandon_g
Van-Helsing
TheCrow
SLGray
Diana
Rhino.Freak
Take Notes
doannamthai
18 posters
Page 1 of 2
Page 1 of 2 • 1, 2
[Tutorial] Quick Reply without refreshing
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 .
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 * :
It seems to be a familiar tutorials with somepeople, but strange with someone too .
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
Re: [Tutorial] Quick Reply without refreshing
Updated for Invision !
- 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.");
}
});
});
Re: [Tutorial] Quick Reply without refreshing
Awesome! Thank you very much, will definitely add this.
Take Notes- Helper
- Posts : 2337
Reputation : 324
Language : English
Location : Forumountain
Re: [Tutorial] Quick Reply without refreshing
Updated for 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.");
}
});
});
Re: [Tutorial] Quick Reply without refreshing
Very cool stuff this
We encountered one little issue with it on our forum, phpbb3. If a topic has several pages and you are not at the end but on page 1 for example. And if you then make a post it shows up on page 1 for the person making that post. It does end up at the end of the topic as it should, so all is fine. But for some members, especially the some older people this is pretty confusing. Because later if they check the topic they do not see their post where it did appear for them at the time of posting.
We encountered one little issue with it on our forum, phpbb3. If a topic has several pages and you are not at the end but on page 1 for example. And if you then make a post it shows up on page 1 for the person making that post. It does end up at the end of the topic as it should, so all is fine. But for some members, especially the some older people this is pretty confusing. Because later if they check the topic they do not see their post where it did appear for them at the time of posting.
Guest- Guest
Re: [Tutorial] Quick Reply without refreshing
Meesleepbeest wrote:Very cool stuff this
We encountered one little issue with it on our forum, phpbb3. If a topic has several pages and you are not at the end but on page 1 for example. And if you then make a post it shows up on page 1 for the person making that post. It does end up at the end of the topic as it should, so all is fine. But for some members, especially the some older people this is pretty confusing. Because later if they check the topic they do not see their post where it did appear for them at the time of posting.
Thanks for giving your opinion !
I knew this problem, I don't want window refresh when a member reply because of being confuse but if you want you can use this code for phpb33 instead of :
- 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.");
}
});
});
Re: [Tutorial] Quick Reply without refreshing
Awesome stuff man thanks a lot! keep it up!
I have a simple question though, is this script "heavy" ? I mean does it slow down the forum a little? I haven't felt that so don't worry just though to ask XD
I have a simple question though, is this script "heavy" ? I mean does it slow down the forum a little? I haven't felt that so don't worry just though to ask XD
Re: [Tutorial] Quick Reply without refreshing
Rhino.Freak wrote:Awesome stuff man thanks a lot! keep it up!
I have a simple question though, is this script "heavy" ? I mean does it slow down the forum a little? I haven't felt that so don't worry just though to ask XD
It's up to how many script you are using in the topic place . But almost it runs smoothly
Re: [Tutorial] Quick Reply without refreshing
Hi Doannamthai,
Is it possible to make it to post even if another person posts (for phpbb3)? The whole idea of 'quick replying' is gone if you need to refresh your page because someone else posted. Just like normal, you get a notification that another person has posted, you then can choose to still post or not.
Is it possible to make it to post even if another person posts (for phpbb3)? The whole idea of 'quick replying' is gone if you need to refresh your page because someone else posted. Just like normal, you get a notification that another person has posted, you then can choose to still post or not.
Guest- Guest
Re: [Tutorial] Quick Reply without refreshing
Meesleepbeest wrote:Hi Doannamthai,
Is it possible to make it to post even if another person posts (for phpbb3)? The whole idea of 'quick replying' is gone if you need to refresh your page because someone else posted. Just like normal, you get a notification that another person has posted, you then can choose to still post or not.
Yes, of course it is possible but now I am quite busy to write another code sorry
Re: [Tutorial] Quick Reply without refreshing
No problem at all, maybe something for next year Happy holidays
Guest- Guest
Re: [Tutorial] Quick Reply without refreshing
Aw, I wanted this for my phpbb2 forum
Diana- Active Poster
- Posts : 1286
Reputation : 21
Language : English
Re: [Tutorial] Quick Reply without refreshing
Diana wrote:Aw, I wanted this for my phpbb2 forum
Kind of offtopic but upgrade to phpbb3 already Seriously you're using a forum software that's ridiculously old.
Re: [Tutorial] Quick Reply without refreshing
I will not support phpBB2 forum because the different structure in templates (many forum). If you want this mode you have to pay a little, I will go to your forum and write another one . Send the request to my mail : Email Removed
Re: [Tutorial] Quick Reply without refreshing
I'm deffinitely not paying for anything lol but thanks for the offer, I appreciate it.
@Rhino.Freak I've been through them all
@Rhino.Freak I've been through them all
Diana- Active Poster
- Posts : 1286
Reputation : 21
Language : English
Re: [Tutorial] Quick Reply without refreshing
I removed your email address for safety reasons. Never post your email address on a PUBLIC forum.doannamthai wrote:I will not support phpBB2 forum because the different structure in templates (many forum). If you want this mode you have to pay a little, I will go to your forum and write another one . Send the request to my mail : Email Removed
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: [Tutorial] Quick Reply without refreshing
doannamthai this works fine for my site! Great work! ^_^
Re: [Tutorial] Quick Reply without refreshing
Hello,
Its not working for my forum . My forum version is PunBB, I have modified templates and I dont know if the forum language makes problem.
Its not working for my forum . My forum version is PunBB, I have modified templates and I dont know if the forum language makes problem.
Re: [Tutorial] Quick Reply without refreshing
Rhino.Freak wrote:Diana wrote:Aw, I wanted this for my phpbb2 forum
Kind of offtopic but upgrade to phpbb3 already Seriously you're using a forum software that's ridiculously old.
Maybe she doesn't want to, the software still works perfectly fine. My forum still operates on phpbb2 and I plan to keep it that way. If something still works, wby go through the un needed hassle to change it?
Just wanted to point that out .
-Brandon
Remember to mark your topic when a solution is found.
General Rules | Tips & Tricks | FAQ | Forgot Founder Password?
Team Leader
Review Section Rules | Request A Review | Sticker Points
How can I move the quick reply box from the bottom of tha page to the top?
Can somebody help how can I move the quick reply box from the bottom of tha page to the top?
This is my forum: regagrihun.top-talk.com
This is my forum: regagrihun.top-talk.com
Re: [Tutorial] Quick Reply without refreshing
You need to start topic in the correct support section. This section is only about coding that members are working on.sutnor wrote:Can somebody help how can I move the quick reply box from the bottom of tha page to the top?
This is my forum: regagrihun.top-talk.com
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: [Tutorial] Quick Reply without refreshing
Works awesome. A nice share indeed, thank you.
Chromo- Forumember
- Posts : 122
Reputation : 19
Language : said the Captain
Re: [Tutorial] Quick Reply without refreshing
It is working! Thanks for whoever revived this topic and made me see it.
Re: [Tutorial] Quick Reply without refreshing
I forgot it ) .Hagoromo Otsutsuki wrote:Video is private.
Re: [Tutorial] Quick Reply without refreshing
Tested 8 times no any problem
[Punbb] with all browsers (chrome,firefox,opera,UC browser,...)
Good work .
[Punbb] with all browsers (chrome,firefox,opera,UC browser,...)
Good work .
Page 1 of 2 • 1, 2
Similar topics
» Quick Reply without refreshing
» Update part of a page without Refreshing (Quick Reply, Latest topic...)
» Editng quick reply script(want to put something next to the quick reply)
» When onclick button of "Post Reply" scroll down to the quick reply
» Forum rules in quick reply and normal reply box
» Update part of a page without Refreshing (Quick Reply, Latest topic...)
» Editng quick reply script(want to put something next to the quick reply)
» When onclick button of "Post Reply" scroll down to the quick reply
» Forum rules in quick reply and normal reply box
Page 1 of 2
Permissions in this forum:
You cannot reply to topics in this forum