Файл: load/my_load.php
Строк: 52
<?php
define('ROOT','../');
define('GCMS',true);
require_once (ROOT.'system/power.php');
if ($aut == true) {
if ($id) {
$type = $db -> query("SELECT `id`,`login` FROM `users` WHERE `id` = '$id'");
if ($type -> num_rows > 0) $the = $type -> fetch_assoc(); else $the = false;
} else $the = false;
if($type -> num_rows > 0){
$diz -> head("Файлы $the[login]");
$count = $db -> dbcount('COUNT(`id`)','load_files',"`user` = '".$id."'");
$diz -> title("<a href='./'>Загрузки</a>/<b>Файлы $the[login] </b>($count)");
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;
$for = $db -> query("SELECT * FROM `load_files` WHERE `user` = '".$id."' ORDER BY `dateupload` DESC LIMIT ".$start.",".$num);
while ($arr = $for -> fetch_assoc()) {
$ext = strtolower(pathinfo($arr['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'.$arr['id'].'" class="menutuch">
<table width=100%><tr valign="top"><td width=5%>'.$type.'</td>
<td>'.$arr['name'].' <span class="count"/>'.$func -> size(filesize($arr['path'])).'</span></td></tr></table></a></div>';
}
$act = 'my_load.php?id='.$id.'';
$msg .= ''.$func -> pagenav($act,$page,$total).'';
} else {
$msg .= '<div class="fon">У '.$the['login'].' ещё нет файлов!</div>';
}
}else header('location: ./');
}else header('location: ../aut.php');
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);
?>