vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How To Make Post Reply Becomes Quick Reply ? Please Guys (https://vborg.vbsupport.ru/showthread.php?t=246599)

BUDIMAN 07-15-2010 12:41 PM

How To Make Post Reply Becomes Quick Reply ? Please Guys
 
1 Attachment(s)
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

Quote:

Originally Posted by MAD--DOG (Post 2074482)
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
Code:

<td class="smallfont"><a href="newreply.php?$session[sessionurl]do=newreply&amp;noquote=1&amp;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

Code:

href="$post[replylink]" rel="nofollow" id="qr_$post[postid]" onclick="return false"


default
code =

Code:

               
<td class="smallfont"><a href="newreply.php?$session[sessionurl]do=newreply&amp;noquote=1&amp;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
HTML Code:

<td class="smallfont"><a href="newreply.php?$session[sessionurl]do=newreply&amp;noquote=1&amp;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:
HTML Code:

<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:

Code:

onclick="document.getElementById('vB_Editor_QR_textarea').focus();"

chefy 07-27-2012 03:40 PM

Unfortunately that isn't working, BirdOPrey5 :(

Simon Lloyd 07-27-2012 03:55 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2351879)
Not tested but try adding this onclick event to the <a href...> tag:

Code:

onclick="document.getElementById('vB_Editor_QR_textarea').focus();"

I thought that, but i believe the script is only available in the postbit template.

chefy 07-28-2012 01:34 AM

Quote:

Originally Posted by Simon Lloyd (Post 2351875)
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-

HTML Code:

<td class="smallfont"><a href="javascript:void(0);" onclick="location.hash = '#qrform'; document.getElementById('vB_Editor_QR_textarea').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>
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:

Code:

"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:

HTML Code:

<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:
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) 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-

Code:

      <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').focus(); } else { document.getElementById('vB_Editor_QR_textarea').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>
      <else />
                <td class="smallfont"><a href="javascript:void(0);" onclick="location.hash = '#qrform'; document.getElementById('vB_Editor_QR_textarea').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>
      </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/2...n-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 --
HTML Code:

<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? 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

Quote:

Originally Posted by chefy (Post 2352777)
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? 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.


All times are GMT. The time now is 04:48 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01407 seconds
  • Memory Usage 1,827KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_code_printable
  • (5)bbcode_html_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (34)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete