MyBB Community Forums
set all users to sourec mode - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: set all users to sourec mode (/thread-210644.html)



set all users to sourec mode - metulburr - 05-24-2017

i would like to set all current users to source mode, and by default for new users to set as source mode as well. I would also like the users to be able to reset this option if they want it.

This post is the closest i find
https://community.mybb.com/thread-165583-post-1132132.html#pid1132132

But i think its the opposite to set source mode off. Do you just switch 0s to 1s and 1s to 0s. Does this include TINYINT(1)? And im not sure if it allows the users to change it? What would be the exact command given to set current and future users by default to source mode that will allow them to change it if they wish later?

so i did this

mysql> ALTER TABLE `mybb_users` CHANGE `sourceeditor` `sourceeditor` TINYINT(0) NOT NULL DEFAULT '1'; 
Query OK, 0 rows affected (0.02 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> UPDATE `mybb_users` SET `sourceeditor` = '1' WHERE `sourceeditor` = '0';  
Query OK, 1319 rows affected (0.03 sec)
Rows matched: 1319  Changed: 1319  Warnings: 0

mysql> 
which my intention was to set current and future accounts to source mode by default. It did change the current users to source mode, but when i created a new account it did not have the editor in source mode checked off.

Why is this?


cant figure out how to set default source mode to enabled - metulburr - 05-24-2017

I amtrying to enable source mode for new accounts.

I tried this sql command
mysql> ALTER TABLE `mybb_users` CHANGE `sourceeditor` `sourceeditor` TINYINT(0) NOT NULL DEFAULT '1';
Query OK, 0 rows affected (0.02 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> UPDATE `mybb_users` SET `sourceeditor` = '1' WHERE `sourceeditor` = '0';  
Query OK, 1319 rows affected (0.03 sec)
Rows matched: 1319  Changed: 1319  Warnings: 0

mysql>
which changed all current users, but did not change new accounts to source mode enabled.

I then edited member.php to add the sourceeditor line
    $user['options'] = array(
        "sourceeditor" => $mybb->get_input('sourceeditor', 1),

and added to member_register

<input type="checkbox" class="checkbox" style="visibility: hidden;" name="sourceeditor" id="sourceeditor" value="1" /> 

but every time i make a new account the users source mode is always disabled in UserCP.

EDIT:
The only way i got it to work globally is to force everyone to usesource mode regardless of their setting by adding in codebutton template the second line after the first line and commenting out the default value
MyBBEditor = $("#{$bind}").sceditor("instance");
//{ $ sourcemode }
MyBBEditor.sourceMode(true);



RE: cant figure out how to set default source mode to enabled - Michael2014 - 05-25-2017

Try this: https://community.mybb.com/thread-165583.html

and this: https://www.google.com/search?q=default+source+mode+to+enabled&oq=default+source+mode+to+enabled&aqs=chrome..69i57j69i61l3&sourceid=chrome&ie=UTF-8#q=default+source+mode+to+enabled+mybb

good luck


RE: set all users to sourec mode - metulburr - 05-25-2017

ive already tried that. Thus the reason i said i already tried the sql command and the template changes. And yeah i have already read all the results from each listing of the first page on that google search. Nothing new. None of those threads help as when i tried each one a new user would always have source mode disabled regardless of what i tried.