MyBB Community Forums

Full Version: set all users to sourec mode
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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...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?
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);
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.