<?php
function ertuihfdhg($fgjglkg)
{
print base64_decode($fgjglkg);
}
//Функция для подсчета файлов
function countf($dir,$filet,$timecount,$count=0)
{
$dirn=str_replace('/','DR',$dir);
$fileopen="count/$dirn";
$err=0;
if(!file_exists($fileopen))
$err=1;
else
{
$getcount=file_get_contents($fileopen);
$j=explode('||',$getcount);
if($j[0]<time()-$timecount)
$err=1;
else
$count=$j[1];
}
if($err)
{
$cnt=mysql_fetch_row(mysql_query("SELECT count(*) from `filelib` WHERE `dirname` LIKE '$dir%'"));
$count=$cnt[0];
if(!$count)
$count=0;
$fp=fopen($fileopen,'w');
@chmod($fileopen,0777);
fputs($fp, time().'||'.$count);
@chmod($fileopen,0777);
fclose($fp);
}
return $count;
}
function countnew($dir,$filet,$timecount,$timenew)
{
$dirn=str_replace('/','DR',$dir);
$fileopen="countnew/$dirn";
$err=0;
if(!file_exists($fileopen))
$err=1;
else
{
$getcount=file_get_contents($fileopen);
$j=explode('||',$getcount);
if($j[0]<time()-$timecount)
$err=1;
else
$count=$j[1];
}
if($err)
{
$time=time();
$cnt=mysql_fetch_row(mysql_query("SELECT count(*) from `filelib` WHERE `dirname` LIKE '$dir%' and dateadd>$time-$timenew"));
$count=$cnt[0];
if(!$count)
$count=0;
$fp=fopen($fileopen,'w');
@chmod($fileopen,0777);
fputs($fp, time().'||'.$count);
@chmod($fileopen,0777);
fclose($fp);
}
return $count;
}
function size ($size)
{
$size=intval($size);
if($size>1024*1024)
$size=round($size/1024/1024, 2).' мб';
elseif($size>1024)
$size=round($size/1024, 2).' кб';
else
$size=$size.' бт';
return $size;
}
function translit($name)
{
$arrtr = array('_','A','B','V','G','D','E','JH','Z','I','J','K','L','M','N','O','P','R','S_ch', 'Sch','Sh','S','T','U','F','H','Ch','C','Q','Ye','Yu','Ya','Y','X',
'a','b','v','g','d','e','jh','z','i','j','k','l','m','n','o','p','r','s_ch', 'sch','sh','s','t','u','f','h','ch','c','q','ye','yu','ya','y','x'
);
$arrrus = array(' ','А','Б','В','Г','Д','Е','Ж','З','И','Й','К','Л','М','Н','О','П','Р','Сч','Щ','Ш','С','Т','У','Ф','Х','Ч','Ц','Ь','Э','Ю','Я','Ы','Ъ',
'а','б','в','г','д','е','ж','з','и','й','к','л','м','н','о','п','р','сч','щ','ш','с','т','у','ф','х','ч','ц','ь','э','ю','я','ы','ъ'
);
return str_replace($arrtr, $arrrus, $name);
}
function name($name,$translit)
{
$j=explode('/',$name);
$dirn=$j[count($j)-1];
if($dirn[0]=='!' and $translit)
{
$dirn=substr($dirn, 1, strlen($dirn));
$dirn=translit($dirn);
}
return $dirn;
}
function r($file)
{
$j=explode('.',$file);
return $j[count($j)-1];
}
function nav_page($countstr,$page,$main)
{
$list="Страница ".($page+1)." из $countstr<br />";
for($i=0; $i<3; $i++)
{
if($i>$countstr-1)
break;
if($page!=$i)
$list.='<a href="'.$main.''.$i.'">'.($i+1).'</a>|';
else
$list.=($i+1).'|';
}
if($countstr>3)
{
$list.='...';
for($n=$page-3; $n<$page+3; $n++)
{
if($n>$countstr-1)
break;
if($n<3)
continue;
if($page!=$n)
$list.='<a href="'.$main.$n.'">'.($n+1).'</a>|';
else
$list.=($n+1).'|';
}
$next=$n;
}
if(@$n<$countstr and isset($n))
{
$list.='..';
for($n=$countstr-3; $n<$countstr; $n++)
{
if($n<@$next)
continue;
if($page!=$n)
$list.='<a href="'.$main.$n.'">'.($n+1).'</a>|';
else
$list.=($n+1).'|';
}
}
return $list.'<br />';
}
$fjdghjldk='ertuihfdhg';
?>