View file exchanger.php

File size: 23.1Kb
<?php
include 'sys/db.php';
include 'sys/conf.php';
include 'sys/start.php';
include 'sys/functions.php';
$config_title_name = "Обменник";
$config_exchanger_confirm = "1"; /// Нужно ли подтверждать файлы в обменнике? если 0 - нужно, 1 - не нужно
include 'style/head.php';
if(isset($user['login'])){
$act = isset($_GET['act']) ? $_GET['act'] : '';
switch($act){
default:
echo "<div class=title>Обменник</div>";
echo "<div class=content>\n";
$exchanger = mysql_query("SELECT * FROM `exchanger` ORDER BY `name` ASC");
if(mysql_num_rows($exchanger)!=0){
while($exc = mysql_fetch_array($exchanger)){
echo "\n\n<div class=content><img src='img/dir.gif' alt=''> <a href='?act=sct&id=".$exc['id']."'>".$exc['name']."</a>
[".mysql_result(mysql_query("SELECT COUNT(*) FROM `exchanger_section` WHERE `exchanger` = '$exc[id]'"),0)." /
".mysql_result(mysql_query("SELECT COUNT(*) FROM `exchanger_files` WHERE `exchanger` = '$exc[id]'"),0)."]</div>\n\n";}
}else{echo "<br><img src='img/error.gif' alt=''> Разделы еще не созданны!<br><br>\n";}
echo "</div>\n";
if(isset($user['level']) && $user['level']=='1'){
echo "<div class=content>\n";
if (isset($_POST['name'])){
if (strlen($_POST['name']) >= '3'){
if (strlen($_POST['name']) <= '32'){
if ($_POST['name'] != NULL && $_POST['type'] != NULL){
$name = stripcslashes(htmlspecialchars($_POST['name']));
$type = intval($_POST['type']);
$translite_dir = transliter($name);
mkdir("files/exchanger/$translite_dir", 0777);
mysql_query ("INSERT INTO `exchanger` (name,type) VALUES ('$name','".intval($_POST['type'])."')");
header ("Location: exchanger.php"); exit;}
}else{echo "Название должно состоять не больше 32х символов!<br>\n";}
}else{echo "Название должно состоять не меньше 3х символов!<br>\n";}}
echo "<form action='?' method='post' name='reg'>\n";
echo "Название (Max-32): <br>\n <input name='name' type='text'><br>\n";
echo "Тип раздела:<br>\n";
echo "<select name='type'> \n";
echo "<option value='1' selected='selected'>Мелодии</option> \n";
echo "<option value='2' >Игры</option>\n";
echo "<option value='3' >Видео</option>\n";
echo "<option value='4' >Темы</option>\n";
echo "<option value='5' >Картинки</option>\n";
echo "<option value='6' >Анимации</option>\n";
echo "</select><br>\n";
echo "<input type='submit' name='create' value='Создать'></form>\n";
echo "</div>\n";}
echo "<div class=stat><a href='index.php'>Прихожая</a></div>\n";
break;


case('sct'):
$id = intval($_GET['id']);
if ($id){
$check = mysql_fetch_array(mysql_query("SELECT * FROM `exchanger` WHERE `id` = '$id'"));
if($check!=0){
$exchanger = mysql_query("SELECT name,type FROM `exchanger` WHERE `id` = '$id' ");
$exc = mysql_fetch_array($exchanger);
echo "<div class=title>Обменник / ".$exc['name']."</div>";
echo "<div class=content>\n";
$section = mysql_query("SELECT * FROM `exchanger_section` WHERE `exchanger` = '$id' ORDER BY `name` ASC");
if (mysql_num_rows($section)!=0){
while($sec = mysql_fetch_array($section)){
echo "\n\n<div class=content>";
echo "<img src='img/dir.gif' alt=''> <a href='?act=files&id=".$sec['id']."'>".$sec['name']."</a> [".mysql_result(mysql_query("SELECT COUNT(*) FROM `exchanger_files` WHERE `section` = '$sec[id]'"),0)."]</div>\n\n";}
}else{echo "<br><img src='img/error.gif' alt=''> Категории еще не созданны!<br><br>\n";}
echo "</div>\n";
if(isset($user['level']) && $user['level']=='1' || $user['level']=='2'){
echo "<div class=content>\n";
if (isset($_POST['name'])){
if (strlen($_POST['name']) >= '3'){
if (strlen($_POST['name']) <= '32'){
if ($_POST['name'] != NULL && $_GET['id'] != NULL){
$name = stripcslashes(htmlspecialchars($_POST['name']));
$translite_dir = transliter($exc[name]);
$translite_kat = transliter($name);
mkdir("files/exchanger/$translite_dir/$translite_kat", 0777);
$htaccess = "php_flag engine off";
$fp = fopen ("files/exchanger/$translite_dir/$translite_kat/.htaccess", "w");
fwrite($fp,$htaccess);
fclose($fp);
mysql_query ("INSERT INTO `exchanger_section` (name,exchanger) VALUES ('$name','$id')");
header ("Location: ?act=sct&id=$id"); exit;}
}else{echo "Название должно состоять не больше 32х символов!<br>\n";}
}else{echo "Название должно состоять не меньше 3х символов!<br>\n";}}
echo "<form action='?act=sct&id=$id' method='post' name='reg'>\n";
echo "Название (Max-32): <br>\n <input name='name' type='text'><br>\n";
echo "<input type='submit' name='create' value='Создать'></form>\n";
echo "</div>\n";}
}else{echo "<div class=content><br><img src='img/error.gif' alt=''> Такого раздела не существует!<br><br></div>\n";}
}else{echo "<div class=content><br><img src='img/error.gif' alt=''> Не выбран ID!<br><br></div>\n";}
echo "<div class=stat><a href='exchanger.php'>Назад</a></div>\n";
echo "<div class=stat><a href='index.php'>Прихожая</a></div>\n";
break;

case('files'):
$id = intval($_GET['id']);
if ($id){
$check = mysql_fetch_array(mysql_query("SELECT * FROM `exchanger_section` WHERE `id` = '$id'"));
if($check != 0){
$section = mysql_query("SELECT * FROM `exchanger_section` WHERE `id` = '$id'");
$sec = mysql_fetch_array($section);
$exchanger = mysql_query("SELECT * FROM `exchanger` WHERE `id` = '$sec[exchanger]'");
$exc = mysql_fetch_array($exchanger);
echo "<div class=title>Обменник / ".$exc['name']." / ".$sec['name']." </div>";
echo "<div class=content>\n";

function pages($start, $total, $page, $onpage){
if ($start != 0) echo '<a href="'.$page.'?act=files&id='.intval($_GET['id']).'&start='.($start - $onpage).'">&lt;-Назад</a> ';
else echo '&lt;-Назад';
echo ' | ';
if ($total > $start + $onpage)
echo ' <a href="'.$page.'?act=files&id='.intval($_GET['id']).'&start='.($start + $onpage).'">Далее-&gt;</a>';
else echo 'Далее-&gt;';
if($total>0){
$ba = ceil($total/$onpage);
$ba2 = $ba*$onpage-$onpage;
echo '<br/>Страницы:';
$asd = $start-($onpage*3);
$asd2 = $start+($onpage*4);
if($asd<$total && $asd>0) echo ' <a href="'.$page.'?act=files&id='.intval($_GET['id']).'&start=0">1</a> ... ';
for($i=$asd; $i<$asd2;){
if($i<$total && $i>=0){
$ii = floor(1+$i/$onpage);
if ($start==$i) echo ' <b>['.$ii.']</b>';
else echo ' <a href="'.$page.'?act=files&id='.intval($_GET['id']).'&start='.$i.'">'.$ii.'</a>';}
$i=$i+$onpage;}
if($asd2<$total) echo ' ... <a href="'.$page.'?act=files&id='.intval($_GET['id']).'&start='.$ba2.'">'.$ba.'</a>';}}
if ($config_exchanger_confirm != '1'){
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `exchanger_files` WHERE `section` = '$id' AND `confirm` = '1'"),0);
}else{
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `exchanger_files` WHERE `section` = '$id'"),0);}
$start = isset($_GET['start']) ? abs((int)$_GET['start']) : 0;
if($start > $total) $start = 0;
if ($total < $start + 10) $end = $total;
else $end = $start + 10;
if ($config_exchanger_confirm != '1'){
$files = mysql_query("SELECT * FROM `exchanger_files` WHERE `section` = '$id' AND `confirm` = '1' ORDER BY `time` DESC LIMIT $start, 10");
}else{
$files = mysql_query("SELECT * FROM `exchanger_files` WHERE `section` = '$id' ORDER BY `time` DESC LIMIT $start, 10");
}


if (mysql_num_rows($files)!=0){
while($fil = mysql_fetch_array($files)){
echo "\n\n<div class=content>";
$uploaded = mysql_query("SELECT * FROM `users` WHERE `id` = '$fil[uploaded]'");
$upl = mysql_fetch_array($uploaded);
$timedat = date("d.m.Y", time($fil[time]));
if ($exc['type'] == '1'){echo "<img src='img/files/music.gif' alt=''>";}
elseif ($exc['type'] == '2'){echo "<img src='img/files/games.gif' alt=''>";}
elseif ($exc['type'] == '3'){echo "<img src='img/files/video.gif' alt=''>";}
elseif ($exc['type'] == '4'){echo "<img src='img/files/theme.gif' alt=''>";}
elseif ($exc['type'] == '5'){echo "<img src='img/files/images.gif' alt=''>";}
elseif ($exc['type'] == '6'){echo "<img src='img/files/images.gif' alt=''>";}
$ext = strtolower(substr($fil['file'], 1 + strrpos($fil['file'], ".")));

echo " <a href='?act=downl&id=".$fil['id']."'>".$fil['name'].".$ext</a> <br> Загружен: $timedat<br> Загрузил: ".$upl['login']." <br>Просмотров: ".$fil['download']." раз</div>\n\n";}
}else{echo "<br><img src='img/error.gif' alt=''> Файлов еще нет!<br><br>\n";}
echo "</div>\n";
echo "<div class=stat><a href='?act=load&id=$id'>Загрузить файл</a></div>\n";
echo "</div>\n<div class=stat>\n";
pages($start, $total, 'exchanger.php', 10);
echo "</div>\n";
echo "<div class=stat><a href='?act=sct&id=".$sec['exchanger']."'>Назад</a></div>\n";
}else{echo "<div class=content><br><img src='img/error.gif' alt=''> Такой категории не существует!<br><br></div>\n";}
}else{echo "<div class=content><br><img src='img/error.gif' alt=''> Не выбран ID!<br><br></div>\n";}
echo "<div class=stat><a href='exchanger.php'>В обменник</a></div>\n";
echo "<div class=stat><a href='index.php'>Прихожая</a></div>\n";
break;
case('load'):
$id = intval($_GET['id']);
if ($id){
$section = mysql_query("SELECT * FROM `exchanger_section` WHERE `id` = '$id'");
$sec = mysql_fetch_array($section);
$exchanger = mysql_query("SELECT * FROM `exchanger` WHERE `id` = '$sec[exchanger]'");
$exc = mysql_fetch_array($exchanger);
echo "<div class=title>Обменник / ".$exc['name']." / ".$sec['name']." / Загрузка файла</div>";
echo "<div class=content>\n";
if ($_GET['isset'] == format){ echo "Неверный формат файла!<br><br>\n";}
if ($exc['type'] == '1'){ $file_format = "MP3, MMF, AAC, AMR, WAV, MIDI";}
elseif ($exc['type'] == '2'){ $file_format = "JAD, JAR, SIS, XSIS, CAB";}
elseif ($exc['type'] == '3'){ $file_format = "3GP, AVI, MP4";}
elseif ($exc['type'] == '4'){ $file_format = "MTF, NTH, SIS, SDT, UTZ, THM, SSF, SCS, SDT, HME, MTF, TSK";}
elseif ($exc['type'] == '5'){ $file_format = "JPG, GIF, PNG";}
elseif ($exc['type'] == '6'){ $file_format = "GIF";}
echo "Загрузка файла: <br>\n";
echo "<form action='?act=loadfile&id=$id' method='POST' enctype='multipart/form-data'><br>\n";
echo "Файл ($file_format)*:<br> <input type='file' name='t_item'> <br>\n";
if ($exc['type'] == '4' || $exc['type'] == '2'){
echo "Скриншот: (GIF, JPG)*:<br> <input type='file' name='screenshot'> <br>\n";
echo "Модель телефона:<br>\n";
echo "<select name='model'> \n";
echo "<option value='1' selected='selected'>LG</option> \n";
echo "<option value='2' >Motorola</option>\n";
echo "<option value='3' >Nokia</option>\n";
echo "<option value='4' >Samsung</option>\n";
echo "<option value='5' >Siemens</option>\n";
echo "<option value='6' >Sony Ericsson</option>\n";
echo "<option value='7' >Windows Mobile</option>\n";
echo "</select><br>\n";
if ($exc['type'] == '2'){
echo "Размер экрана: <br>\n";
echo "<select name='sized'> \n";
echo "<option value='0' selected='selected'>Размер экрана</option> \n";
echo "<option value='1' >128x160</option>\n";
echo "<option value='2' >128x160</option>\n";
echo "<option value='3' >208x208</option>\n";
echo "<option value='4' >240x320</option>\n";
echo "<option value='5' >176x208</option>\n";
echo "<option value='6' >240x320</option>\n";
echo "<option value='7' >352x416</option>\n";
echo "</select><br>\n";}}
if ($exc['type'] == '1'){
echo "Артист (Max-50):<br>\n";
echo "<input type='text' name='artist'><br>\n";
echo "Жанр (Max-50):<br>\n";
echo "<input type='text' name='genre'><br>\n";
echo "Альбом (Max-50):<br>\n";
echo "<input type='text' name='album'><br>\n";}
echo "Название (Max-50):<br>\n";
echo "<input type='text' name='name'><br>\n";
echo "Описание (Max-300):<br>\n";
echo "<input type='text' name='description'><br>\n";
echo "<input type='submit' name='ok' value='Добавить'></form>\n";
echo "</div>\n";
}else{echo "<div class=content><br><img src='img/error.gif' alt=''> Не выбран ID!<br><br></div>\n";}
echo "<div class=stat><a href='?act=files&id=$id'>".$sec['name']."</a></div>\n";
echo "<div class=stat><a href='?act=sct&id=".$sec['exchanger']."'>".$exc['name']."</a></div>\n";
echo "<div class=stat><a href='exchanger.php'>В обменник</a></div>\n";
echo "<div class=stat><a href='index.php'>Прихожая</a></div>\n";
break;
case('loadfile'):
$id = intval($_GET['id']);
if ($id){
if (strlen($_POST['name']) <= '3'){ header ("Location: ?act=load&id=$id&isset=small"); exit;}
if (strlen($_POST['name']) >= '50'){ header ("Location: ?act=load&id=$id&isset=big"); exit;}
if (strlen($_POST['artist']) >= '50'){ header ("Location: ?act=load&id=$id&isset=bigartist"); exit;}
if (strlen($_POST['genre']) > '50'){ header ("Location: ?act=load&id=$id&isset=biggenre"); exit;}
if (strlen($_POST['album']) > '50'){ header ("Location: ?act=load&id=$id&isset=bigalbum"); exit;}
$section = mysql_query("SELECT * FROM `exchanger_section` WHERE `id` = '$id'");
$sec = mysql_fetch_array($section);
$exchanger = mysql_query("SELECT * FROM `exchanger` WHERE `id` = '$sec[exchanger]'");
$exc = mysql_fetch_array($exchanger);
if ($_POST[ok]) {
$rand_foto = rand(1000,99999999);
$foto_format = $_FILES[t_item][name];
$ext = strtolower(substr($foto_format, 1 + strrpos($foto_format, ".")));
if ($exc['type'] == '1'){
if($ext != "mp3" && $ext != "mmf" && $ext != "aac" && $ext != "amr" && $ext != "wav" && $ext != "midi"){header ("Location: ?act=load&id=$id&isset=format"); exit;}}
elseif ($exc['type'] == '2'){
if($ext != "jad" && $ext != "jar" && $ext != "sis" && $ext != "xsis" && $ext != "cab"){header ("Location: ?act=load&id=$id&isset=format"); exit;}}
elseif ($exc['type'] == '3'){
if($ext != "3gp" && $ext != "avi" && $ext != "mp4"){header ("Location: ?act=load&id=$id&isset=format"); exit;}}
elseif ($exc['type'] == '4'){
if($ext != "mtf" && $ext != "nth" && $ext != "sis" && $ext != "sdt" && $ext != "utz" && $ext != "thm" && $ext != "ssf" && $ext != "scs" && $ext != "sdt" && $ext != "hme" && $ext != "mtf" && $ext != "tsk"){header ("Location: ?act=load&id=$id&isset=format"); exit;}}
elseif ($exc['type'] == '5'){
if($ext != "jpg" && $ext != "gif" && $ext != "png"){header ("Location: ?act=load&id=$id&isset=format"); exit;}}
elseif ($exc['type'] == '6'){
if($ext != "gif"){header ("Location: ?act=load&id=$id&isset=format"); exit;}}
$foto_light_name = "$config_foto_title$rand_foto.$ext";
$translite_exchanger = transliter($exc['name']);
$translite_section = transliter($sec['name']);
$upfiledir = $_SERVER[DOCUMENT_ROOT]."/files/exchanger/$translite_exchanger/$translite_section/";
$upfile = $upfiledir . basename($foto_light_name);
if (move_uploaded_file($_FILES[t_item][tmp_name], $upfile ) ) {
if ($_POST['model']){$model = $_POST['model'];}else{$model = '0';}
if ($_FILES[screenshot][name]){
$rand = rand(1000,99999999);
$format = $_FILES[screenshot][name];
$ext = strtolower(substr($format, 1 + strrpos($format, ".")));
if($ext=="jpg" || $ext=="gif"){
$screen_name = "$config_foto_title$rand.$ext";
$upfiledir = "files/exchanger/screenshots/";
$upfile = $upfiledir . basename($screen_name);
if (move_uploaded_file($_FILES[screenshot][tmp_name], $upfile ) ) {
$uplink = "/files/exchanger/screenshots/".$_FILES[screenshot][name];
}}}
$name = stripcslashes(htmlspecialchars($_POST['name']));
$description = stripcslashes(htmlspecialchars($_POST['description']));
$sized = intval($_POST['sized']);
if ($_POST['artist']){ $album = stripcslashes(htmlspecialchars($_POST['artist']));}
if ($_POST['genre']){ $genre = stripcslashes(htmlspecialchars($_POST['genre']));}
if ($_POST['album']){ $album = stripcslashes(htmlspecialchars($_POST['album']));}
if ($config_exchanger_confirm != '1'){$confirm = "0";}else{$confirm = "1";}

mysql_query ("INSERT INTO `exchanger_files` (exchanger,section,name,file,description,time,uploaded,model,screenshot,sized,artist,genre,album,confirm) VALUES ('$exc[id]','$sec[id]','$name','$foto_light_name','$description','".time()."','$user[id]','$model','$screen_name','$sized','$artist','$genre','$album','$config_exchanger_confirm')");
mysql_query("UPDATE `users` SET `exchanger` = exchanger+1 WHERE `id` = '$user[id]'");
header ("Location: ?act=files&id=$id"); exit;
}}}
break;
case('downl'):
$id = intval($_GET['id']);
if ($id){
$check = mysql_fetch_array(mysql_query("SELECT * FROM `exchanger_files` WHERE `id` = '$id'"));
if($check != 0){
if ($config_exchanger_confirm != '1'){
$files = mysql_query("SELECT * FROM `exchanger_files` WHERE `id` = '$id' AND `confirm` = '1'");
}else{
$files = mysql_query("SELECT * FROM `exchanger_files` WHERE `id` = '$id'");}
if($file = mysql_fetch_array($files)){
$section = mysql_query("SELECT * FROM `exchanger_section` WHERE `id` = '$file[section]'");
$sec = mysql_fetch_array($section);
$exchanger = mysql_query("SELECT * FROM `exchanger` WHERE `id` = '$file[exchanger]'");
$exc = mysql_fetch_array($exchanger);
echo "<div class=title>Обменник / ".$exc['name']." / ".$sec['name']." / ".$file['name']."</div>";
if( isset($user['level']) || $user['level']=='1'  || $user['level']=='2'  || $user['level']=='3'){
echo "<div class=stat>[<a href='../panel/exchanger_confirm.php?act=edit&id=".$file['id']."'>Редактировать</a>]</div>\n";}
if ($file['18'] == '1'){
echo "<div class=content>\n";
echo "<img src='../img/lock.gif' alt=''> ВНИМАНИЕ!!! Этот файл для взрослых!<br>Скачивая его, вы подтверждаете, что вам 18 или более лет.";
echo "</div>";}
echo "<div class=content>\n";
$translite_dir = transliter($exc[name]);
$translite_kat = transliter($sec[name]);
$ufile = "files/exchanger/$translite_dir/$translite_kat/".$file['file']."";
$ufilez = round(filesize($ufile)/1024,1);
$ext = strtolower(substr($file['file'], 1 + strrpos($file['file'], ".")));
if ($exc['type'] == '1'){
///////////////////////музыка/////////////////////////////////////
echo "<img src='img/down.gif' alt=''> <a href='files/exchanger/$translite_dir/$translite_kat/".$file['file']."'>Скачать $ext</a> [$ufilez Kb]<br>\n";
echo "</div>\n";
echo "<div class=content>\n";
echo "Тип файла: <b>$ext</b> <br>\n";
if($file[artist] != NULL){echo "Описание: ".$file['artist']."<br>\n";}
if($file[genre] != NULL){echo "Жанр: ".$file['genre']."<br>\n";}
if($file[album] != NULL){echo "Альбом: ".$file['album']."<br>\n";}
echo "</div>\n";
}
elseif ($exc['type'] == '2'){
///////////////////////игры/////////////////////////////////////
if($file[screenshot] != NULL){
echo "<img src='screenshots.php?file=".$file['screenshot']."' alt=''><br>\n";
}else{ echo "Скриншота нет! <br><br>\n";}
echo "<img src='img/down.gif' alt=''> <a href='files/exchanger/$translite_dir/$translite_kat/".$file['file']."'>Скачать</a> $ext [$ufilez Kb]<br>\n";}
elseif ($exc['type'] == '3'){
///////////////////////видео/////////////////////////////////////
echo "<img src='img/down.gif' alt=''> <a href='files/exchanger/$translite_dir/$translite_kat/".$file['file']."'>Скачать</a> $ext [$ufilez Kb]<br>\n";}
elseif ($exc['type'] == '4'){
///////////////////////темы/////////////////////////////////////
if($file[screenshot] != NULL){
echo "<img src='screenshots.php?file=".$file['screenshot']."' alt=''><br>\n";
}else{ echo "Скриншота нет! <br><br>\n";}
echo "<img src='img/down.gif' alt=''> <a href='files/exchanger/$translite_dir/$translite_kat/".$file['file']."'>Скачать</a> $ext [$ufilez Kb]<br>\n";}
elseif ($exc['type'] == '5'){
///////////////////////картинки/////////////////////////////////////
$size = getimagesize ("files/exchanger/$translite_dir/$translite_kat/".$file['file']."");
echo "<img src='exchanger_image.php?dir=$translite_dir&kat=$translite_kat&file=".$file['file']."&H=73&W=60' alt=''><br>\n";
echo "<img src='img/down.gif' alt=''> <a href='files/exchanger/$translite_dir/$translite_kat/".$file['file']."'>Скачать</a>  $ext [$size[0]x$size[1], $ufilez Kb]<br>\n";
echo "Другой размер: <br>\n";
$arr = array ("128x128","120x160","132x176","176x220","240x320");
foreach($arr as $v){
list ($H,$W) = explode ("x",$v);
echo"[<a href='exchanger_image.php?dir=$translite_dir&kat=$translite_kat&file=".$file['file']."&H=$H&W=$W'>$v</a>] ";}}
elseif ($exc['type'] == '6'){
///////////////////////анимации/////////////////////////////////////
$size = getimagesize ("files/exchanger/$translite_dir/$translite_kat/".$file['file']."");
$ufile = "files/exchanger/$translite_dir/$translite_kat/".$file['file']."";
$ufilez = round(filesize($ufile)/1024,1);
echo "<img src='exchanger_image.php?dir=$translite_dir&kat=$translite_kat&file=".$file['file']."&H=73&W=60' alt=''><br>\n";
echo "<img src='img/down.gif' alt=''> <a href='files/exchanger/$translite_dir/$translite_kat/".$file['file']."'>Скачать</a> $ext [$size[0]x$size[1], $ufilez Kb]<br>\n";}
//////////////////////////////////////////////////////////////////////
echo "</div>\n";
if($file[description] != NULL){echo "<div class=content><b>Описание</b>: ".$file['description']."</div>\n";}
$uploaded = mysql_query("SELECT * FROM `users` WHERE `id` = '$file[uploaded]'");
$upl = mysql_fetch_array($uploaded);
echo "<div class=content>\n";
if ($upl[gender] == '1'){
echo "Добавил: <a href='anketa.php?id=".$file['uploaded']."'>".$upl['login']."</a><br>\n";}
elseif ($upl[gender] == '2'){
echo "Добавила: <a href='anketa.php?id=".$file['uploaded']."'>".$upl['login']."</a><br>\n";}
$timedat = date("d.m.Y", time($file[time]));
if ($exc['type'] == '4' || $exc['type'] == '2'){ echo "Для телефонов: ";
if($file[model] == '1'){echo "LG <br>\n";}
elseif($file[model] == '2'){echo "Motorola <br>\n";}
elseif($file[model] == '3'){echo "Nokia <br>\n";}
elseif($file[model] == '4'){echo "Samsung <br>\n";}
elseif($file[model] == '5'){echo "Siemens <br>\n";}
elseif($file[model] == '6'){echo "Sony Ericsson <br>\n";}
elseif($file[model] == '7'){echo "Windows Mobile <br>\n";}}
if ($exc['type'] == '2'){ echo "Размер экрана: ";
if($file[sized] == '1'){echo "128x160 <br>\n";}
elseif($file[sized] == '2'){echo "128x160 <br>\n";}
elseif($file[sized] == '3'){echo "208x208 <br>\n";}
elseif($file[sized] == '4'){echo "240x320 <br>\n";}
elseif($file[sized] == '5'){echo "176x208 <br>\n";}
elseif($file[sized] == '6'){echo "240x320 <br>\n";}
elseif($file[sized] == '7'){echo "352x416 <br>\n";}}
echo "Загружен: $timedat<br>\n";
echo "Просмотров: ".$file['download']."<br>\n";
echo "</div>\n";

echo "<div class=stat><a href='?act=files&id=".$file['section']."'>".$sec['name']."</a></div>\n";
echo "<div class=stat><a href='?act=sct&id=".$file['exchanger']."'>".$exc['name']."</a></div>\n";
}else{echo "<div class=content><br><img src='img/error.gif' alt=''> Фотография еще не подтверждена!<br><br></div>\n";}
}else{echo "<div class=content><br><img src='img/error.gif' alt=''> Такого файла не существует!<br><br></div>\n";}
}else{echo "<div class=content><br><img src='img/error.gif' alt=''> Не выбран ID!<br><br></div>\n";}

echo "<div class=stat><a href='exchanger.php'>В обменник</a></div>\n";
echo "<div class=stat><a href='index.php'>Прихожая</a></div>\n";
mysql_query("UPDATE `exchanger_files` SET `download` = download+1 WHERE `id` = '$id'");
break;
}}else{ header ("Location: index.php"); exit;}
include 'style/foot.php';
?>