MyBB Hacks

Full Version: Popup Quick Reply
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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
<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.

Thanks, Lee. Maybe I will use it for my log in or quick sign up box.
Thanks RateU. I use a rather fancier one for my sign up/sign in at the moment, but I am not too happy with the amount of jscript I have to call to use it - it uses scriptaculous effects and an additional js file. Whenever I try and combine my scripts the board blows up, so I am trying to REDUCE instead.
Very nice Smile
I did this some time ago using Fancybox, will try your now that I´m reinstalling my board.
Yes, I saw that, but as jQuery is still not core in MYBB I am struggling to justify loading all the js for what is basically candy. That is why I looked at this small script.
This looks great. Not sure why anyone would want more animation than this either, they were very slick and fast.
many thanks, dude. [Image: m087.gif] good article.

"Subscribe to this thread" (bookmark) first [Image: m136.gif]
For some reason the quick quote feature stops working Ouch
hmm, odd. It worked fine on mine when I had multiquote enabled.
Pages: 1 2
Reference URL's