Просмотр файла dl/INSTALL.php

Размер файла: 20.42Kb
<?php
#********************************** AgS MOD DOWNLOAD CENTR SEA *************************************#
#***************************************************************************************************#
#  /||||||||||||||| *********************  /||||||||||||||| *********************  /||||||||||||||| #
# | ||||||||||||||| ********************* | ||||||||||||||| ********************* | ||||||||||||||| #
# | |||||/////||||| ********************* | |||||/////////  ********************* | |||||/////////  #
# | |||||   | ||||| ****** E-MAIL ******* | |||||           ****** WAP/WEB ****** | |||||           #
# | |||||   | ||||| *** [email protected] *** | |||||           * http://ags.h2m.ru * | ||||||||||||||| #
# | |||||   | ||||| ********************* | ||||||||||||||| ********************* | ||||||||||||||| #
# | |||||   | ||||| ********************* | |||||/////||||| ********************* |///////////||||| #
# | ||||||||||||||| ****** SKYPE ******** | |||||   | ||||| ***** MOD AUTHOR ****           | ||||| #
# | |||||////|||||| ***** agrizz15 ****** | |||||   | ||||| ***** Agris Cišs ****  /||||||||||||||| #
# | |||||   | ||||| ********************* | ||||||||||||||| ********************* | ||||||||||||||| #
# |/////    |/////  ********************* |///////////////  ********************* |///////////////  #
#***************************************************************************************************#
#********************************* MOD by AgS in 2010 @ LATVIA *************************************#


require_once"system/start.php";
require_once"system/config.php";
require_once"system/head.php";
require_once"lng/$setup[lng]/lng.php";
require_once"system/functions.php";
include_once"thm/AgS_web/index.php";
include_once"system/msg.php";


if(!isset($act)){
echo '<img src="pic/main/head.gif" alt=""> <b>'.dl_054.'</b><br><br>';
echo dl_055.'<br>';

echo '<form method="post" action="INSTALL.php?act=set_mysql&amp;'.SID.'"><br>';
echo dl_056.':<br><input name="MYSQL_server" value="'.$MY_serveris.'" maxlength="50" /><br>';
echo dl_057.':<br><input name="MYSQL_db" value="'.$MY_DB.'"  maxlength="50" /><br>';
echo dl_058.':<br><input name="MYSQL_dbuser" value="'.$MY_DB_user.'"  maxlength="50" /><br>';

echo '<input name="create_db" type="checkbox" value="ok" /> <b>'.sys_create.'</b><br>';

echo dl_060.':<br><input name="MYSQL_pass" type="password" maxlength="50" /><br>';
echo dl_061.':<br><input name="MYSQL_pass2" type="password" maxlength="50" /><br>';
echo dl_062.':<br><input name="set_prefix" value="'.$MY_pre.'" maxlength="20" /><br>';

echo '<input value="'.dl_063.'" type="submit" /></form><br><br>';




}

if($act=="set_mysql"){

echo'<img src="pic/main/head.gif" alt=""> <b>'.dl_064.'</b><br><br>';

if(isset($_POST['create_db'])){
	$create_db=$_POST['create_db'];} else {$create_db=$_GET['create_db'];}//izveide DB

if(!empty($MYSQL_server)){
if(!empty($MYSQL_db)){
if(!empty($MYSQL_dbuser)){
if(!empty($MYSQL_pass)){
if(!empty($MYSQL_pass2)){
if(!empty($set_prefix)){

if ($MYSQL_pass==$MYSQL_pass2){	
if (mysql_connect($MYSQL_server, $MYSQL_db, $MYSQL_pass)){

 //Jaunas DB izveide 
if($create_db=="ok"){
$sql = 'CREATE DATABASE `'.$MYSQL_dbuser.'`;';
if(mysql_query($sql)){
echo dl_065.' '.$MYSQL_dbuser.' '.dl_066.'<br>';}else{
$error = mysql_error(); 
$er = $error.'<br>';}}

if (mysql_select_db($MYSQL_dbuser)){
$ufile = file_get_contents(BASE."dati/cfg.dat"); 
$udata = explode("|",$ufile);

$udata[0] = $MYSQL_server;
$udata[1] = $MYSQL_db;
$udata[2] = $MYSQL_pass;
$udata[3] = $MYSQL_dbuser;
$udata[5] = $set_prefix;

for ($u=0; $u<$config_configkeys; $u++){
$utext.=$udata[$u].'|';}
if(!empty($MYSQL_server) && !empty($MYSQL_db) && !empty($MYSQL_pass) && !empty($MYSQL_dbuser)){

$fp=fopen(BASE."dati/cfg.dat","a+");    
flock($fp,LOCK_EX);           
ftruncate($fp,0);                                                                
fputs($fp,$utext);
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp);  
unset($utext); 
}

$db_prefix = $set_prefix;//Ielāžu tabulu prefix


mysql_query('SET NAMES `utf8`');
mb_internal_encoding('UTF-8');

//tabula faili
$sql="CREATE TABLE IF NOT EXISTS `".$db_prefix."faili` (
  `id` int(16) unsigned NOT NULL auto_increment,
  `path` varchar(255) NOT NULL,
  `infolder` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `priority` tinyint(3) NOT NULL default '0',
  `size` int(16) unsigned NOT NULL,
  `about` text NOT NULL,
  `fastabout` text NOT NULL,
  `loads` int(16) unsigned NOT NULL default '0',
  `timeload` int(11) unsigned NOT NULL,
  `timeupload` int(11) unsigned NOT NULL,
  `ips` text NOT NULL,
  `yes` int(4) unsigned NOT NULL default '0',
  `no` int(4) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `size` (`size`),
  KEY `path` (`path`),
  KEY `infolder` (`infolder`),
  KEY `name` (`name`),
  KEY `loads` (`loads`),
  KEY `priority` (`priority`),
  KEY `timeupload` (`timeupload`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;";

if(mysql_query($sql)){
echo dl_067.' '.$db_prefix.'faili '.dl_068.'<br>';
}else{$error = mysql_error(); $er = $error.'<br>';}



$sql="CREATE TABLE IF NOT EXISTS `".$db_prefix."online` (
  `id` int(16) unsigned NOT NULL auto_increment,
  `ip` varchar(23) NOT NULL,
  `time` int(11) unsigned NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `ip` (`ip`,`time`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;";


if(mysql_query($sql)){
echo dl_067.' '.$db_prefix.'online '.dl_068.'<br>';
}else{$error = mysql_error(); $er = $error.'<br>';}



//tabula komentari
$sql="CREATE TABLE IF NOT EXISTS `".$db_prefix."komentari` (
  `id` int(16) unsigned NOT NULL auto_increment,
  `file_id` int(16) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `text` text NOT NULL,
  `brow` text NOT NULL,
  `ip` text NOT NULL,
  `time` int(11) unsigned NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `file_id` (`file_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;";

if(mysql_query($sql)){
echo dl_067.' '.$db_prefix.'komentari '.dl_068.'<br>';
}else{$error = mysql_error(); $er = $error.'<br>';}

//tabula iestatijumi
$sql="CREATE TABLE IF NOT EXISTS `".$db_prefix."iestatijumi` (
  `id` int(16) unsigned NOT NULL auto_increment,
  `name` text NOT NULL,
  `value` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;";


if(mysql_query($sql)){
echo dl_067.' '.$db_prefix.'iestatijumi '.dl_068.'<br>';
}else{$error = mysql_error(); $er = $error.'<br>';}

foreach($_POST as $key => $value) {
if($key!==MYSQL_server && $key!==MYSQL_db && $key!==MYSQL_pass && $key!==MYSQL_pass2 && $key!==MYSQL_dbuser && $key!==set_prefix && $key!==create_db){
mysql_query("INSERT INTO `".$db_prefix."iestatijumi`(`name`,`value`) VALUES( '".$key."', '".tirit($value)."');");
}}
mysql_query("INSERT INTO `".$db_prefix."online` (`time`) VALUES ('0');");

$upltime = time();

mysql_query("INSERT INTO ".$db_prefix."faili VALUES (1, 'dir/!Test/', 'dir/', '*Тест', 0, 0, '', '', 4294967295, 0, ".$upltime.", '', 9999, 0);");
mysql_query("INSERT INTO ".$db_prefix."faili VALUES (2, 'dir/!Test/!Podpapka/', 'dir/!Test/', '*Подпапка', 0, 0, '', '', 4294967295, 0, ".$upltime.", '', 9999, 0);");
mysql_query("INSERT INTO ".$db_prefix."faili VALUES (3, 'dir/!Test/Files TEST/', 'dir/!Test/', '*Files TEST', 0, 0, '', '', 4294967295, 0, ".$upltime.", '', 9999, 0);");
mysql_query("INSERT INTO ".$db_prefix."faili VALUES (4, 'dir/!Test/Files TEST/GIF.gif', 'dir/!Test/Files TEST/', 'GIF', 0, 14959, '', '', 0, 0, ".$upltime.", '', 0, 0);");
mysql_query("INSERT INTO ".$db_prefix."faili VALUES (5, 'dir/!Test/Files TEST/JPG.jpg', 'dir/!Test/Files TEST/', 'JPG', 0, 3332, '', '', 0, 0, ".$upltime.", '', 0, 0);");
mysql_query("INSERT INTO ".$db_prefix."faili VALUES (6, 'dir/!Test/Files TEST/MP3.mp3', 'dir/!Test/Files TEST/', 'MP3', 0, 11977, '', '', 0, 0, ".$upltime.", '', 0, 0);");
mysql_query("INSERT INTO ".$db_prefix."faili VALUES (7, 'dir/!Test/Files TEST/PNG.png', 'dir/!Test/Files TEST/', 'PNG', 0, 8905, '', '', 0, 0, ".$upltime.", '', 0, 0);");
mysql_query("INSERT INTO ".$db_prefix."faili VALUES (8, 'dir/!Test/Files TEST/TXT.txt', 'dir/!Test/Files TEST/', 'TXT', 0, 15, '', '', 0, 0, ".$upltime.", '', 0, 0);");
mysql_query("INSERT INTO ".$db_prefix."faili VALUES (9, 'dir/!Test/Files TEST/ZIP.zip', 'dir/!Test/Files TEST/', 'ZIP', 0, 125, '', '', 0, 0, ".$upltime.", '', 0, 0);");


echo '<br>'.dl_069.'<br><br>';
echo '<img src="pic/main/dot2.gif" alt=""> <a href="INSTALL.php?act=lng&amp;'.SID.'">'.dl_070.'</a><br>';
echo '<img src="pic/main/dot.gif" alt=""> <a href="INSTALL.php?'.SID.'">'.sys_back.'</a><br>';

} else {echo '<b>'.dl_071.'</b><br>';}
} else {echo '<b>'.dl_072.'</b><br>';}
} else {echo '<b>'.dl_073.'</b><br>';}
} else {echo '<b>'.dl_074.'</b><br>';}
} else {echo '<b>'.dl_075.'</b><br>';}
} else {echo '<b>'.dl_076.'</b><br>';}
} else {echo '<b>'.dl_077.'</b><br>';}
} else {echo '<b>'.dl_078.'</b><br>';}
} else {echo '<b>'.dl_079.'</b><br>';}
}

if($act=="lng"){
echo '<img src="pic/main/head.gif" alt=""> <b>'.dl_080.'</b><br><br>';
echo dl_081.'<br>';
echo '<form method="post" action="INSTALL.php?act=set_lng&amp;'.SID.'"><br>';

echo dl_082.':<br>';
echo '<select name="lng">';
$dir = opendir ("lng"); 
while ($lngi = readdir ($dir)) {

if (is_dir(BASE."lng/$lngi")) {
if($lngi=="." || $lngi=="..") continue;
echo '<option value="'.$lngi.'">'.$lngi.'</option>';
}}
echo '</select><br>';
closedir ($dir);

echo '<input value="'.dl_083.'" type="submit" /></form><br>';
echo '<br><br><img src="pic/main/dot.gif" alt=""> <a href="INSTALL.php?'.SID.'">'.sys_back.'</a><br>';
}



if($act=="set_lng"){
echo'<img src="pic/main/head.gif" alt=""> <b>'.dl_084.'</b><br><br>';

if(!empty($lng)){
require_once"system/db.php";
foreach($_POST as $key => $value) {
mysql_query("INSERT INTO `".$MY_pre."iestatijumi`(`name`,`value`) VALUES( '".$key."', '".tirit($value)."');");

}

echo '<br><b>'.dl_085.'</b><br><br>';
echo '<img src="pic/main/dot2.gif" alt=""> <a href="INSTALL.php?act=pro&amp;'.SID.'">'.dl_086.'</a><br>';
echo '<img src="pic/main/dot.gif" alt=""> <a href="INSTALL.php?act=lng&amp;'.SID.'">'.sys_back.'</a><br>';


} else {echo '<b>'.dl_087.'</b><br>';}
}

if($act=="pro"){
echo '<img src="pic/main/head.gif" alt=""> <b>'.dl_088.'</b><br><br>';
echo dl_089.'<br>';
echo '<form method="post" action="INSTALL.php?act=set_pro&amp;'.SID.'"><br>';
echo dl_090.':<br><input name="adnick" maxlength="20" /><br>';
echo dl_091.':<br><input name="adpass" type="password" maxlength="20" /><br>';
echo dl_092.':<br><input name="adpass2" type="password" maxlength="20" /><br>';
echo dl_093.':<br><input name="mailing" maxlength="50" /><br>';
echo '<input value="'.dl_094.'" type="submit" /></form><br>';
echo '<br><br><img src="pic/main/dot.gif" alt=""> <a href="INSTALL.php?act=lng&amp;'.SID.'">'.sys_back.'</a><br>';
}

if($act=="set_pro"){
echo'<img src="pic/main/head.gif" alt=""> <b>'.dl_095.'</b><br><br>';

if(!empty($adnick)){
if(!empty($adpass)){
if(!empty($adpass2)){
if(!empty($mailing)){
if (preg_match('#^([a-z0-9_\-\.])+\@([a-z0-9_\-\.])+(\.([a-z0-9])+)+$#',$mailing)){


if ($adpass==$adpass2){	

$adpass = md5($adpass);//MD5 parole
require_once"system/db.php";

mysql_query("INSERT INTO `".$MY_pre."iestatijumi`(`name`,`value`) VALUES( 'adnick', '".tirit($adnick)."');");
mysql_query("INSERT INTO `".$MY_pre."iestatijumi`(`name`,`value`) VALUES( 'adpass', '".tirit($adpass)."');");
mysql_query("INSERT INTO `".$MY_pre."iestatijumi`(`name`,`value`) VALUES( 'mailing', '".tirit($mailing)."');");



echo '<br><b>'.dl_096.'</b><br><br>';
echo '<img src="pic/main/dot2.gif" alt=""> <a href="INSTALL.php?act=moduls&amp;'.SID.'">'.dl_097.'</a><br>';
echo '<img src="pic/main/dot.gif" alt=""> <a href="INSTALL.php?act=pro&amp;'.SID.'">'.sys_back.'</a><br>';


} else {echo '<b>'.dl_098.'</b><br>';}
} else {echo '<b>'.dl_099.'</b><br>';}
} else {echo '<b>'.dl_100.'</b><br>';}
} else {echo '<b>'.dl_101.'</b><br>';}
} else {echo '<b>'.dl_102.'</b><br>';}
} else {echo '<b>'.dl_103.'</b><br>';}
}

if($act=="moduls"){
echo '<img src="pic/main/head.gif" alt=""> <b>'.dl_104.'</b><br><br>';
echo dl_105.'<br>';
echo '<form method="post" action="INSTALL.php?act=set_moduls&amp;'.SID.'"><br>';

echo sys_prew.': <br>'.sys_yes;
echo '<input name="modulis_preview" type="radio" value="ON" checked>&nbsp; &nbsp;';
echo '<input name="modulis_preview" type="radio" value="OFF" />'.sys_nop.'<br>';

echo dl_109.': <br>'.sys_yes;
echo '<input name="marker" type="radio" value="1" checked>&nbsp; &nbsp;';
echo '<input name="marker" type="radio" value="0" />'.sys_nop.'<br>';

echo dl_110.': <br>'.sys_yes;
echo '<input name="ext" type="radio" value="1" checked>&nbsp; &nbsp;';
echo '<input name="ext" type="radio" value="0" />'.sys_nop.'<br>';

echo dl_111.': <br>'.sys_yes;
echo '<input name="modulis_komentari" type="radio" value="1" checked>&nbsp; &nbsp;';
echo '<input name="modulis_komentari" type="radio" value="0" />'.sys_nop.'<br>';

echo dl_112.': <br>'.sys_yes;
echo '<input name="eval_change" type="radio" value="1" checked>&nbsp; &nbsp;';
echo '<input name="eval_change" type="radio" value="0" />'.sys_nop.'<br>';

echo dl_113.': <br>'.sys_yes;
echo '<input name="jad_change" type="radio" value="1" checked>&nbsp; &nbsp;';
echo '<input name="jad_change" type="radio" value="0" />'.sys_nop.'<br>';

echo sys_shreder.': <br>'.sys_yes;
echo '<input name="cut_change" type="radio" value="1" checked>&nbsp; &nbsp;';
echo '<input name="cut_change" type="radio" value="0" />'.sys_nop.'<br>';

echo dl_115.': <br>'.sys_yes;
echo '<input name="zip_change" type="radio" value="1" checked>&nbsp; &nbsp;';
echo '<input name="zip_change" type="radio" value="0" />'.sys_nop.'<br>';

echo dl_116.': <br>'.sys_yes;
echo '<input name="zakaz" type="radio" value="1" checked>&nbsp; &nbsp;';
echo '<input name="zakaz" type="radio" value="0" />'.sys_nop.'<br>';

echo dl_117.': <br>'.sys_yes;
echo '<input name="onpage_change" type="radio" value="1" checked>&nbsp; &nbsp;';
echo '<input name="onpage_change" type="radio" value="0" />'.sys_nop.'<br>';

echo dl_118.': <br>'.sys_yes;
echo '<input name="preview_change" type="radio" value="1" checked>&nbsp; &nbsp;';
echo '<input name="preview_change" type="radio" value="0" />'.sys_nop.'<br>';

echo dl_119.': <br>'.sys_yes;
echo '<input name="top_change" type="radio" value="1" checked>&nbsp; &nbsp;';
echo '<input name="top_change" type="radio" value="0" />'.sys_nop.'<br>';

echo sys_stat.': <br>'.sys_yes;
echo '<input name="stat_change" type="radio" value="1" checked>&nbsp; &nbsp;';
echo '<input name="stat_change" type="radio" value="0" />'.sys_nop.'<br>';

echo dl_121.': <br>'.sys_yes;
echo '<input name="pagehand_change" type="radio" value="1" checked>&nbsp; &nbsp;';
echo '<input name="pagehand_change" type="radio" value="0" />'.sys_nop.'<br>';

echo sys_src.': <br>'.sys_yes;
echo '<input name="search_change" type="radio" value="1" checked>&nbsp; &nbsp;';
echo '<input name="search_change" type="radio" value="0" />'.sys_nop.'<br><br>';
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
echo '<input value="'.dl_123.'" type="submit" /></form><br>';
echo '<br><br><img src="pic/main/dot.gif" alt=""> <a href="INSTALL.php?act=pro&amp;'.SID.'">'.sys_back.'</a><br>';
}


if($act=="set_moduls"){
echo '<img src="pic/main/head.gif" alt=""> <b>'.dl_124.'</b><br><br>';

if ($modulis_preview!="" && $marker!="" && $ext!="" && $modulis_komentari!="" && $eval_change!="" && $jad_change!="" && $cut_change!="" && $zip_change!="" && $zakaz!="" && $onpage_change!="" && $preview_change!="" && $top_change!="" && $stat_change!="" && $pagehand_change!="" && $search_change!=""){

require_once"system/db.php";
foreach($_POST as $key => $value) {
mysql_query("INSERT INTO `".$MY_pre."iestatijumi`(`name`,`value`) VALUES( '".$key."', '".tirit($value)."');");
}
} else {echo '<b>'.dl_125.'</b><br>';}
echo '<br><b>'.dl_126.'</b><br><br>';
echo '<img src="pic/main/dot2.gif" alt=""> <a href="INSTALL.php?act=sets&amp;'.SID.'">'.sys_sets.'</a><br>';
echo '<img src="pic/main/dot.gif" alt=""> <a href="INSTALL.php?act=moduls&amp;'.SID.'">'.sys_back.'</a><br>';
}

if($act=="sets"){
echo '<img src="pic/main/head.gif" alt=""> <b>'.dl_128.'</b><br><br>';

echo '<form method="post" action="INSTALL.php?act=set_sets&amp;'.SID.'"><br>';
echo dl_129.'<br><br>';

echo dl_130.':<br>';
echo '<select name="thm">';
$dir = opendir ("thm"); 
while ($wapthemes = readdir ($dir)) {

if (is_dir(BASE."thm/$wapthemes")) {
if($wapthemes=="." || $wapthemes=="..") continue;
echo '<option value="'.$wapthemes.'">'.$wapthemes.'</option>';
}}
echo '</select><br>';
closedir ($dir);

echo dl_132.':<br><input name="home" value="http://'.$_SERVER['HTTP_HOST'].'" maxlength="50" /><br>';
echo dl_133.':<br><input name="dl_name" value="AgS DOWNs" maxlength="50" /><br>';
echo dl_134.':<br><input name="dl_copyright" value="(c) by AgS" maxlength="50" /><br>';
echo dl_135.':<br><input name="dl_set_dir" value="'.$dir_script.'" maxlength="20" /><br>';
echo dl_136.':<br><input name="dir_faili" type="text" value="dir"><br>';
echo dl_137.':<br><input name="dir_about" type="text" value="about"><br>';
echo dl_138.':<br><input name="dir_screen" type="text" value="screen"><br>';
echo dl_139.':<br><input name="dir_zip" type="text" value="doc/zip"><br>';
echo dl_140.':<br><input name="dir_themes" type="text" value="doc/theme"><br>';
echo dl_141.':<br><input name="dir_video" type="text" value="doc/video"><br>';
echo dl_142.':<br><input name="dir_audio" type="text" value="doc/mp3"><br>';
echo dl_143.':<br><input name="limit" type="text" value="10"><br>';
echo dl_144.':<br><input name="klimit" type="text" value="25"><br>';
echo dl_145.':<br><input name="prev_size" type="text" value="50*50"><br>';
echo dl_146.':<br><input name="text_marker" type="text" value="AgS DOWNs"><br>';
echo dl_147.':<br><input name="day_new" type="text" value="7"><br>';
echo dl_148.':<br><input name="pagehand" type="text" value="7"><br>';
echo dl_149.':<br><input name="top_num" type="text" value="20"><br>';
echo dl_150.':<br><input name="hackmess" type="text" value="'.dl_151.'"><br>';
echo dl_176.':<br><input name="del_automp3" type="text" value="7"><br>';
echo dl_177.':<br><input name="del_autozip" type="text" value="7"><br><br>';

echo dl_152.':<br><select name="onpage">';
$datamas=array(15=>'15 gab.', 20=>'20 gab.', 25=>'25 gab.', 30=>'30 gab.');
echo '<option value="10">10 gab.</option>';
foreach($datamas as $k=>$v){
echo '<option value="'.$k.'">'.$v.'</option>';}
echo '</select><br>';

echo sys_sortby.':<br><select name="sort">';
$datamas2=array('size'=>sys_sosize, 'data'=>sys_sodate, 'load'=>sys_dwtime, 'eval'=>sys_rate);
echo '<option value="name">'.sys_soname.'</option>';
foreach($datamas2 as $k=>$v){
echo '<option value="'.$k.'">'.$v.'</option>';}
echo '</select><br><br>';


echo '<input value="'.dl_159.'" type="submit" /></form><br><br>';
echo '<br><br><img src="pic/main/dot.gif" alt=""> <a href="INSTALL.php?act=moduls&amp;'.SID.'">'.sys_back.'</a><br>';
}

if($act=="set_sets"){

if ($home!="" && $dl_copyright!="" && $dl_name!="" && $dl_set_dir!="" && $dir_faili!="" && $dir_about!="" && $dir_screen!="" && $dir_zip!="" && $dir_themes!="" && $dir_audio!="" && $dir_video!="" && $limit!="" && $klimit!="" && $prev_size!="" && $text_marker!="" && $day_new!="" && $pagehand!="" && $top_num!="" && $hackmess!="" && $onpage!="" && $sort!="" && $del_automp3!="" && $del_autozip!=""){

$ufile = file_get_contents(BASE."dati/cfg.dat"); 
$udata = explode("|",$ufile);

$udata[4] = $dl_set_dir;

for ($u=0; $u<$config_configkeys; $u++){
$utext.=$udata[$u].'|';}

if(!empty($dl_set_dir)){
$fp=fopen(BASE."dati/cfg.dat","a+");    
flock($fp,LOCK_EX);           
ftruncate($fp,0);                                                                
fputs($fp,$utext);
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp);  
unset($utext); 
}

require_once"system/db.php";

foreach($_POST as $key => $value) {

if($key!==dl_set_dir){
mysql_query("INSERT INTO `".$MY_pre."iestatijumi`(`name`,`value`) VALUES( '".$key."', '".tirit($value)."');");
}
}

echo '<br>'.dl_160;

echo '<br><b><img src="pic/main/dot2.gif" alt=""> <a href="index.php'.SID.'">'.dl_161.'</a></b><br>';

} else {echo '<b>'.dl_162.'</b><br>';}
}
echo '<img src="pic/main/home.gif" alt=""> <a href="../?'.SID.'">'.sys_home.'</a><br>';

include_once"thm/AgS_web/foot.php";
 ?>