示例#1
0
}
//Database password no longer needed, unset variable
unset($config_password);
//HTML Purifier Config
$purifier_config = HTMLPurifier_Config::createDefault();
$purifier_config->set('HTML.Allowed', 'b,a[href],i,br,em,strong,ul,li');
$purifier_config->set('URI.Base', $_SERVER['DOCUMENT_ROOT']);
$purifier_config->set('URI.MakeAbsolute', true);
$purifier_config->set('URI.DisableExternal', true);
$purifier = new HTMLPurifier($purifier_config);
//Smarty
$tpl = new Smarty();
$tpl->template_dir = CUR_DIR . '/smarty/templates/';
$tpl->compile_dir = CUR_DIR . '/smarty/templates_c/';
$tpl->config_dir = CUR_DIR . '/smarty/configs/';
$tpl->cache_dir = CUR_DIR . '/smarty/cache/';
//Initialize $player
$player = 0;
//Create a hooks object
$hooks = new Hooks($db, $tpl, $player);
//Include all hook files
$hook_files = scandir(HOOKS_DIR);
foreach ($hook_files as $hook_file) {
    $path_parts = pathinfo(HOOKS_DIR . '/' . $hook_file);
    if ($path_parts['extension'] == 'php' && $path_parts['basename'] != 'index.php') {
        include_once HOOKS_DIR . '/' . $hook_file;
    }
}
//Run login hooks on player variable
$player = $hooks->run_hooks('player', 0);