Posts: 24
Threads: 4
Joined: Feb 2024
Reputation:
4
2024-02-13, 09:01 AM
(This post was last modified: 2024-02-13, 09:01 AM by ZnapShot.)
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.
Posts: 1,005
Threads: 129
Joined: Apr 2020
Reputation:
77
2024-02-13, 11:29 AM
Yes it works with the quick post
Posts: 24
Threads: 4
Joined: Feb 2024
Reputation:
4
2024-02-13, 11:37 AM
(This post was last modified: 2024-02-13, 11:38 AM by ZnapShot. Edited 1 time in total.)
(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
to be more precise, i want the editor enabled in PM quick reply
Posts: 79
Threads: 4
Joined: Sep 2019
Reputation:
15
2024-02-13, 11:46 AM
(This post was last modified: 2024-02-13, 11:48 AM by Schnapsnase. Edited 1 time in total.)
(2024-02-13, 11:29 AM)PARADOX987 Wrote: Yes it works with the quick post
This cannot work in PM´s without various changes in the plugin.
Posts: 24
Threads: 4
Joined: Feb 2024
Reputation:
4
2024-02-13, 11:51 AM
(2024-02-13, 11:46 AM)Schnapsnase Wrote: (2024-02-13, 11:29 AM)PARADOX987 Wrote: Yes it works with the quick post
This cannot work in PM´s without various changes in the plugin.
hrm, well i had hope, that this would'nt be that hard 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 so.... yeah okay then
btw, nice nickname
Posts: 79
Threads: 4
Joined: Sep 2019
Reputation:
15
2024-02-13, 12:01 PM
(2024-02-13, 11:51 AM)ZnapShot Wrote: hrm, well i had hope, that this would'nt be that hard
it´s also not
Posts: 24
Threads: 4
Joined: Feb 2024
Reputation:
4
Posts: 79
Threads: 4
Joined: Sep 2019
Reputation:
15
2024-02-13, 12:38 PM
(This post was last modified: 2024-02-13, 12:39 PM by Schnapsnase. Edited 2 times in total.)
(2024-02-13, 12:06 PM)ZnapShot Wrote: willing to raise a beer for a solution
just quickly and untested
<?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();
}
Posts: 24
Threads: 4
Joined: Feb 2024
Reputation:
4
2024-02-13, 12:50 PM
(This post was last modified: 2024-02-13, 12:59 PM by ZnapShot. Edited 1 time in total.)
(2024-02-13, 12:38 PM)Schnapsnase Wrote: (2024-02-13, 12:06 PM)ZnapShot Wrote: willing to raise a beer for a solution
just quickly and untested
nice try didn't work
edit: Really nice try.... works xD was too dumb to reinitialise templates.... thanks man, next beer is on me
Posts: 79
Threads: 4
Joined: Sep 2019
Reputation:
15
2024-02-13, 12:59 PM
(This post was last modified: 2024-02-13, 01:01 PM by Schnapsnase. Edited 1 time in total.)
(2024-02-13, 12:50 PM)ZnapShot Wrote: nice try didn't work
Okay
I can't test it at the moment.
I'll revise it again in the evening.
You have deactivated/activated?
|