<?
  ##########################################
## Àâòîð: -=ØÀÕÒÅÐ=-                        #                                                                                                                                                                                      ## Ñàéò: http://masteram.us                 #                 															                      ## ICQ  :  46-92-90                         #                 														 		           ## Âåðñèÿ 4.0 Ëèöåíçèîííàÿ                  #
## Äàííàÿ âåðñèÿ ñêðèïòà ÿâëÿåòñÿ ÏËÀÒÍÎÉ,  #
## âû ÍÅ ÈÌÅÅÒÅ ÏÐÀÂÀ ðàñïðîñòðÿíÿòü äàííûé #
##  ñêðèïò èëè êàêèå-ëèáî ÷àñòè åãî êîäà... #
  #########################################

function  count_dir($dir) {
global $sitetime;

$count=0;
$newcount=0;

$path = opendir($dir);
while ($file = readdir($path)) {
if (( $file != ".")&&($file != "..")&&($file != ".htaccess")&&($file != "index.php")&&($file != "name.dat")&& !ereg (".txt$", "$file")&& !ereg (".JPG$", "$file")&& !ereg (".GIF$", "$file")) {

$count ++;

$filetime=filemtime("$dir/$file")+(3600*24*5);
if($filetime>$sitetime){
$newcount ++;
}
}}

if($newcount>0){
$input=(int)$count.'/+'.(int)$newcount;
}else{
$input=(int)$count;
}

closedir ($path);
return  $input;
}

function count_dir_size($dir)
{
global $mysql;
$dir=str_replace("//", "/", $dir);
$livetime=time()-3600;
$size=0;
$od=opendir($dir);
while ($rd=readdir($od))
{
if (is_dir("$dir/$rd") && $rd!='.' && $rd!='..')
{
$size=$size+count_dir_size("$dir/$rd");
}
elseif(!ereg(".name|error.log|.htaccess|.opis|.aut|.jad|.dat",$rd) && $rd!='.' && $rd!='..')
{
$size=$size+filesize("$dir/$rd");
}
}
return $size;
}

?>