Location: PHPKode > projects > L-Forum > l-forum/admin/save_l.inc
<?

$data = "<?\n".
"//   DO NOT EDIT THIS FILE - USE ADMINISTRATION INSTEAD\n\n".
"\$relpath		= '$relpath';\n".
"\$admin_name		= '$admin_name';\n".
"\$admin_pass		= '$admin_pass';\n".
"\$admin_res		= '$admin_res';\n".
"\$db_type		= '$db_type';\n".
"\$db_host		= '$db_host';\n".
"\$db_name		= '$db_name';\n".
"\$db_user		= '$db_user';\n".
"\$db_pass		= '$db_pass';\n".
"\$encoding		= '$encoding';\n".
"\$lang_d		= '$lang_d';\n";

while(list($k, $v) = each($langlist))
   $data .= "\$langlist['$k']		= '$v';\n";

$data .= "\$langlist['$ln_sh']		= '$ln_name';\n".
"\$theme			= '$theme';\n";

while(list($k, $v) = each($themes))
   $data .= "\$themes['$k']		= '$v';\n";

$data .=  "\$enable_html		= ".($enable_html?'true':'false').";\n".
"\$long_names		= ".($long_names?'true':'false').";\n".
"\$cite			= ".($cite?'true':'false').";\n".
"\$req_email		= ".($req_email?'true':'false').";\n".
"\$ext_mail		= ".($ext_mail?'true':'false').";\n".
"\$max_size             = $max_size;\n".
"\$wrapsize		= $wrapsize;\n".
"\$block_ip		= ".($block_ip?'true':'false').";\n".
"\$count_view		= ".($count_view?'true':'false').";\n".
"\$coll_thr		= ".($coll_thr?'true':'false').";\n".
"\$thrinmess		= ".($thrinmess?'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?>\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\">Language added.</div><br>\n";
echo "<a class=list href=\"./index.php\">Back to administration</a><BR>";

?>
Return current item: L-Forum