Example #1
0
if (!$no_plugins_active) {
    // if there are any registered plugins with this game
    require 'classes/plugins-class.php';
    // require the plugins base class
    $plugins = new plugins(NULL);
    foreach ($config['game']['plugins'] as $plugin) {
        // foreach plugin there is
        // file = root to www path + echelon path + path to plugin from echelon path
        $file = getenv("DOCUMENT_ROOT") . PATH . 'lib/plugins/' . $plugin . '/class.php';
        // abolsute path - needed because this page is include in all levels of this site
        if (file_exists($file)) {
            require $file;
            $plugins_class["{$plugin}"] = call_user_func(array($plugin, 'getInstance'), 'name');
            //$plugin::getInstance(); // create a new instance of the plugin (whatever, eg. xlrstats) plugin
        } else {
            if ($mem->reqLevel('manage_settings')) {
                // only show the error to does who can fix it
                set_error('Unable to include the plugin file for the plugin ' . $plugin . '<br /> In the directory: ' . $file);
            }
        }
    }
    plugins::setPluginsClass($plugins_class);
}
## If auth needed on this page ##
if (!isset($auth_user_here)) {
    $auth_user_here = true;
}
// default to login required
if ($auth_user_here != false) {
    // some pages do not need auth but include this file so this following line is optional
    $mem->auth($auth_name);