Файл: obmen/my_load.php
Строк: 62
<?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`)','obmen_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 `obmen_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('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'.$arr['id'].'" class="menutuch"> '.$type.' '.$arr['name'].' <span class="count"/>'.$func -> size(filesize($arr['infolder'])).'</span></a></div>';
}
$act = 'my_load.php?id='.$id.'';
echo ''.$func -> pagenav($act,$page,$total).'';
} else echo '<div class="fon">У '.$the['login'].' ещё нет файлов!</div>';
}else header('location: ./');
}else header('location: /aut.php');
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);
?>