<?php

defined('MAXIMUS') or die ('Access denied connect MAXIMUS directly...');

 // ob_start();

function replace_quote ($chaine) {
$chaine = ereg_replace("\"","'",$chaine);
return $chaine;
}

$sql = "SELECT HIGH_PRIORITY `sitename`, `nukeurl`, `site_logo`, `slogan`, `startdate`, `adminmail`, `anonpost`, `Default_Theme`, `foot1`, `foot2`, `foot3`, `anonymous`, `broadcast_msg`, `my_headlines`, `top`, `user_news`, `oldnum`, `ultramode`, `banners`, `backend_title`, `backend_language`, `language`, `locale`, `decalage`, `multilingual`, `useflags`, `admingraphic`, `httpref`, `httprefmax`, `copyright`, `Version_Num`, `wysiwyg`, `dbi`, `rewrite` FROM `".TABLE_CONFIG."` ";
$result = $GLOBALS['db']->sql_query($sql) OR die("SQL Table Config denied");
$row    = $GLOBALS['db']->sql_fetchrow($result);
$nuke_config      = $row;
$sitename         = stripslashes($row['sitename']);
$nukeurl          = stripslashes($row['nukeurl']);
$site_logo        = stripslashes($row['site_logo']);
$slogan           = stripslashes($row['slogan']);
$startdate        = stripslashes($row['startdate']);
$adminmail        = stripslashes($row['adminmail']);
$anonpost         = $GLOBALS['db']->XMFbin($row['anonpost']);
$Default_Theme    = stripslashes($row['Default_Theme']);
$foot1            = replace_quote(stripslashes($row['foot1']));
$foot2            = replace_quote(stripslashes($row['foot2']));
$foot3            = replace_quote(stripslashes($row['foot3']));
$anonymous        = stripslashes($row['anonymous']);
$broadcast_msg    = $GLOBALS['db']->XMFbin($row['broadcast_msg']);
$my_headlines     = $GLOBALS['db']->XMFbin($row['my_headlines']);
$top              = $GLOBALS['db']->XMFnum($row['top']);
$user_news        = $GLOBALS['db']->XMFnum($row['user_news']);
$oldnum           = $GLOBALS['db']->XMFnum($row['oldnum']);
$ultramode        = $GLOBALS['db']->XMFbin($row['ultramode']);
$banners          = $GLOBALS['db']->XMFbin($row['banners']);
$backend_title    = stripslashes($row['backend_title']);
$backend_language = stripslashes($row['backend_language']);
$language         = stripslashes($row['language']);
$locale           = stripslashes($row['locale']);
$decalage         = $GLOBALS['db']->XMFnum($row['decalage']);
$multilingual     = $GLOBALS['db']->XMFbin($row['multilingual']);
$useflags         = $GLOBALS['db']->XMFbin($row['useflags']);
$admingraphic     = $GLOBALS['db']->XMFbin($row['admingraphic']);
$httpref          = $GLOBALS['db']->XMFbin($row['httpref']);
$httprefmax       = $GLOBALS['db']->XMFnum($row['httprefmax']);
$copyright        = replace_quote($row['copyright']);
$Version_Num      = stripslashes($row['Version_Num']);
$wysiwyg          = stripslashes($row['wysiwyg']);
$cldbi            = $GLOBALS['db']->XMFbin($row['dbi']);
$rewrite          = $GLOBALS['db']->XMFbin($row['rewrite']);

if (!defined('FORUM_ADMIN')) {
$file = fopen("".$cache."/Configuration/".$cache_prefix."_cache_config.php", "w");
$content = "";
$content .= "<?php\n defined(\"MAXIMUS\") or  Header(\"Location: ../index.php\"); \n";
$content .= "\$sitename = \"$sitename\";\n";
$content .= "\$nukeurl = \"$nukeurl\";\n";
$content .= "\$site_logo = \"$site_logo\";\n";
$content .= "\$slogan = \"$slogan\";\n";
$content .= "\$startdate = \"$startdate\";\n";
$content .= "\$adminmail = \"$adminmail\";\n";
$content .= "\$anonpost = \"$anonpost\";\n";
//$content .= "\$ultramode = \"$ultramode\";\n";
$content .= "\$Default_Theme = \"$Default_Theme\";\n";
$content .= "\$foot1 = \"$foot1\";\n";
$content .= "\$foot2 = \"$foot2\";\n";
$content .= "\$foot3 = \"$foot3\";\n";
$content .= "\$anonymous = \"$anonymous\";\n";
$content .= "\$broadcast_msg = \"$broadcast_msg\";\n";
$content .= "\$my_headlines = \"$my_headlines\";\n";
$content .= "\$top = \"$top\";\n";
$content .= "\$user_news = \"$user_news\";\n";
$content .= "\$oldnum = \"$oldnum\";\n";
$content .= "\$banners = \"$banners\";\n";
$content .= "\$backend_title = \"$backend_title\";\n";
$content .= "\$backend_language = \"$backend_language\";\n";
$content .= "\$language = \"$language\";\n";
$content .= "\$locale = \"$locale\";\n";
$content .= "\$decalage = \"$decalage\";\n";
$content .= "\$multilingual = \"$multilingual\";\n";
$content .= "\$useflags = \"$useflags\";\n";
$content .= "\$admingraphic = \"$admingraphic\";\n";
$content .= "\$httpref = \"$httpref\";\n";
$content .= "\$httprefmax = \"$httprefmax\";\n";
$content .= "\$copyright = \"$copyright\";\n";
$content .= "\$wysiwyg = \"$wysiwyg\";\n";
$content .= "\$cldbi = \"$cldbi\";\n";
$content .= "\$rewrite = \"$rewrite\";\n";
$content .= "\$Version_Num = \"1.1.0\";\n";
$content .= "\$Version_Id = \"Maximus\";\n";
$content .= "\$Version_Sub = \"Fuzion BS\";\n";
$content .= "\$Version_Cache = \"1.0.0\";";
fwrite($file, $content);
fclose($file);
}
$GLOBALS['db']->sql_freeresult($result);