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
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #2
RE: Popup Quick Reply
Thanks, Lee. Maybe I will use it for my log in or quick sign up box.

05-09-2012 04:47 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #3
RE: Popup Quick Reply
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.


[Image: leelink.gif]
MYBB1.6 & XThreads
05-10-2012 12:57 AM
Visit this user's website Find all posts by this user Quote this message in a reply
brad-t Offline
Member
***
Posts: 120
Joined: Apr 2011
Post: #4
RE: Popup Quick Reply
Very nice Smile
05-10-2012 01:22 AM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #5
RE: Popup Quick Reply
I did this some time ago using Fancybox, will try your now that I´m reinstalling my board.

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
05-10-2012 01:58 PM
Visit this user's website Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #6
RE: Popup Quick Reply
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.


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 05-11-2012 03:22 AM by leefish.)
05-11-2012 03:22 AM
Visit this user's website Find all posts by this user Quote this message in a reply
brad-t Offline
Member
***
Posts: 120
Joined: Apr 2011
Post: #7
RE: Popup Quick Reply
This looks great. Not sure why anyone would want more animation than this either, they were very slick and fast.
05-11-2012 10:49 PM
Find all posts by this user Quote this message in a reply
terzier Offline
Member
***
Posts: 91
Joined: Feb 2012
Post: #8
RE: Popup Quick Reply
many thanks, dude. [Image: m087.gif] good article.

"Subscribe to this thread" (bookmark) first [Image: m136.gif]

Un-Official MyBB from Indonesia| Facebook Page|Twitter
GARUDA DIDADA KU
05-23-2012 01:22 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #9
RE: Popup Quick Reply
For some reason the quick quote feature stops working Ouch

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
06-09-2012 12:14 PM
Visit this user's website Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #10
RE: Popup Quick Reply
hmm, odd. It worked fine on mine when I had multiquote enabled.


[Image: leelink.gif]
MYBB1.6 & XThreads
06-09-2012 01:56 PM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: