Файл: load/new.php
Строк: 50
<?php
define('ROOT','../');
define('GCMS',true);
require_once (ROOT.'system/power.php');
if ($aut) {
$diz -> head('Новые файлы');
$diz -> title("<a href='./'>Загрузки</a>/<b>Новые файлы</b>");
$count = $db -> dbcount('COUNT(*)','load_files','`dateupload` > '.(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 = (int)$_GET['page'];
$start = $page * $num - $num;
$sql = $db -> query("SELECT * FROM `load_files` where `dateupload` > '".(time()-86400)."' ORDER BY `dateupload` DESC LIMIT ".$start.",".$num);
$i = 1;
while ($post = $sql -> fetch_assoc()) {
$dir = $db -> query("SELECT `name`,`id` FROM `load_cat` where `id`='".$post['cat']."' ")-> fetch_assoc();
$ext = strtolower(pathinfo($post['path'], 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') {
$type=''.$diz -> img('load/rar.png').'';
}
else if ($ext == 'zip') {
$type=''.$diz -> img('load/zip.png').'';
}
else {
$type=''.$diz -> img('load/other.png').'';
}
echo '<div class="menu"><a href="file'.$post['id'].'" class="menutuch">
<table width=100%><tr valign="top"><td width=5%>'.$type.'</td>
<td>'.$post['name'].'<span class="count"/>'.$func -> size(filesize($post['path'])).'</span><br/>
Загрузил '.$func->nick($post['user']).' '.$func -> times(date('d m Y',$post['dateupload'])).'<br/>
Папка: <a href="./?id='.$dir['id'].'">'.$dir['name'].'</a></td></tr></table></a></div>';
}
$act = 'new.php?';
echo $func -> pagenav($act,$page,$total);
}else echo '<div class="fon">За последние 24 часа файлов не добавлялось.</div>';
echo '<div class="levo"><a href="./index.php" class="levo_tuch">'.$diz -> img('back.png').' Назад</a></div>';
echo '<div class="levo"><a href="/index.php" class="levo_tuch">'.$diz -> img('home.png').' На главную</a></div>';
#####Копирайт#######
$diz -> out($msg);
} else header('location: '.ROOT.'aut.php');
?>