<?
if(substr($nrelpath, -1, 1)!='/')
$nrelpath .= '/';
if(substr($nrelpath, 0, 1)!='/')
$nrelpath = '/'.$nrelpath;
$data = "<?\n".
"// DO NOT EDIT THIS FILE - USE ADMINISTRATION INSTEAD\n\n".
"\$relpath = '$nrelpath';\n".
"\$admin_name = '$nadmin_name';\n".
"\$admin_pass = '$nadmin_pass';\n".
"\$admin_res = '$nadmin_res';\n".
"\$db_type = '$ndb_type';\n".
"\$db_host = '$ndb_host';\n".
"\$db_name = '$ndb_name';\n".
"\$db_user = '$ndb_user';\n".
"\$db_pass = '$ndb_pass';\n".
"\$encoding = '$nencoding';\n".
"\$lang_d = '$nlang_d';\n";
while(list($k, $v) = each($langlist))
$data .= "\$langlist['$k'] = '$v';\n";
$data .= "\$theme = '$ntheme';\n";
while(list($k, $v) = each($themes))
$data .= "\$themes['$k'] = '$v';\n";
$data .= "\$enable_html = ".($nenable_html?'true':'false').";\n".
"\$long_names = ".($nlong_names?'true':'false').";\n".
"\$cite = ".($ncite?'true':'false').";\n".
"\$req_email = ".($nreq_email?'true':'false').";\n".
"\$ext_mail = ".($next_mail?'true':'false').";\n".
"\$max_size = $nmax_size;\n".
"\$wrapsize = $nwrapsize;\n".
"\$block_ip = ".($nblock_ip?'true':'false').";\n".
"\$count_view = ".($ncount_view?'true':'false').";\n".
"\$coll_thr = ".($ncoll_thr?'true':'false').";\n".
"\$thrinmess = ".($nthrinmess?'true':'false').";\n".
"\n".
"// FORUMS\n";
if(!empty($forum_array)){
while(list($x, ) = each($forum_array)){
$data .= "\$forum_array[$x] = Array(\n".
" 'name' => '".addslashes($forum_array[$x]['name'])."',\n".
" 'desc' => '".addslashes($forum_array[$x]['desc'])."',\n".
" 'upload' => ".($forum_array[$x]['upload']?"true":"false").",\n".
" 'moderation' => ".($forum_array[$x]['moderation']?"true":"false").",\n".
" 'mod_pass' => '".addslashes($forum_array[$x]['mod_pass'])."',\n".
" 'theme' => '".$forum_array[$x]['theme']."',\n".
" 'tpp' => ".$forum_array[$x]['tpp'].",\n".
" 'mpp' => ".$forum_array[$x]['mpp']."\n".
");\n";
}
}
$data .= "?>\n";
$fp=@fopen("../config.php", "w");
if(!$fp){
error("Can't open configuration file. Check file permissions.");
}
fputs($fp, $data);
fclose($fp);
echo "<div style=\"font-size: 14pt\">Configuration saved.</div><br>\n";
echo "<a class=list href=\"./index.php\">Back to administration</a><br>";
?>