Файл: mob-lave.ru/moduls/user_files/file.php
Строк: 84
<?php
require_once '../../core/set.php';
if(isset($_GET['id']) && isset($_GET['file']) && isset($_GET['dir']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_user_files` WHERE `id_dir` = '".num($_GET['dir'])."' && `id_user` = '".num($_GET['id'])."' && `id` = '".num($_GET['file'])."'"),0) == true){
$id_user = num($_GET['id']);
$dir = num($_GET['dir']);
$f = num($_GET['file']);
$file = mysql_fetch_assoc(mysql_query("SELECT * FROM `$system[perfix]_user_files` WHERE `id` = '$f' && `id_dir` = '$dir' && `id_user` = '$id_user'"));
$file_title = htmlspecialchars($file['title']);
$file_name = htmlspecialchars($file['name']);
$set['title'] = htmlspecialchars($file['title']);
require_once H.'core/head.php';
require_once H.'core/panel.php';
$ank = mysql_fetch_assoc(mysql_query("SELECT `id`, `login` FROM `$system[perfix]_users` WHERE `id` = '$id_user'"));
echo '<div class="navig">'.$home. $z.'<a href="/?login='.$ank['login'].'">'.$ank['login'].'</a>'.$z.'<a href="/moduls/user_files/?id='.$ank['id'].'">Начало</a>'.$z.user_files_nav($dir). $set['title'].'</div>';
// --------- Удл из обменника --------- //
if(isset($user['id']) && $user['id'] == $ank['id'] && isset($_GET['id']) && isset($_GET['dir']) && isset($_GET['file']) && isset($_GET['delete_obmen'])){
mysql_query("DELETE FROM `$system[perfix]_obmen_files` WHERE `id_file` = '$f'");
header("Location: /moduls/user_files/file.php?id=$ank[id]&dir=$dir&file=$f");
$_SESSION['message'] = 'Файл удален из файлообменника';
}
if(isset($user['id']) && $user['id'] == $ank['id'] && isset($_GET['id']) && isset($_GET['dir']) && isset($_GET['file']) && isset($_GET['del_obmen'])){
echo '<div class="mess">Вы действительно желаете удалить этот файл их файлообменника?<br />
<a href="/moduls/user_files//file.php?id='.$ank['id'].'&dir='.$dir.'&file='.$f.'&delete_obmen"><div id="dark" class="icon-checkmark"></div> Да</a> | <div id="dark" class="icon-undo2 "></div> <a href="/moduls/user_files//file.php?id='.$ank['id'].'&dir='.$dir.'&file='.$f.'">Нет</a></div>';
}
// ---------- Скачать -------- //
if(isset($_GET['download'])) echo DownloadFile(H."files/user_files/files/$ank[id]$file[id].dat", "$file_name");
echo '<div class="mess">'.$file_title.'</div>';
echo '<div class="mess">Загрузил '.vremja($file['time']).'<br />';
echo avatar($ank['id'], false, 50). online($ank['id']).' <a href="/?login='.$ank['login'].'">'.$ank['login'].'</a>';
$obmen_file = mysql_fetch_assoc(mysql_query("SELECT * FROM `$system[perfix]_obmen_files` WHERE `id_file` = '$f'"));
$obmen_filder = mysql_fetch_assoc(mysql_query("SELECT * FROM `$system[perfix]_obmen` WHERE `id` = '$obmen_file[id_dir]'"));
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_obmen_files` WHERE `id_file` = '$f'"),0) == false && $user['id'] == $ank['id']) echo '<br />Загрузить в <a href="/moduls/obmen/obmen.php?file='.$f.'">обменник</a>';
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_obmen_files` WHERE `id_file` = '$f'"),0) == true){
echo '<br />В обменнике папка: <a href="/moduls/obmen/?id='.$obmen_file['id_dir'].'">'.htmlspecialchars($obmen_filder['title']).'</a>';
if(isset($user['id']) && $user['id'] == $ank['id']) echo ' <a href="/moduls/user_files/file.php?id='.$ank['id'].'&dir='.$dir.'&file='.$f.'&del_obmen"><div id="dark" class="icon-cancel"></div></a>';
}
echo '</div>';
echo '<div class="mess"><div id="dark" class="icon-disk"></div> <a href="/moduls/user_files/file.php?id='.$ank['id'].'&dir='.$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_dir` = '$dir' && `id_user` = '$ank[id]' && `id_file` = '$f'"),0);
echo '<div class="foot">Комментарии ('.$komm_count.')</div>';
require_once H.'moduls/user_files/komm.php';
echo '<div class="navig">'.$home. $z.'<a href="/?login='.$ank['login'].'">'.$ank['login'].'</a>'.$z.'<a href="/moduls/user_files/?id='.$ank['id'].'">Начало</a>'.$z.user_files_nav($dir). $set['title'].'</div>';
require_once H.'core/foot.php';
}else{
header("Location: /moduls/user_files/?id=$user[id]");
}
?>