Jump to the post that solved this thread.
Not Solved Quickreply_TextEditor - Enable editor in PM
#1
Not Solved
Hey guys, 

anyone who already made the step to enable the editor in private message quickreply editor like https://community.mybb.com/mods.php?acti...w&pid=1531 does with the post quick reply editor? This would be a great extension.
Reply
#2
Not Solved
Yes it works with the quick post
Reply
#3
Not Solved
(2024-02-13, 11:29 AM)PARADOX987 Wrote: Yes it works with the quick post

well okay, then i messed something up with my theming.... because on my board, it doesnt Big Grin

to be more precise, i want the editor enabled in PM quick reply Smile
Reply
#4
Not Solved
(2024-02-13, 11:29 AM)PARADOX987 Wrote: Yes it works with the quick post

Huh 
This cannot work in PM´s without various changes in the plugin. Wink
Reply
#5
Not Solved
(2024-02-13, 11:46 AM)Schnapsnase Wrote:
(2024-02-13, 11:29 AM)PARADOX987 Wrote: Yes it works with the quick post

Huh 
This cannot work in PM´s without various changes in the plugin. Wink

hrm, well i had hope, that this would'nt be that hard Big Grin i had a quick'n'dirty try to implement this myself but i have lots of more important stuff to do on my b oard so i dropped the idea in hope someone already did it Big Grin so.... yeah okay then

btw, nice nickname Toungue
Reply
#6
Not Solved
(2024-02-13, 11:51 AM)ZnapShot Wrote: hrm, well i had hope, that this would'nt be that hard Big Grin

it´s also not Big Grin
Reply
#7
Not Solved
(2024-02-13, 12:01 PM)Schnapsnase Wrote:
(2024-02-13, 11:51 AM)ZnapShot Wrote: hrm, well i had hope, that this would'nt be that hard Big Grin

it´s also not Big Grin

willing to raise a beer for a solution Big Grin
Reply
#8
Not Solved
(2024-02-13, 12:06 PM)ZnapShot Wrote: willing to raise a beer for a solution Big Grin

just quickly and untested Wink

<?php

if (!defined('IN_MYBB')) {
	die('Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.');
}

$plugins->add_hook('showthread_start', 'quickeditor_codes');
$plugins->add_hook('private_start', 'quickeditor_codes');

const c_quickeditor_reset_js = <<<'EOF'

						<script type="text/javascript">
						$(function() {
							$('#quick_reply_form').on('reset', function() {
								MyBBEditor.val('');
							});
						});
						</script>
EOF;

function quickeditor_info()
{
	return array(
		'name'          => 'Quick Editor',
		'description'   => 'Enable the full editor in the quick reply form when viewing threads.',
		'website'       => 'https://storiespedia.com',
		'author'        => 'PARADOX (with help from Laird)',
		'authorsite'    => 'https://community.mybb.com/user-134311.html',
		'version'       => '1.0.2',
		'codename'      => 'quickeditor',
		'compatibility' => '18*'
	);
}

function quickeditor_activate() 
{
	require_once MYBB_ROOT.'/inc/adminfunctions_templates.php';
	find_replace_templatesets('showthread_quickreply', '(' . preg_quote('</textarea>') . ')', '</textarea>{$codebuttons}'.c_quickeditor_reset_js);
	find_replace_templatesets('showthread_quickreply', '(' . preg_quote('{$option_signature}') . ')', '{$smilieinserter}{$option_signature}');
	find_replace_templatesets('showthread_quickreply', '(' . preg_quote('<textarea style="') . ')', '<textarea style="height: 280px; ');
	find_replace_templatesets('private_quickreply', '(' . preg_quote('</textarea>') . ')', '</textarea>{$codebuttons}'.c_quickeditor_reset_js);
	find_replace_templatesets('private_quickreply', '(' . preg_quote('{$lang->message_note}<br /><br />') . ')', '{$lang->message_note}<br /><br />{$smilieinserter}');
	find_replace_templatesets('private_quickreply', '(' . preg_quote('<textarea style="') . ')', '<textarea style="height: 280px; ');
}

function quickeditor_deactivate() 
{
	require_once MYBB_ROOT.'/inc/adminfunctions_templates.php';
	find_replace_templatesets('showthread_quickreply', '(' . preg_quote('{$codebuttons}'.c_quickeditor_reset_js) . ')', '', 0);
	find_replace_templatesets('showthread_quickreply', '(' . preg_quote('{$smilieinserter}') . ')', '', 0);
	find_replace_templatesets('showthread_quickreply', '(' . preg_quote('height: 280px; ') . ')', '', 0);
	find_replace_templatesets('private_quickreply', '(' . preg_quote('{$codebuttons}'.c_quickeditor_reset_js) . ')', '', 0);
	find_replace_templatesets('private_quickreply', '(' . preg_quote('{$smilieinserter}') . ')', '', 0);
	find_replace_templatesets('private_quickreply', '(' . preg_quote('height: 280px; ') . ')', '', 0);
}

function quickeditor_codes()
{
	global $codebuttons, $smilieinserter;

	$codebuttons = build_mycode_inserter();
	$smilieinserter = build_clickable_smilies();
}
Reply
#9
Not Solved
(2024-02-13, 12:38 PM)Schnapsnase Wrote:
(2024-02-13, 12:06 PM)ZnapShot Wrote: willing to raise a beer for a solution Big Grin

just quickly and untested Wink

nice try Big Grin didn't work Wink

edit: Really nice try.... works xD was too dumb to reinitialise templates.... thanks man, next beer is on me
Reply
#10
Not Solved
(2024-02-13, 12:50 PM)ZnapShot Wrote: nice try Big Grin didn't work Wink

Okay Big Grin
I can't test it at the moment.
I'll revise it again in the evening. Wink
You have deactivated/activated?
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)