View Full Version : How To Make Post Reply Becomes Quick Reply ? Please Guys
BUDIMAN
07-15-2010, 12:41 PM
Hi all..i have a question here
Ok, if you take a look at vbulletin version 4.x.x, when we click the Post reply, it goes to Quick Reply box below, but in vb3.8.x, it will open new reply page..
so my point here, how to make vb3.8.5 Post Reply function becomes like vb4 ? please see the attachment
anyway, i use vb3.8.5
BUDIMAN
07-24-2010, 11:51 AM
no one know ?
Michael.A
07-25-2010, 11:24 PM
i can show you how but that not a good ida... trust me you cant add images from there bbcodes,.... but if you insist then reply to this thread...
BirdOPrey5
07-26-2010, 01:57 PM
i can show you how but that not a good ida... trust me you cant add images from there bbcodes,.... but if you insist then reply to this thread...
You can if you combine it with the advanced quick reply mod.
BUDIMAN
07-26-2010, 05:14 PM
actually, no need to be same exactly likes vb4, is enough if when we click the Post Reply, it goes to quick reply box below ( call the javascript )
can we do like that ?
if u can understand me, u will know, by doing this, it will reduce lots of server loads when there are too many online users.
Michael.A
07-26-2010, 08:22 PM
SHOWTHREAD
notice :- { there is 2 of them one on top of the post and one under it }
find the red
<td class="smallfont"><a href="newreply.php?$session[sessionurl]do=newreply&noquote=1&p=$FIRSTPOSTID" rel="nofollow"><if condition="$show['closethread']"><img src="$stylevar[imgdir_button]/reply.gif" alt="$vbphrase[reply]" border="0" /><else /><img src="$stylevar[imgdir_button]/threadclosed.gif" alt="$vbphrase[closed_thread]" border="0" /></if></a></td>
replace the red with
href="$post[replylink]" rel="nofollow" id="qr_$post[postid]" onclick="return false"
default
code =
<td class="smallfont"><a href="newreply.php?$session[sessionurl]do=newreply&noquote=1&p=$FIRSTPOSTID" rel="nofollow"><if condition="$show['closethread']"><img src="$stylevar[imgdir_button]/reply.gif" alt="$vbphrase[reply]" border="0" /><else /><img src="$stylevar[imgdir_button]/threadclosed.gif" alt="$vbphrase[closed_thread]" border="0" /></if></a></td>
if you have more then one Styles use ( Template Modifications Manager )
good luck...
chefy
07-26-2012, 05:08 PM
Instructions provided by MAD--DOG aren't working. If you do that, the reply button does nothing.
Any input?
Simon Lloyd
07-26-2012, 05:19 PM
I've just had a look at that code and it seems to be fine, what's your issue with it? are you implementing it exactly as above? do you have quick reply turned on? do you have any mod working with quick reply?
chefy
07-26-2012, 05:34 PM
Indeed it seems to be fine... according to that instruction it's all about copying the "quick reply" link from the postbit and overwrite it over the "reply" link located at showthread however it looks not to be as easy as that. As I already said... if you do that then the reply button does nothing. Try it yourself and you'll see.
BirdOPrey5
07-26-2012, 05:59 PM
Are you using vb 3.x or 4.x? These instructions are for 3.x.
chefy
07-27-2012, 01:40 AM
Obviously, I'm using vB 3.8
Any ideas?
Simon Lloyd
07-27-2012, 06:01 AM
Ok so i checked it and it's because that variable isn't available in showthread, this is what you need:
Replace<td class="smallfont"><a href="newreply.php?$session[sessionurl]do=newreply&noquote=1&p=$FIRSTPOSTID" rel="nofollow"><if condition="$show['closethread']"><img src="$stylevar[imgdir_button]/reply.gif" alt="$vbphrase[reply]" border="0" /><else /><img src="$stylevar[imgdir_button]/threadclosed.gif" alt="$vbphrase[closed_thread]" border="0" /></if></a></td>With:<td class="smallfont"><a href="#qrform"><if condition="$show['closethread']"><img src="$stylevar[imgdir_button]/reply.gif" alt="$vbphrase[reply]" border="0" /><else /><img src="$stylevar[imgdir_button]/threadclosed.gif" alt="$vbphrase[closed_thread]" border="0" /></if></a></td>
chefy
07-27-2012, 01:10 PM
It works!
But you're missing one little but very important thing. If you use the regular quick reply button, you're moved down to the quick reply box and the focus is inside that box so you know that you should start typing.
After applying your instructions, the reply button indeed sends you to the quick reply box but the focus isn't on the box so newbie members could get confused.
Any workaround for this?
Simon Lloyd
07-27-2012, 01:57 PM
Not a quick fix without messing around with JS n stuff!, i'll take a look tonight when i get home.
BirdOPrey5
07-27-2012, 02:29 PM
Not tested but try adding this onclick event to the <a href...> tag:
onclick="document.getElementById('vB_Editor_QR_textarea').f ocus();"
chefy
07-27-2012, 03:40 PM
Unfortunately that isn't working, BirdOPrey5 :(
Simon Lloyd
07-27-2012, 03:55 PM
Not tested but try adding this onclick event to the <a href...> tag:
onclick="document.getElementById('vB_Editor_QR_textarea').f ocus();"
I thought that, but i believe the script is only available in the postbit template.
chefy
07-28-2012, 01:34 AM
Not a quick fix without messing around with JS n stuff!, i'll take a look tonight when i get home.
Thank you, hope to get some help from you if possible :up:
Simon Lloyd
07-28-2012, 06:08 AM
To be honest i think thats as good as you are going to get, i don't think you can set focus outside of the element, i tried numerous ways, so without having seperate JS for those two buttons you'll have to stick with just being sent to the form :|
BirdOPrey5
07-28-2012, 09:38 AM
We were on the right track but the trouble was the code I posted only worked in Chrome... It needed a little editing to work in Firefox and IE-
<td class="smallfont"><a href="javascript:void(0);" onclick="location.hash = '#qrform'; document.getElementById('vB_Editor_QR_textarea').f ocus();"><if condition="$show['closethread']"><img src="$stylevar[imgdir_button]/reply.gif" alt="$vbphrase[reply]" border="0" /><else /><img src="$stylevar[imgdir_button]/threadclosed.gif" alt="$vbphrase[closed_thread]" border="0" /></if></a></td>
That code works great in IE9, FF, and Chrome, and I would think all other browsers.
Should just have an option for people who are visiting without javascript enabled.
chefy
07-28-2012, 02:19 PM
Thanks, Simon and Bird.
Bird, I tested your latest code and it works on Chrome but still not working in Firefox 14. I haven't tested it yet on IE9 because I have IE8 and well it doesn't work on IE8 but at least I got feedback from IE8 error log:
"Can't move focus to the control because its invisible, not enabled, or of a type that does not accept the focus"
Maybe if we solve that problem then it will work on IE and Firefox!
Or maybe there is a type on your code?
BirdOPrey5
07-28-2012, 02:40 PM
I copied the code directly from my test site where it is/was working.
It is working fine on Firefox 13 and Firefox 14 and Waterfox which is a 64 bit version of Firefox.
I only put it in place of the top "Post Reply" button... curious if you tried it from that location?
You could try this alternate code- it should do the same thing, again I have tested it in IE9 and FF and Chrome:
<td class="smallfont"><a href="javascript:void(0);" onclick="location.hash = '#qrform'; vbform.elements['message'].focus();"><if condition="$show['closethread']"><img src="$stylevar[imgdir_button]/reply.gif" alt="$vbphrase[reply]" border="0" /><else /><img src="$stylevar[imgdir_button]/threadclosed.gif" alt="$vbphrase[closed_thread]" border="0" /></if></a></td>
As a last resort you could try it with removing the code:
location.hash = '#qrform';
chefy
07-28-2012, 03:02 PM
I figured out what the problem is. It works (I'm using your original code (https://vborg.vbsupport.ru/showpost.php?p=2352059&postcount=20)) when your quick reply box isn't WYSIWYG by default. When it's WYSIWYG by default (like mine) then it doesn't work. Try it and you'll see. Any workaround?
BirdOPrey5
07-28-2012, 04:29 PM
Good eye...
OK So I had to add a condition to test if the wysiwg editor is enabled, both in vb and the browser... this is working for me-
<if condition="$show['wysiwyg']">
<td class="smallfont"><a href="javascript:void(0);" onclick="location.hash = '#qrform'; if (document.getElementById('vB_Editor_QR_iframe')) { document.getElementById('vB_Editor_QR_iframe').foc us(); } else { document.getElementById('vB_Editor_QR_textarea').f ocus(); }"><if condition="$show['closethread']"><img src="$stylevar[imgdir_button]/reply.gif" alt="$vbphrase[reply]" border="0" /><else /><img src="$stylevar[imgdir_button]/threadclosed.gif" alt="$vbphrase[closed_thread]" border="0" /></if></a></td>
<else />
<td class="smallfont"><a href="javascript:void(0);" onclick="location.hash = '#qrform'; document.getElementById('vB_Editor_QR_textarea').f ocus();"><if condition="$show['closethread']"><img src="$stylevar[imgdir_button]/reply.gif" alt="$vbphrase[reply]" border="0" /><else /><img src="$stylevar[imgdir_button]/threadclosed.gif" alt="$vbphrase[closed_thread]" border="0" /></if></a></td>
</if>
EDIT- Damn, working in FF but not IE9... so close...
chefy
07-28-2012, 04:46 PM
Thanks! Now it's working fine in Firefox... so it's all about getting it to work on IE. I'm not a programmer but I'll try to play with your code and see if I have luck. I hope so!
BirdOPrey5
07-28-2012, 04:49 PM
In Googling the issue setting focus in IE is a common problem-
I tried some options here: http://stackoverflow.com/questions/2045707/setting-focus-to-an-iframe-in-ie
But no luck yet.
chefy
07-28-2012, 05:06 PM
I have noticed that when using the quick reply button the focus is inside the text area be it WYSIWYG or not (IE9). So I'm sure that what I'm looking for is doable however it appears to be more hard than what I expected :(
vbresults
07-30-2012, 03:07 AM
Wow, so simple in theory. Not surprising, though. xD
chefy
07-30-2012, 01:57 PM
If anyone knows how to make this to work please help.
vbresults
07-30-2012, 03:22 PM
Put this in the <head> section of the SHOWTHREAD template --
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
jQuery.noConflict();
(function ($) {
$(document).ready(function() {
$('body').find('a[href^="newreply.php"]:not([id])').each(function() {
$(this).click(function() {
$('a#qr_1').click();
return false;
});
});
});
})(jQuery);
</script>
chefy
07-30-2012, 03:35 PM
Haven't tested it yet but I can see that you're using jQuery which will add more than 90KB in size to my showthread.php pages. I guess that if you're using an external javascript it means that there is no other way to focus the cursor on the WYSIWYG quick reply box in IE9 when using the code shared by Bird (https://vborg.vbsupport.ru/showpost.php?p=2352150&postcount=24)? His code is working perfectly fine in Firefox, Chrome and even IE9 (but only when using the non-WYSIWYG editor).
vbresults
07-30-2012, 03:45 PM
Haven't tested it yet but I can see that you're using jQuery which will add more than 90KB in size to my showthread.php pages. I guess that if you're using an external javascript it means that there is no other way to focus the cursor on the WYSIWYG quick reply box in IE9 when using the code shared by Bird (https://vborg.vbsupport.ru/showpost.php?p=2352150&postcount=24)? His code is working perfectly fine in Firefox, Chrome and even IE9 (but only when using the non-WYSIWYG editor).
I won't say that there is no other way, but the way I posted should work under all circumstances.
chefy
07-30-2012, 03:56 PM
Thanks for the input.
Do you think that it's possible to make this to work with the included YUI js library that comes by default with vB 3.8? Because relying on jQuery adds more than 90KBs in size to my showthread.php pages :-(
vbresults
07-30-2012, 04:00 PM
Of course it's possible. I can't do it, though; maybe someone else can. :)
It's on Google's CDN so it shouldn't be that big of a deal.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.