Popup Quick Reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #1
Popup Quick Reply
I converted my quick reply box to a popup quick reply, using a small script I found on the internet. It is kind of useless, but I like to use it Biggrin

http://www.scriptiny.com/2011/03/javascr...http://www.scriptiny.com/2011/03/javascript-moda

It does NOT need jQuery, weighs in at under 5kb and can have multiple instances on a page. I have a template conditional that makes it not useable by guests, so only my members see it. It's a nice bit of candy and this way I don't have to worry about the captcha for guest posts.

Requirements: Template conditionals Plugin.

Things to change: You need to alter your showthread and showthread quick reply templates and add the javascript and css to your headerinclude and stylesheets

Showthread quickreply:

HTML Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<if in_array($GLOBALS['mybb']->user['usergroup'], array(1,5,7)) then>
	<form method="post" action="newreply.php?tid={$tid}&amp;processed=1" name="quick_reply_form">
<else>
	<form method="post" action="newreply.php?tid={$tid}&amp;processed=1" name="quick_reply_form" id="quick_reply_form">
</if>
		<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
		<input type="hidden" name="subject" value="RE: {$thread['subject']}" />
		<input type="hidden" name="action" value="do_newreply" />
		<input type="hidden" name="posthash" value="{$posthash}" id="posthash" />
		<input type="hidden" name="quoted_ids" value="" id="quoted_ids" />
		<input type="hidden" name="lastpid" id="lastpid" value="{$last_pid}" />
		<input type="hidden" name="from_page" value="{$page}" />
		<input type="hidden" name="tid" value="{$tid}" />
		<input type="hidden" name="method" value="quickreply" />
			<div class="thead">Quick Reply</div><br />
				<div style="width: 99%; text-align:center;">
				<textarea style="width: 100%; text-align:left;padding: 1px; margin: 0;" rows="8" cols="80" name="message" id="message" tabindex="1"></textarea>
				</div>
			<div class="editor_control_bar" style="width: 95%; padding: 4px; margin-top: 3px; display: none;" id="quickreply_multiquote">
						<span class="smalltext">
						{$lang->quickreply_multiquote_selected} <a href="./newreply.php?tid={$tid}&amp;load_all_quotes=1" onclick="return Thread.loadMultiQuoted();">{$lang->quickreply_multiquote_now}</a> {$lang->or} <a href="javascript:Thread.clearMultiQuoted();">{$lang->quickreply_multiquote_deselect}</a>.
						</span>
			</div>
			<br />
			<div class="trow1">
					<div align="center"><input type="submit" class="button" value="{$lang->post_reply}" tabindex="2" accesskey="s" id="quick_reply_submit" onclick='parent.TINY.box.hide({animate:true})' />&nbsp;<input type="submit" class="button" name="previewpost" value="{$lang->preview_post}" tabindex="3" onclick='parent.TINY.box.hide({animate:true})' />&nbsp;<a href="./newreply.php?tid={$tid}" onclick='parent.TINY.box.hide({animate:true})'><span class="button"> Advanced Reply</span></a>&nbsp;<a href="javascript:parent.TINY.box.hide({animate:true})"><span class="button">Cancel</span></a>
					</div>
			</div>

	</form>


Showthread:

Find both instances of the variable "newreply" in your template and change to the below:

HTML Code
<a href="javascript:;" onclick="TINY.box.show({html:document.getElementById('quick_reply').innerHTML, animate:true,close:false});"><span class="button">Reply</span></a>



Find the "quickreply" variable in showthread and change it to the below:

HTML Code
<div id ="quick_reply" style="display:none;">{$quickreply}</div>

Please note I am not a coder and I apologise in advance for any mistakes in this layout. See attached for example of how it looks on leefish. I have custom css on my buttons; if you use the class "button" in your css you should get a similar result.



Attached File(s) Thumbnail(s)
   


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 05-08-2012 08:23 AM by leefish.)
05-08-2012 08:00 AM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Popup Quick Reply - leefish - 05-08-2012 08:00 AM
RE: Popup Quick Reply - RateU - 05-09-2012, 04:47 AM
RE: Popup Quick Reply - leefish - 05-10-2012, 12:57 AM
RE: Popup Quick Reply - brad-t - 05-10-2012, 01:22 AM
RE: Popup Quick Reply - Sama34 - 05-10-2012, 01:58 PM
RE: Popup Quick Reply - leefish - 05-11-2012, 03:22 AM
RE: Popup Quick Reply - brad-t - 05-11-2012, 10:49 PM
RE: Popup Quick Reply - terzier - 05-23-2012, 01:22 AM
RE: Popup Quick Reply - Sama34 - 06-09-2012, 12:14 PM
RE: Popup Quick Reply - leefish - 06-09-2012, 01:56 PM
RE: Popup Quick Reply - Sama34 - 06-09-2012, 02:03 PM
RE: Popup Quick Reply - leefish - 06-09-2012, 05:34 PM
RE: Popup Quick Reply - Jonatthu - 04-07-2013, 03:26 AM
RE: Popup Quick Reply - leefish - 04-10-2013, 11:18 PM

 Standard Tools
Forum Jump: