Файл: obmen/new.php
Строк: 56
<?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(*)','obmen_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 `obmen_files` where `dateupload` > '".(time()-86400)."' ORDER BY `dateupload` DESC LIMIT ".$start.",".$num);
$i = 1;
while ($post = $sql -> fetch_assoc()) {
$ext = strtolower(pathinfo($post['infolder'], PATHINFO_EXTENSION));
if ($ext == 'gif' || $ext == 'jpeg' || $ext == 'jpg' || $ext == 'png') {
$type=''.$diz -> img('obmen/img.png').'';
}
else if ($ext == 'mp3' || $ext == 'wav') {
$type=''.$diz -> img('obmen/mp3.png').'';
}
else if ($ext == 'jar') {
$type=''.$diz -> img('obmen/jar.png').'';
}
else if ($ext == 'txt') {
$type=''.$diz -> img('obmen/byb.png').'';
}
else if ($ext == '3gp' || $ext == 'avi' || $ext == 'mp4' || $ext == 'flv') {
$type=''.$diz -> img('obmen/video.png').'';
}
else if ($ext == 'rar') {
$type=''.$diz -> img('obmen/rar.png').'';
}
else if ($ext == 'zip') {
$type=''.$diz -> img('obmen/zip.png').'';
}
else {
$type=''.$diz -> img('obmen/other.png').'';
}
echo '<div class="menu"><a href="file'.$row['id'].'" class="menutuch"> '.$type.' '.$post['name'].' ['.$func -> times(date('d m Y',$post['dateupload'])).' ] <span class="count"/>'.$func -> size(filesize($post['infolder'])).'</span></a></div>';
}
$act = 'new.php?';
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="/index.php" class="levo_tuch"> '.$diz -> img('home.png').' На главную</a></div>';
#####Копирайт#######
$diz -> out($msg);
} else header('location: ../aut.php');
?>