Размер файла: 7.73Kb
<?
#-------------------------------------------#
# Автор скрипта : -=Орёл=- (c) #
# email : [email protected] #
# icq : 952-042 #
# Скрипт распространяется бесплатно:) #
# Пишу скрипты на заказ обращатся в icq #
#-------------------------------------------#
include_once("../inc/ini.php");
include_once("../inc/connect.php");
include_once("../inc/function.php");
include_once("../inc/config.php");
include_once("../themes/$config_themes/index.php");
$id_file = htmlspecialchars($_GET['id_file']);
$OR_ADD_INFO = mysql_query("SELECT * FROM files WHERE id='$id_file'");
if (mysql_num_rows($OR_ADD_INFO)){
$data = mysql_fetch_array($OR_ADD_INFO);
}else{
header('Location: http://'.$SITE.'/?error=403');
}
if (empty($data['opis'])){
$opis = 'Нет описания';
} else {
$opis = mess($data['opis']);
}
//------------------------Скачивание с паролем-----------------------//
if ($_GET['tid'] == 'avtorize'){
$pass = htmlspecialchars($_REQUEST['pass']);
$OR_ISSET_PASS = mysql_query("SELECT * FROM files WHERE id='$id_file' and pass='$pass'");
if (mysql_num_rows($OR_ISSET_PASS)){
$data1 = mysql_fetch_array($OR_ISSET_PASS);
$_SESSION['file']=$data1['pass'];
if ($_GET['id'] and $_SESSION['file'] == $data['pass']){
$OR_ADD_FILE = mysql_query("SELECT * FROM files WHERE id='$id_file'");
if (mysql_num_rows($OR_ADD_FILE)){
$date = mysql_fetch_array($OR_ADD_FILE);
$count = ($date['count']+1);
mysql_query("UPDATE files SET count='$count' WHERE id='$id_file'");
header('Location: http://'.$SITE.'/'.$dir_file.'/'.$date['file'].'');
}else{
header('Location: http://'.$SITE.'/?error=403');
}
}
//-------------------Предпросмотр--------------------//
$types_file = preg_match('#\.([a-z0-9]{1,5})$#i',$data['name'],$out);
$type_file = $out['1'];
if (strtolower($type_file) == 'png' || strtolower($type_file) == 'gif' || strtolower($type_file) == 'jpg' || strtolower($type_file) == 'jpge' || strtolower($type_file) == 'bmp'){
$scrin = '<img src="'.DIR.$dir_file.$data['file'].'" width="50" height="50"/><br />';
}
//------------------FLASH плеер------------------//
if ($type_file == 'mp3'){
$flash = '
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="96" height="20" id="own_flashplayer" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="../img/flash.swf?file=../files/'.$data['file'].'" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="../img/flash.swf?file=../files/'.$data['file'].'" quality="high" bgcolor="#ffffff" width="96" height="20" name="own_flashplayer" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object><br />
';
}
echo $div['title'].'Загрузка файла<br />'.$div['title_end'];
echo $div['menu'];
echo 'Файл: '.$data['name'].'<br />';
echo $scrin;
echo $flash;
if($type_file == 'mp3') {
include 'classAudioFile.php';
$AF = new AudioFile;
$AF->loadFile('../'.$dir_file.'/'.$data['file']);
$AF->printSampleInfo();
}
echo 'Размер: '.size(filesize(DIR.$dir_file.'/'.$data['file'])).'<br />';
echo 'Загружен: '.date_fix($data['time']).'<br />';
echo 'Скачиваний: '.$data['count'].'<br />';
echo 'Описание: '.Low($opis).'<br />';
echo '<br />';
echo '<img src="../img/down.gif"/><a href="?id_file='.$id_file.'&tid=avtorize&pass='.$pass.'&id='.$id_file.'">Скачать</a>('.size(filesize(DIR.$dir_file.'/'.$data['file'])).')<br />';
echo '<br />';
echo 'Ссылка<br />';
echo '<input type="text" value="http://'.$SITE.'/'.$id_file.'"><br />';
echo '<a href="../">На главную</a><br />';
echo $div['menu_end'];
include_once("../themes/$config_themes/foot.php");
exit;
}else{
echo $div['menu'];
echo 'Неправильный пароль';
echo $div['menu_end'];
}
}
if (!empty($data['pass'])){
echo $div['menu'];
echo 'Введите пароль<br />';
echo '<form action="?id_file='.$id_file.'&tid=avtorize" method="post">';
echo '<input type="password" name="pass"><br />';
echo '<input type="submit" value="Ввод"><br />';
echo $div['menu_end'];
include_once("../themes/$config_themes/foot.php");
exit;
}
//------------------------------Скачивание--------------------------//
if ($_GET['tid'] == 'down' and empty($data['pass'])){
$OR_ADD_FILE = mysql_query("SELECT * FROM files WHERE id='$id_file'");
if (mysql_num_rows($OR_ADD_FILE)){
$date = mysql_fetch_array($OR_ADD_FILE);
$count = ($date['count']+1);
$up = mysql_query("UPDATE files SET count='$count' WHERE id='$id_file'");
if ($up){
header('Location: '.DIR.$dir_file.'/'.$date['file'].'');
}
}else{
header('Location: http://'.$SITE.'/?error=403');
}
}
if (empty($data['pass'])){
//-------------------Предпросмотр--------------------//
$types_file = preg_match('#\.([a-z0-9]{1,5})$#i',$data['name'],$out);
$type_file = $out['1'];
if (strtolower($type_file) == 'png' || strtolower($type_file) == 'gif' || strtolower($type_file) == 'jpg' || strtolower($type_file) == 'jpge' || strtolower($type_file) == 'bmp'){
$scrin = '<img src="http://'.$SITE.'/'.$dir_file.'/'.$data['file'].'" alt="scrin" width="100" height="100"/><br />';
}
//------------------FLASH плеер------------------//
if ($type_file == 'mp3'){
$flash = '
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="96" height="20" id="own_flashplayer" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="../img/flash.swf?file=../files/'.$data['file'].'" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="../img/flash.swf?file=../files/'.$data['file'].'" quality="high" bgcolor="#ffffff" width="96" height="20" name="own_flashplayer" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object><br />
';
}
echo $div['title'].'Загрузка файла<br />'.$div['title_end'];
echo $div['menu'];
echo 'Файл: '.$data['name'].'<br />';
echo $scrin;
echo $flash;
if($type_file == 'mp3') {
include 'classAudioFile.php';
$AF = new AudioFile;
$AF->loadFile('../'.$dir_file.'/'.$data['file']);
$AF->printSampleInfo();
}
echo 'Размер: '.size(filesize(DIR.$dir_file.'/'.$data['file'])).'<br />';
echo 'Загружен: '.date_fix($data['time']).'<br />';
echo 'Скачиваний: '.$data['count'].'<br />';
echo 'Описание: '.Low($opis).'<br />';
echo '<br />';
if ($type_file == 'zip'){echo '<img src="../img/icon/zip.gif"/><a href="zip.php?id_file='.$id_file.'&dir='.$dir_file.'&file='.$data['file'].'">Просмотр архива</a><br />';}
echo '<img src="../img/down.gif"/><a href="?id_file='.$id_file.'&tid=down">Скачать</a>('.size(filesize(DIR.$dir_file.'/'.$data['file'])).')<br />';
echo '<br />';
echo 'Ссылка<br />';
echo '<input type="text" value="http://'.$SITE.'/'.$id_file.'"><br />';
echo '<br />';
echo '<img src="../img/kat.png"/><a href="kat.php">В каталог</a><br />';
echo '<img src="../img/home.png"/><a href="../">На главную</a><br />';
echo $div['menu_end'];
}
//---------------------------------Скачанивание с паролем-----------------------------//
include_once("../themes/$config_themes/foot.php");
?>