PDA

View Full Version : making "Quote message in reply?" checked automatically


Fangs404
11-17-2009, 12:31 AM
So I want my "Quote message in reply?" checkbox in the quick reply box to be checked at all times. Now the most obvious way to do that is to edit the SHOWTHREAD template and turn:

<label for="qr_quickreply"><input type="checkbox" name="quickreply" value="1" id="qr_quickreply" accesskey="w" tabindex="4" />$vbphrase[quote_message_in_reply]</label>

into this:

<label for="qr_quickreply"><input type="checkbox" name="quickreply" value="1" id="qr_quickreply" accesskey="w" tabindex="4" checked="checked" />$vbphrase[quote_message_in_reply]</label>

This is all fine and does indeed check the box by default when a new thread is loaded. However, if someone uses the quick reply box without hitting the quick reply button for a specific post, the box clears itself. I can't figure out why. The box should always be checked. I don't even understand why it's unchecked by default.

How can I ensure that the box will remain checked when a user submits a reply to the thread without quick replying any particular post?

kh99
11-17-2009, 12:53 AM
I think maybe the problem is that the check box is disabled if you haven't pressed the button for a post, I guess the idea being that you aren't replying to a particular post so there's nothing to quote. Maybe it looks like it clears because it's disabled?

Fangs404
11-17-2009, 12:55 AM
I think maybe the problem is that the check box is disabled if you haven't pressed the button for a post, I guess the idea being that you aren't replying to a particular post so there's nothing to quote. Maybe it looks like it clears because it's disabled?
No, it definitely clears. I know this because if I reply using the quick reply box and then try to reply to a specific post in the thread, the post doesn't get quoted in the reply.

kh99
11-17-2009, 12:58 AM
Oh, I think I see - you're saying that if you use it once without quoting a post, the next time (after the page reloads) it's unchecked?

Fangs404
11-17-2009, 01:00 AM
Oh, I think I see - you're saying that if you use it once without quoting a post, the next time (after the page reloads) it's unchecked?
Exactly.

I think it has something to do with the AJAX code. It must somehow be clearing the box, but I don't know where to look to make sure the box stays checked. I never want it cleared unless the user clears it.

kh99
11-17-2009, 01:30 AM
Yeah, I think the JavaScript for that is in clientscript/vbulletin_quick_reply.js, and it looks like it clears that checkbox if a post wasn't selected. So I guess one way is to figure out how to change or add JS.

Another idea might be to rename that checkbox so the JS won't mess with it, then use a plugin on newreply_post_start to read the value of the checkbox and fix things up on the server side.

Fangs404
11-18-2009, 04:17 AM
Yeah, I think the JavaScript for that is in clientscript/vbulletin_quick_reply.js, and it looks like it clears that checkbox if a post wasn't selected. So I guess one way is to figure out how to change or add JS.

Another idea might be to rename that checkbox so the JS won't mess with it, then use a plugin on newreply_post_start to read the value of the checkbox and fix things up on the server side.
Awesome. I'll check that file. Thanks. :)

MissKalunji
05-10-2011, 05:12 PM
So I want my "Quote message in reply?" checkbox in the quick reply box to be checked at all times. Now the most obvious way to do that is to edit the SHOWTHREAD template and turn:

<label for="qr_quickreply"><input type="checkbox" name="quickreply" value="1" id="qr_quickreply" accesskey="w" tabindex="4" />$vbphrase[quote_message_in_reply]</label>

into this:

<label for="qr_quickreply"><input type="checkbox" name="quickreply" value="1" id="qr_quickreply" accesskey="w" tabindex="4" checked="checked" />$vbphrase[quote_message_in_reply]</label>

This is all fine and does indeed check the box by default when a new thread is loaded. However, if someone uses the quick reply box without hitting the quick reply button for a specific post, the box clears itself. I can't figure out why. The box should always be checked. I don't even understand why it's unchecked by default.

How can I ensure that the box will remain checked when a user submits a reply to the thread without quick replying any particular post?

I was looking for this :)

thanks!