Page 1 of 1

CKEditor as default editor

Posted: Fri Feb 27, 2015 9:27 am
by arne johansson
Hello,
I'm using the plugin "user self-registration" and want the CKEditor to be the default editor. As it is now I have, as administrator, to change editor for every new user.

Is it possible to set the CKEditor as default, an if, how do I do that?

Best regards
Arne Johansson

Re: CKEditor as default editor

Posted: Fri Feb 27, 2015 11:40 pm
by garvinhicking
Hey,

currently the plugin doesn't offer an option to actually do that. But it's not so hard to patch out until we add the config option (it would make sense to set defaults for ALL available options, but that is some larger work).

To achieve it in your case, simply edit the common.inc.php file of the plugin and search for this line:

Code: Select all

                    serendipity_db_query("UPDATE {$serendipity['dbPrefix']}authors
                                             SET right_publish = '" . ($author['right_publish'] ? '1' : '0') . "',
                                                 password      = '" . $author['password'] . "'
                                           WHERE authorid = " . (int)$newID);
                    serendipity_set_config_var('no_create', $author['no_create'], $newID);
                    serendipity_set_config_var('lang', $serendipity['lang'], $newID);
now change that to:

Code: Select all

                    serendipity_db_query("UPDATE {$serendipity['dbPrefix']}authors
                                             SET right_publish = '" . ($author['right_publish'] ? '1' : '0') . "',
                                                 password      = '" . $author['password'] . "'
                                           WHERE authorid = " . (int)$newID);
                    serendipity_set_config_var('no_create', $author['no_create'], $newID);
                    serendipity_set_config_var('lang', $serendipity['lang'], $newID);
                    serendipity_set_config_var('wysiwyg', 1, $newID);
The last line is what's new, it simply sets the option called "wysiwyg" to 1 (yes) by default.

(This will only apply to new users, not existing ones)

HTH,
Garvin

Re: CKEditor as default editor

Posted: Fri Feb 27, 2015 11:42 pm
by garvinhicking
(I created a github issue https://github.com/s9y/Serendipity/issues/308 for this to remind me of adding such a feature in the future)

Re: CKEditor as default editor

Posted: Fri Mar 13, 2015 11:26 am
by garvinhicking
Hey!

This has now been addressed in the new version of the plugin (2.38) that should apeart within the next 24 hours on Spartacus.