Просмотр файла sea/apanel_scan.php

Размер файла: 3.02Kb
<?
#-----------------------------------------------------#
#     ============ЗАГРУЗ-ЦЕНТР=============           #
#             	 Автор  :  Sea                   	  #
#               E-mail  :  [email protected]              #
#                  ICQ  :  355152215                   #
#   Вы не имеете права распространять данный скрипт.  #
#   		По всем вопросам пишите в ICQ.            #
#-----------------------------------------------------#
list($msec,$sec)=explode(chr(32),microtime());
$HeadTime=$sec+$msec;
include 'moduls/ini.php';
session_name ('SID') ;
session_start() ;
include 'moduls/fun.php';
include 'moduls/connect.php';
//=================================================================================================================
$error = 0;
if(empty($_SESSION['autorise'])) $error = 1;
if($_SESSION['autorise']!= $setup['password']) $error = 1;
if(empty($_SESSION['ipu'])) $error = 1;
if($_SESSION['ipu']!=clean($ip))  $error = 1;
if($error==1) die($setup['hackmess']);
//=================================================================================================================
$currtime = time();
$addfolder = 0;
$addfiles = 0;
$reses = mysql_query("SELECT `id`,`path` FROM `files`;");
while($array = mysql_fetch_array($reses))
	{
		$array_path[$array['id']] = $array['path'];
    }
function scaner ($paths)
{
	$paths = $paths.'/*';
	$array = glob($paths);
	static $file_array;
	foreach ($array as $vv)
	{
	if(is_dir($vv))
	    {
	    $file_array[] = $vv.'/';
	    scaner($vv);
        }
  	else
  	    {
  	    if(basename($vv)=='folder.png') continue;
  	    $file_array[] = $vv;
  		}
    }
	return $file_array;

}
$file_array = scaner($setup['path']);
foreach($file_array as $value)
	{
	if (@in_array($value,$array_path)===false)
		{
		$upltime = filectime($value);
		$name = basename($value);
		$pathinfo = pathinfo($value);
		$ext = $pathinfo['extension'];
		$name = str_replace('.'.$ext,'',$name);
		$infolder = dirname($value).'/';
		$size = filesize($value);
		if(strpos($name , '!') !== false) $name = trans($name);
 		if(strpos($name , '!') === false) $name = trans2($name);
		if(is_dir($value)){ $query = mysql_query("INSERT INTO `files` (`path`, `name`, `infolder`, `timeupload`, `loads`, `yes` ) VALUES ('$value', '*".$name."', '$infolder', '9999999999', '9999999999', '9999');"); $addfolder++; }
		else { $query = mysql_query("INSERT INTO `files` (`path`, `name`, `infolder`, `size` , `timeupload`) VALUES ('$value', '$name', '$infolder' , '$size' , '$upltime');"); $addfiles++;}
		}
	}
include 'moduls/header.php';
echo '<div class=mainzag>База данных успешно обновлена!</div><div class=row>Добавлено папок: '.$addfolder.' <br/>Добавлено файлов: '.$addfiles.'</div>';
list($msec,$sec)=explode(chr(32),microtime());
echo '<hr noshade size=1 class=hr>'.round(($sec+$msec)-$HeadTime,4).' сек.<br>&copy;[Sea][2007]</body></html>';

?>