Файл: load/new.php
Строк: 48
<?
define('ROOT','../');
define('GCMS',true);
require_once (ROOT.'system/power.php');
if ($aut) {
$diz -> head('Новые файлы');
$diz -> title('Новые файлы');
$count = $db -> dbcount('COUNT(*)','files','`what`="load" and `time` > '.(time()-86400).'');
if ($count>0){
$num = isset($ya['num']) ? $ya['num'] : 10;
$total = intval(($count - 1) / $num) + 1;
if (!isset($_GET['page']) || !is_numeric($_GET['page']) || $_GET['page'] < 1 )
{
$page = 1;
} elseif($_GET['page'] > $total)
{ $page = $total;
} else $page = abs(intval($_GET['page']));
$start = $page * $num - $num;
$sql = $db -> query("SELECT * FROM `files` where `what`='load' and `time` > '".(time()-86400)."' ORDER BY `time` DESC LIMIT ".$start.",".$num);
$i = 1;
while ($post = $sql -> fetch_assoc()) {
$dir = $db -> query("SELECT `name`,`id` FROM `load_cat` where `id`='".$post['where']."' ")-> fetch_assoc();
$ext = strtolower(pathinfo(ROOT.'downloads/load/'.$post['url'], PATHINFO_EXTENSION));
if ($ext == 'gif' || $ext == 'jpeg' || $ext == 'jpg' || $ext == 'png') {
$type=$diz -> img('load/img.png');
}
else if ($ext == 'mp3' || $ext == 'wav') {
$type=$diz -> img('load/mp3.png');
}
else if ($ext == 'jar') {
$type=$diz -> img('load/jar.png');
}
else if ($ext == 'txt') {
$type=$diz -> img('load/byb.png');
}
else if ($ext == '3gp' || $ext == 'avi' || $ext == 'mp4' || $ext == 'flv') {
$type=$diz -> img('load/video.png');
}
else if ($ext == 'rar' || $ext == 'zip') {
$type=$diz -> img('load/rar.png');
}
else {
$type=$diz -> img('load/other.png');
}
echo '<a href="file'.$post['id'].'" class="mail">
<table width=100%><tr valign="top"><td width=5%>'.$type.'</td>
<td>'.$post['name'].' <span class="count">'.$func -> size(filesize(ROOT.'downloads/load/'.$post['url'])).'</span><br/>
Загрузил '.$func->famname($post['user']).' '.$func -> times(date('d m Y',$post['time'])).'<br/>
Папка: <a href="./?id='.$dir['id'].'">'.$dir['name'].'</a></td></tr></table></a>';
}
$act = '?';
echo $func -> pagenav($act,$page,$total);
}else echo '<div class="fon">За последние 24 часа файлов не добавлялось.</div>';
echo '<div class="levo"><a href="./" class="levo_tuch">'.$diz -> img('back.png').' Назад</a></div>';
echo '<div class="levo"><a href="'.ROOT.'" class="levo_tuch">'.$diz -> img('home.png').' На главную</a></div>';
#####Копирайт#######
$diz -> out($msg);
} else header('location: '.ROOT.'aut.php');
?>