Example #1
0
/**
 * Turns a plugin on and creates the row to show loading
 * @global resource
 * @param string $name name of plugin
 * @return boolean|string
 */
function load_plugin($name)
{
    global $database;
    if ($name == "") {
        return 'error_plugin_no_name';
    } else {
        if (!alpha($name, 'alpha-underscore')) {
            return 'error_plugin_name';
        } else {
            if (!already_loaded($name)) {
                // Insert plugin
                $database->query("INSERT INTO `plugins` SET `name` = '{$name}'");
                // Include
                include BASEPATH . '../plugins/' . $name . '.php';
                // That plugin has been loaded.
                plugin_loaded($name);
                // Install plugin
                if (function_exists('install_' . $name)) {
                    // set it up
                    $function = 'install_' . $name;
                    // initiate it
                    $function();
                }
                // Return true
                return true;
            }
        }
    }
    return 'error_already_loaded';
}
Example #2
0
    } else {
        if ($_GET['a'] == "manage") {
            $load_plugins = true;
            include '../include/common.php';
            $action = "revisions";
        } else {
            if (!defined('IN_NK')) {
                die('Invalid inclusion.');
            }
        }
    }
}
/**
 * Incase someone tries to load it when its not loaded.
 */
if (!already_loaded('titles')) {
    die(print_r($plugins_loaded));
}
/**
 * List of banned revisions
 */
$config['banned_titles'] = array('admin', 'banned', 'moderator', lang('administrator_title'), lang('banned_title'), lang('moderator_title'));
/**
 * Add hooks
 */
add_hook('user_profile_edit', 'profile_input', array());
add_hook('user_profile_post', 'profile_edit', array());
add_hook('user_navigation', 'profile_nav_link', array($action));
add_hook('admin_navigation', 'admin_nav_link', array($action));
/**
 * The page for revisions