Файл: my_load.php
Строк: 43
<?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]");
require_once (ROOT.'/new_mail.php');
$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['infolder'], PATHINFO_EXTENSION));
if ($ext == 'gif' || $ext == 'jpeg' || $ext == 'jpg' || $ext == 'png') {
$type=''.$diz -> img('load/img.gif').'';
}
else if ($ext == 'mp3' || $ext == 'wav') {
$type=''.$diz -> img('load/mp3.gif').'';
}
else if ($ext == 'jar') {
$type=''.$diz -> img('load/jar.png').'';
}
else if ($ext == 'txt') {
$type=''.$diz -> img('load/byb.gif').'';
}
else if ($ext == '3gp' || $ext == 'avi' || $ext == 'mp4' || $ext == 'flv') {
$type=''.$diz -> img('load/video.gif').'';
}
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.gif').'';
}
$msg .= ''.$type.' <a href="./view/'.$arr['id'].'/">'.htmlspecialchars($arr['name']).'</a> ('.$func -> size(filesize($arr['infolder'])).')<br/> </table></div>';
}
$act = 'my_load.php?id='.$id.'';
$msg .= ''.$func -> pagenav($act,$page,$total).'';
} else {
$msg .= 'У '.$the['login'].' ещё нет файлов!';
}
}else{header('location: ./');}
}else {header('location: ./aut.php');}
$msg .= '<div class="levo">'.$diz -> img('home.png').'<a href="index.php">На главную</a></div>';
#####Копирайт#######
require_once (ROOT.'system/kopy.php');
$diz -> out($msg);
?>