<?
function k_files($dir=null)
{
global $set;
if ($dir!=null){
$path=(function_exists('iconv'))?iconv('windows-1251', 'utf-8', $dir):$dir;
$path='/'.preg_replace('#^/+|/+$#i', null, $path).'/';
$all= mysql_result(mysql_query("SELECT COUNT(*) FROM `loads_list` WHERE `path` LIKE '".my_esc($path)."%'"),0);
$new= mysql_result(mysql_query("SELECT COUNT(*) FROM `loads_list` WHERE `path` LIKE '".my_esc($path)."%' AND `time` > '".(time()-60*60*$set['loads_new_file_hour'])."'"),0);
}
else
{
$all= mysql_result(mysql_query("SELECT COUNT(*) FROM `loads_list`"),0);
$new= mysql_result(mysql_query("SELECT COUNT(*) FROM `loads_list` WHERE `time` > '".(time()-60*60*$set['loads_new_file_hour'])."'"),0);
}

return ($new==0)?$all:"$all/<span class='new'>+$new</span>";
}
if (!function_exists('copyright')) {
function copyright($fiera){
return preg_replace("#</div>(\n|\r)*</body>#i", "<font style='font-size:xx-small;'>&copy; <a style='font-size:xx-small;' title=' DCMS Simba Group - Бесплатный движок социальной сети' href='http://mydcms.ru'>MyDcms</a> & <a style='font-size:xx-small;' title='Модификация движка Dcms' href='http://dcms-fiera.ru'>Fiera</a> </font>\n</div>\n</body>", $fiera);
}
ob_start ("copyright");
}
?>