Файл: vkollektive2014/user/shared_zona/list.php
Строк: 38
<?
/*
# by gold_spaces
*/
include '../../connect.php';
include 'func.php';
include '../../head.php';
echo '<div class="title">Зона Обмена</div>';
$id = abs(intval($_GET['id']));
$praz = mysql_fetch_assoc(mysql_query("SELECT * FROM `down_pr` where `id` = '$id' limit 1"));
$raz = mysql_fetch_assoc(mysql_query("SELECT * FROM `down_r` where `id` = '$praz[id_r]' limit 1"));
if(empty($praz['name']) or empty($raz['name'])){
echo'<div class="main">Нет такой подкатегории/категории!</div>';include '../foot.php';exit();}
$all = mysql_result(mysql_query("SELECT count(id) FROM `down` WHERE `id_pr` = '$id'"),0);
if ($all != 0){
$total = intval(($all - 1) / 15) + 1;
$page = num($_GET['page']);
if(empty($page) or $page < 0) $page = 1;
if($page > $total) $page = $total;
$start = $page * 15 - 15;
$view = mysql_query("SELECT * FROM `down` WHERE `id_pr` = '$id' ORDER BY `time` DESC LIMIT $start,15");
while($a = mysql_fetch_assoc($view)){
$size = filesize($a['file']);
$ext = strtolower(strrchr($a['file'], '.'));
if ($ext == '.zip') $format = '<img src="img/zip.png" alt="*"/> ';
elseif ($ext == '.3gp' || $ext == '.mp4' || $ext == '.avi' || $ext == '.flv')
$format = '<img src="img/3gp.png" alt="*"/> ';
elseif ($ext == '.rar') $format = '<img src="img/rar.png" alt="*"/> ';
elseif ($ext == '.png') $format = '<img src="img/png.png" alt="*"/> ';
elseif ($ext == '.jpg')
$format = '<img src="img/jpg.png" alt="*"/> ';
elseif ($ext == '.gif')
$format = '<img src="img/jpg.png" alt="*"/> ';
elseif ($ext == '.mp3')
$format = '<img src="img/mp3.png" alt="*"/> ';
elseif ($ext == '.jar')
$format = '<img src="img/jar.png" alt="*"/> ';
else $format = '<img src="http://delowap.ru/icon/ico23/paypal.png" alt="*"/> ';
echo '<div class="div"><a href="info.php?id='.$a['id'].'">'.$format.' '.$a['name'].' ('.size($size).') ('.vremya($a['time']).')</a></div>';
}
} else {
echo '<div class="main">Файлов нет!</div>';
}
navigation($page, $total,'list.php?id='.$id.'&');
if($u['id']){echo '<div class="link"><a href="up.php?id='.$id.'">Выгрузить файл</a></div>';}
include '../../foot.php';
?>