$htaccess[] = "ErrorDocument 500\t{$config['furl']}/misc.php?action=error&id=500";
        $htaccess[] = "";
    }
    if ($config['correctsubdomains'] == 1) {
        $url = parse_url($config['furl']);
        $host = str_ireplace('www.', '', $url['host']);
        $htaccess[] = "RewriteEngine On";
        $htaccess[] = "RewriteCond %{HTTP_HOST} ^www\\." . preg_quote($host) . "\$ [NC]";
        $htaccess[] = "RewriteRule ^(.*)\$ http://" . $host . "/\$1 [R=301,L]";
        $htaccess[] = "";
    }
    $filesystem->file_put_contents('.htaccess', implode("\r\n", $htaccess));
}
$breadcrumb = new breadcrumb();
$breadcrumb->Add($config['fname'], 'index.php');
$phpdoc = new OutputDoc($config['gzip']);
$phpdoc->Start($config['gzcompression']);
define('PAGE_IS_GZIPPED', $config['gzip'] == 1 && $phpdoc->Encoding());
($code = $plugins->load('frontend_init')) ? eval($code) : null;
// Global and important functions (not for cron and external)
if (defined('TEMPNOFUNCINIT') == false || $config['foffline'] && defined('TEMPSHOWLOG') == false) {
    define('SCRIPT_START_TIME', benchmarktime());
    $slog = new slog();
    $my = $slog->logged();
    $lang->init($my->language);
    $tpl = new tpl();
    $slog->checkBan();
}
if ($config['foffline'] && defined('TEMPSHOWLOG') == false) {
    $my->p = $slog->Permissions();
    if ($my->p['admin'] != 1) {
include_once "classes/function.flood.php";
if (!file_exists('.htaccess')) {
    $htaccess = '';
    if ($config['hterrordocs'] == 1) {
        $htaccess = "\n\t    ErrorDocument 400\t{$config['furl']}/misc.php?action=error&id=400\n\t    ErrorDocument 401\t{$config['furl']}/misc.php?action=error&id=401\n\t    ErrorDocument 403\t{$config['furl']}/misc.php?action=error&id=403\n\t    ErrorDocument 404\t{$config['furl']}/misc.php?action=error&id=404\n\t    ErrorDocument 500\t{$config['furl']}/misc.php?action=error&id=500\n\t    ";
    }
    if ($config['correctsubdomains'] == 1) {
        $url = parse_url($config['furl']);
        $host = str_ireplace('www.', '', $url['host']);
        $htaccess .= "\n\t    RewriteEngine On\n\t    RewriteCond %{HTTP_HOST} ^www\\." . preg_quote($host) . "\$ [NC]\n\t    RewriteRule ^(.*)\$ http://" . $host . "/\$1 [R=301,L] \n\t    ";
    }
    @file_put_contents('.htaccess', $htaccess);
}
$breadcrumb = new breadcrumb();
$breadcrumb->Add($config['fname'], 'index.php');
$phpdoc = new OutputDoc($config['gzip']);
$phpdoc->Start($config['gzcompression']);
if ($config['gzip'] == 1 && $phpdoc->Encoding()) {
    $gzbenchval = 'On - Compression Rate: ' . $config['gzcompression'];
} else {
    $gzbenchval = 'Off';
}
($code = $plugins->load('frontend_init')) ? eval($code) : null;
// ToDo: Auslagern
$bannedip = file('data/bannedip.php');
$bannedip = array_map('trim', $bannedip);
if (count($bannedip) > 0) {
    foreach ($bannedip as $row) {
        if (strpos(' ' . getip(), ' ' . trim($row)) !== false) {
            $slog = new slog();
            $my = $slog->logged();