Файл: public_html/modules/up/file.php
Строк: 77
<?php
/*
* @author: Ivan Kotliar (wanya26ua), Sergiy Mazurenko (Tesla), Taras Chornyi (Artas)
* @link: http://perfclub.ru
* @year: 2013
* @package: PerfCMS Ultra
*/
$locate = 'in_obmen';
if(!isset($_GET['id'])) { go('/up/'); }
$id = abs(intval($_GET['id']));
if($db->query("SELECT * FROM `up_files` WHERE `id` = '". $id ."'")->rowCount() == 0) {
$title = $lang->word('share');
require_once(SYS.'/view/header.php');
$tpl->div('menu', $lang->word('file_not_exists'));
$tpl->div('block', NAV.' <a href="/up/">'. $lang->word('share') .'</a><br/>' . HICO .' <a href="/">'. $lang->word('home') .'</a>');
require_once(SYS.'/view/footer.php');
exit;
}
$file = $db->query("SELECT * FROM `up_files` WHERE `id` = '". $id ."'")->fetch();
if($file['parol'] != '' && $_SESSION['parol'] != $file['parol']) {
if(isset($_POST['pass']) && $_GET['act'] == 'parol')
{
$pass = htmlspecialchars(trim($_POST['parol']));
if($pass == $file['parol']) {
$_SESSION['parol'] = $pass;
header('location: /up/file/'.$file['id'].'/');
exit;
} else {
echo '<div class="menu">Пароль неверный</div>';
}
}
$title = 'Файл защищен паролем';
require_once(SYS .'/view/header.php');
$tpl->div('title', 'Файл защищен паролем');
echo '<form action="/up/file/'.$file['id'].'/?act=parol" method="post">
<div class="menu">
<b>Пароль</b>:<br/>
<input type="text" name="parol" /><br/>
<input name="pass" type="submit" value="Готово" /><br/>
</div>
</form>';
$tpl->div('block', NAV .'<a href="/up/">Обменник</a><br/>' . HICO .'<a href="/">'. $lang->word('home') .'</a>');
require_once(SYS .'/view/footer.php');
exit;
}
$title = $file['name'] .' | '. $lang->word('share');
require_once(SYS .'/view/header.php');
$tpl->div('title', $file['name']);
$file_q = $db->query("SELECT * FROM `up_files` WHERE `id` = '". $id ."'");
echo '<div class="menu">
'.(preg_match('/jpeg|jpg|gif|png|bmp/i', $file['ext']) ? '<img style="border: 1px solid #000;" weight="80" height="60" src="/files/up/'. $file['path_name'] .'" alt="Screen" /><br/>'."n" : (file_exists(ROOT.'/files/preview/'.$file['path_name'].'.png') ? '<a href="/files/preview/'.$file['path_name'].'.png"><img style="border: 1px solid #000;" weight="100" height="80" src="/files/preview/'.$file['path_name'].'.png" alt="Screen" /></a><br/>'."n" : NULL)) .'
'. output($file['text']) .'
</div>
<div class="post">
'.img('download.png').' <a href="/up/download/'. $file['id'] .'/">'. $lang->word('download') .' '.strtoupper($file['ext']).'</a> ('.size($file['size']).')<br/>
'. NAV . $lang->word('uploader').': <a href="/user/'.$file['user_id'].'">'. tnick($file['user_id']) .'</a> ('.rtime($file['time']).')<br/>
'. img('globe.png') . $lang->word('downloaded').': '.$file['dload_times'].'<br/></div>';
if($file['ext'] == mp3) {
echo '<div class="menu">
<object type="application/x-shockwave-flash" data="http://flv-mp3.com/i/pic/ump3player_500x70.swf" height="40" width="250"><param name="wmode" value="transparent" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="movie" value="http://flv-mp3.com/i/pic/ump3player_500x70.swf" /><param name="FlashVars" value="way='. URL .'/files/up/'.$file['path_name'].'&swf=http://flv-mp3.com/i/pic/ump3player_500x70.swf&w=250&h=40&time_seconds=0&autoplay=0&q=&skin=black&volume=70&comment='. URL .'/files/up/'.$file['path_name'].'" /></object>
</div>';
}
echo '<div class="menu">Ссылка:<br/><input type="text" name="name" value="http://cssliga.ru/up/file/'.$file['id'].'"/></div>
';
$tpl->div('block', NAV .'<a href="/up/">Обменник</a><br/>' . HICO .'<a href="/">'. $lang->word('home') .'</a>');
require_once(SYS .'/view/footer.php');
?>