Файл: mob-lave.ru/moduls/obmen/file.php
Строк: 36
<?php
require_once '../../core/set.php';
if(isset($_GET['id']) && isset($_GET['dir']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_obmen_files` WHERE `id_file` = '".num($_GET['id'])."'"),0) == true){
$f = num($_GET['id']);
$dir = num($_GET['dir']);
$file = mysql_fetch_assoc(mysql_query("SELECT * FROM `$system[perfix]_user_files` WHERE `id` = '$f'"));
$file_dir = mysql_fetch_assoc(mysql_query("SELECT * FROM `$system[perfix]_user_files_dir` WHERE `id` = '$file[id_dir]'"));
if($file_dir == NULL){
$file_dir['title'] = 'Начало';
$file_dir['id'] = 0;
}
$file_name = htmlspecialchars($file['name']);
$avtor = mysql_fetch_assoc(mysql_query("SELECT `id`,`login` FROM `$system[perfix]_users` WHERE `id` = '$file[id_user]'"));
$set['title'] = htmlspecialchars($file['title']);
require_once H.'core/head.php';
require_once H.'core/panel.php';
echo '<div class="navig">'.$home.$z.'<a href="/moduls/obmen/">Начало</a>'.$z.obmen_nav($dir). $set['title'].'</div>';
// ---------- Скачать -------- //
if(isset($_GET['download'])) echo DownloadFile(H."files/user_files/files/$avtor[id]$file[id].dat", "$file_name");
echo '<div class="mess">'.htmlspecialchars($file['title']).'</div>';
echo '<div class="mess">Загрузил '.vremja($file['time']).'<br />';
echo avatar($avtor['id'], false, 50). online($avtor['id']).' <a href="/?login='.$avtor['login'].'">'.$avtor['login'].'</a><br />
Папка: <a href="/moduls/user_files/?id='.$avtor['id'].'&dir='.$file_dir['id'].'">'.htmlspecialchars($file_dir['title']).'</a></div>';
echo '<div class="mess"><div id="dark" class="icon-disk"></div> <a href="/moduls/user_files/file.php?id='.$avtor['id'].'&dir='.$file['id_dir'].'&file='.$f.'&download">Скачать</a> ('.size_file($file['size']).')</div>';
$komm_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_user_files_komm` WHERE `id_user` = '$avtor[id]' && `id_file` = '$f'"),0);
echo '<div class="foot">Комментарии ('.$komm_count.')</div>';
require_once H.'moduls/obmen/komm.php';
echo '<div class="navig">'.$home.$z.'<a href="/moduls/obmen/">Начало</a>'.$z.obmen_nav($dir). $set['title'].'</div>';
require_once H.'core/foot.php';
}else{
header("Location: /moduls/user_files/?id=$user[id]");
}
?>