все зделал но все равно результата ноль ,ошибок не каких не выдает вобще!
После нажатия на кнупку типа сумбит просто перезагружается страница ,а должны изменятся конфегурации форума!
config.php соответственно конект к базе
lib/init.inc
Код: Выделить всё
<?
if(defined("_INIT_")) return;
define("_INIT_", 1);
error_reporting(E_ALL ^ E_NOTICE);
$pre = "";
if(ereg("admin", $PHP_SELF)) $pre = "../";
include $pre."lib/sql.inc";
include $pre."lib/lib.inc";
include $pre."lang/".$lang_d.".inc";
if(empty($lng)&&empty($cookie_lang))
$lng = $lang_d;
else if(empty($lng)&&!empty($cookie_lang)&&isset($langlist[$cookie_lang]))
$lng = $cookie_lang;
if(!empty($lng)&&$lng!=$cookie_lang)
if(isset($langlist[$lng]))
setcookie("cookie_lang", $lng, time()+999999999);
else
$lng = $lang_d;
include $pre."lang/".$lng.".inc";
if(ereg("/list.php|/read.php|/new.php|/search.php|/read_thr.php", $PHP_SELF)){
if(!isset($f))
error_f($lang['nofid']);
if(is_array($forum_array[$f]))
$theme=$forum_array[$f]["theme"];
else
error_f($lang['nofid']);
}
include $pre."themes/".$theme."/design.inc";
if(empty($s)&&empty($ns)){
$ns='d';
}
if(isset($ns)){
setcookie("s", $ns, time()+999999999);
$s=$ns;
}
if(isset($HTTP_REFERER)){
if(!ereg("list.php|read.php|new.php|search.php|(^$)", $HTTP_REFERER)||
(empty($o)&&empty($no))){
$no=0;
}
}
if(isset($no)){
$o=$no;
}
if(!empty($nt)){
setcookie("t", $nt, time()+999999999);
$t=$nt;
}
if(isset($nosql))
return;
$sys_basename=$db_name;
switch($db_type){
case 'postgres':
$sys_database=new Database();
$true = 't';
$false = 'f';
break;
case 'mysql':
$sys_database=new MySQLDatabase();
$true = 1;
$false = 0;
break;
}
if(ereg("/list.php", $PHP_SELF)){
$q=new Query("select id from articles where level=0 and forum = $f");
if(empty($open_thr[$f])){
$open_thr[$f]=Array();
for($x=0; $x<$q->nr(); $x++)
$open_thr[$f][$q->get($x, 'id')] = ( $coll_thr ? 0 : 1 );
}
else{
$open_thr[$f]=unserialize($open_thr[$f]);
for($x=0; $x<$q->nr(); $x++){
$id = $q->get($x, 'id');
if(@$open_thr[$f][$id]!=1) $open_thr[$f][$id] = 0;
}
}
if(!empty($uc)||!empty($c)){
if(!empty($uc))
$open_thr[$f][$uc]=1;
else if(!empty($c))
$open_thr[$f][$c]=0;
}
if(isset($cmd)){
if($cmd==1 && count($open_thr[$f])>0){
while(list($k, $v) = each($open_thr[$f]))
$open_thr_n[$f][$k] = 1;
$open_thr[$f] = $open_thr_n[$f];
}
}
setcookie("open_thr[$f]", serialize($open_thr[$f]), time()+999999999);
}
?>
admin/save.inc
Код: Выделить всё
<?
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>";
?>