Jump to the post that solved this thread.
Solved: 7 Years, 7 Months ago Editor in source mode by default?
#11
Solved: 7 Years, 7 Months ago
(2015-01-13, 09:03 PM)Ad Bakker Wrote: As I can see, the option in the User control panel "Put the editor in source mode by default" is selected by default when a new member subscibes.
Is it possible to have it unselected by default? Now I have to explain new members every time that they must unselect this option by modifying their UserCP options.

Same problem. I tried adding on member_register template:
<input type="checkbox" class="checkbox" style="visibility: hidden;" name="sourceeditor" id="sourceeditor" value="1" />
(a checkbox unchecked invisible)

...but don't work.

Sad
Reply
#12
Solved: 7 Years, 7 Months ago
Sorry, wrong solution.

Try:

Change the template "codebuttons" in the set "Ungrouped Templates". When line 35 is changed to:


PHP Code:
MyBBEditor.sourceMode(true); 

it works with me
Regards, Ad Bakker (NL)
Reply
#13
Solved: 7 Years, 7 Months ago
(2015-01-19, 10:31 AM)Ad Bakker Wrote: Sorry, wrong solution.

Try:

Change the template "codebuttons" in the set "Ungrouped Templates". When line 35 is changed to:


PHP Code:





MyBBEditor.sourceMode(true); 

it works with me

Yes but this will ignore the option of CPUser.

I solved this adding a line in 'member.php'

find:
$user['options'] = array(
 "allownotices" => $mybb->get_input('allownotices', 1),
 "hideemail" => $mybb->get_input('hideemail', 1),
 "subscriptionmethod" => $mybb->get_input('subscriptionmethod', 1),
 "receivepms" => $mybb->get_input('receivepms', 1),
 "pmnotice" => $mybb->get_input('pmnotice', 1),
 "pmnotify" => $mybb->get_input('pmnotify', 1),
 "invisible" => $mybb->get_input('invisible', 1),
 "dstcorrection" => $mybb->get_input('dstcorrection')
 );

and add "sourceeditor" line:

$user['options'] = array(
 "sourceeditor" => $mybb->get_input('sourceeditor', 1), 
 "allownotices" => $mybb->get_input('allownotices', 1),
 "hideemail" => $mybb->get_input('hideemail', 1),
 "subscriptionmethod" => $mybb->get_input('subscriptionmethod', 1),
 "receivepms" => $mybb->get_input('receivepms', 1),
 "pmnotice" => $mybb->get_input('pmnotice', 1),
 "pmnotify" => $mybb->get_input('pmnotify', 1),
 "invisible" => $mybb->get_input('invisible', 1),
 "dstcorrection" => $mybb->get_input('dstcorrection')
 );


And adding:
<input type="checkbox" class="checkbox" style="visibility: hidden;" name="sourceeditor" id="sourceeditor" value="1" />
...in 'member_register' template


This will leave the source editor as disabled by default in the registry, but if the user decides to activate it in the control panel, will work correctly Wink
Reply
#14
Solved: 7 Years, 7 Months ago
(2015-01-14, 04:37 AM).m. Wrote: IIRC, it is not selected by default!

anyway, you can run below SQL queries (see this guidance if required)
ALTER TABLE `mybb_users` CHANGE `sourceeditor` `sourceeditor` TINYINT(1) NOT NULL DEFAULT '0';
UPDATE `mybb_users` SET `sourceeditor` = '0' WHERE `sourceeditor` = '1';

Hello there,

I need help with this query. I ran it in my 1.8.22 install, but the output returned is

Quote:MySQL returned an empty result set (i.e. zero rows). (Query took 0.0012 seconds.)
ALTER TABLE mybb_users CHANGE sourceeditor sourceeditor TINYINT(1) NOT NULL DEFAULT '1'

I could be missing something. So let me know.

My goal is that the source editor is set on by default. I have found that my new forum users get the setting set to "off" by default and when they start posting, they mess up the post replies by adding their reply within the blockquote of the other user. Also, when they change the font size, after posting the size looks smaller than what they actually meant to post. So to avoid all of these, I prefer to have them use source code from the get go.
Reply
#15
Solved: 7 Years, 7 Months ago
BUMP.
Hello comrades.

I'm bumping the thread again, since I need some help and haven't been able to figure out myself how to solve this.

Thanks for your support.
Reply
#16
Solved: 7 Years, 7 Months ago
Hello albano,

Probably the simplest way to achieve this is to edit line 652 of inc/datahandlers/user.php by changing the 0 to a 1 (I've left it unchanged in the code below):

		$this->verify_yesno_option($options, 'sourceeditor', 0);

The only problem with that is that you would need to repeat this change on any given upgrade of MyBB core if the upgrade overwrites this file.

So, better is a little plugin which effectively does the same thing but doesn't need to be maintained by you. Please try saving the attached file into your inc/plugins directory, and then activating it as the Default Source Mode Editor plugin in the ACP. New registrations should then default to source mode editing.


Attached Files
.php   defaultsourcemodeeditor.php (Size: 681 bytes / Downloads: 60)
Reply
#17
Solved: 7 Years, 7 Months ago
(2020-10-04, 03:33 AM)Laird Wrote: Hello albano,

Probably the simplest way to achieve this is to edit line 652 of inc/datahandlers/user.php by changing the 0 to a 1 (I've left it unchanged in the code below):

		$this->verify_yesno_option($options, 'sourceeditor', 0);

The only problem with that is that you would need to repeat this change on any given upgrade of MyBB core if the upgrade overwrites this file.

So, better is a little plugin which effectively does the same thing but doesn't need to be maintained by you. Please try saving the attached file into your inc/plugins directory, and then activating it as the Default Source Mode Editor plugin in the ACP. New registrations should then default to source mode editing.

Thank you. I will make the change and will follow up if run into issues. Thanks for providing the plugin as well.
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)