Quantcast
Channel: MyBB Community Forums - Tutorials
Viewing all articles
Browse latest Browse all 690

Create A Simple Plugin To Disable "Simple" Mode When Editing Style Sheets

$
0
0
I don't know if anyone else is interested at all, but I despise the "simple" editing mode, so I wrote a very simple plugin to disable "simple" mode in ACP.

To make this edit on your forums, you will need to add the following contents to a PHP file named smmd.php (for simple mode must die lol) and copy it into the inc/plugins folder of your forum. Then of course, you have to activate it.

PHP Code:
<?php
/**
 * Simple Mode Must Die!
 */

/**
 * plugin info
 *
 * @return void
 */
function smmd_info()
{
    return array(
        'name' => 'Simple Mode Must Die!',
        'compatability' => '18*',
        'version' => '0.1',
        'author' => 'Wildcard',
    );
}

if (
defined('IN_ADMINCP')) {
    $plugins->add_hook('admin_style_themes_begin''smmd_admin_themes_begin');
}

/**
 * disable simple mode style sheet editing
 *
 * @return void
 */
function smmd_admin_themes_begin()
{
    global $mybb;
    if($mybb->input['action'] == "edit_stylesheet" && (!isset($mybb->input['mode']) || $mybb->input['mode'] == "simple"))
    {
        $mybb->input['mode'] = 'advanced';
    }
}

?>


If you already have a custom plugin for your forum, it would be much better to just copy the plugin hook conditional and the function into an existing plugin.

Note: The compatibility option in plugin info can work for 1.6 as well, just edit it as you like.

Viewing all articles
Browse latest Browse all 690

Trending Articles