Размер файла: 8.53Kb
<?php
/*
=============================================
Движок: SHCMS Engine
=============================================
Название файла: Обменник
=============================================
Official website: http://shcms.ru
=============================================
*/
define('SHCMS', true);
include_once'../system/inc/basic_settings.php';
if(isset($_GET['act_dir']))
{$shcmsengine['title'] = Lang::get('Создание новой папки');}
else{$shcmsengine['title'] = Lang::get('Файловый обменник');}
include_once'../template/head.php';
$allfield = mysql_result(mysql_query("SELECT COUNT(*) FROM `download_dir` WHERE `dir_index`='0'"),0);
$newlist = new Navigation($allfield,10, true);
$file_cat = mysql_query("SELECT * FROM `download_dir` WHERE `dir_index`='0' ". $newlist->limit()."");
$dir_cats = mysql_fetch_array($file_cat);
if($_GET['dir']){
$dir = $_GET['dir'];
}
if($dir == false) {
if($user_id) {
echo '<div class="maintitle mainrazd">'.Lang::get('Поиск файлов:').'</div>
<div class="maintext"><form action="search.php" method="post">';
echo '<input type="text" name="search">';
echo '<input type="submit" name="submit" value="'.Lang::get('Искать').'"></form>
'.Lang::get('<small> * Файлы найти можно по названию</small>').'</div>';
}
$new_files = mysql_result(mysql_query("SELECT COUNT(*) FROM `download_file` WHERE `time` > '".(time()-86400)."'"),0);
echo '<div class="maintext"><a href="new.files.php">'.Lang::get('Новые поступление').' ('.$new_files .')</a></div>';
if($dir_cats == null) {
echo '<div class="maintext"><img src="../template/icon/empty.png"> '.Lang::get('Файловый обменник пустой!').'</div>';
}
else
{
echo '<div class="maintitle mainrazd">'.Lang::get('Обменник файлов').'</div><div class="maintext">';
do
{
echo '<div class="posts"> <img src="icons/dir.png"/> <a href="?dir='.$dir_cats['id'].'">'.$dir_cats['name'].' </a>';
echo '</div>';
}
while($dir_cats = mysql_fetch_array($file_cat));
echo '</div>';
echo '<div class="pages">';
echo $newlist->pagination();
echo '</div>';
}
if($user4['team'] == 6) {
echo '<div class="maintitle mainrazd">'.Lang::get('Навигация').'</div>';
echo '<div class="maintext"><div class="posts"><a href="new_dir.php">'.Lang::get('Создать папку').'</a></div>';
echo '<div class="posts"><a href="edit.php">'.Lang::get('Настройка папок').'</a></div></div>';
}
}
/*
@ $dir
*/
if(isset($_GET['dir']) and $dir_cats != null) {
$id = $dir;
$yel_down = mysql_query("SELECT * FROM `download_dir` WHERE `dir_index`='$dir'");
$ok_down = mysql_fetch_array($yel_down);
$files = mysql_fetch_array(mysql_query("SELECT * FROM `download_file` WHERE `id_dir`='$dir'"));
$rt_d = mysql_result(mysql_query("SELECT COUNT(*) FROM `download_dir` WHERE `dir_index` = '$dir'"), 0);
$allfield1 = mysql_result(mysql_query("SELECT COUNT(*) FROM `download_file` WHERE `id_dir`='$dir'"),0);
$newlist1 = new Navigation($allfield1,10,true);
$filew = mysql_query("SELECT * FROM `download_file` WHERE `id_dir`= '$dir' ORDER BY `id` DESC ". $newlist1->limit()."");
$type_file = mysql_fetch_array(mysql_query("SELECT * FROM `download_dir` WHERE `id` = '$dir'"));
if($type_file['type'] == 2) {
echo '<div class="maintitle mainrazd"><center>'.Lang::get('Раздел картинок').'</center></div><div class="maintext">';
echo Lang::get('Всего картинок:').' '.mysql_result(mysql_query("SELECT COUNT(*) FROM `download_file` WHERE `type` = 'png' OR `type` = 'jpg' OR `type` = 'jpeg' OR `type` = 'gif'"),0).'<br/>';
$new_photo = mysql_fetch_array(mysql_query("SELECT * FROM `download_file` WHERE `type` = 'png' OR `type` = 'jpg' OR `type` = 'jpeg' OR `type` = 'gif' ORDER BY `id` DESC LIMIT 1"));
echo Lang::get('Последняя добавленная картинка:').' <a href="files.php?id='.$new_photo['id'].'">'.$new_photo['names'].'</a>';
echo '</div>';
}
elseif($type_file['type'] == 3) {
echo '<div class="maintitle mainrazd"><center>'.Lang::get('Музыкальный раздел').'</center></div><div class="maintext">';
echo Lang::get('Всего песен:').' '.mysql_result(mysql_query("SELECT COUNT(*) FROM `download_file` WHERE `type` = 'mp3'"),0).'<br/>';
$new_music = mysql_fetch_array(mysql_query("SELECT * FROM `download_file` WHERE `type` = 'mp3' ORDER BY `id` DESC LIMIT 1"));
echo Lang::get('Последняя добавленная песня:').' <a href="files.php?id='.$new_music['id'].'">'.$new_music['names'].'</a>';
echo '</div>';
}
elseif($type_file['type'] == 4) {
echo '<div class="maintitle mainrazd"><center>'.Lang::get('Видео раздел').'</center></div><div class="maintext">';
echo Lang::get('Всего видео:').' '.mysql_result(mysql_query("SELECT COUNT(*) FROM `download_file` WHERE `type` = 'mp4' OR `type` = 'avi' OR `type` = '3gp' OR `type` = 'flv' OR `type` = 'mpg'"),0).'<br/>';
$new_video = mysql_fetch_array(mysql_query("SELECT * FROM `download_file` WHERE `type` = 'mp4' OR `type` = 'avi' OR `type` = '3gp' OR `type` = 'flv' OR `type` = 'mpg' ORDER BY `id` DESC LIMIT 1"));
if($new_video == false) {
echo Lang::get('Последняя добавленная видео: Видео отсутствуют');
}else {
echo Lang::get('Последняя добавленная видео:').' <a href="files.php?id='.$new_video['id'].'">'.$new_video['names'].'</a>';
}
echo '</div>';}
elseif($type_file['type'] == 5) {
echo '<div class="maintitle mainrazd"><center>'.Lang::get('Архивный раздел').'</center></div><div class="maintext">';
echo Lang::get('Всего архивов:').' '.mysql_result(mysql_query("SELECT COUNT(*) FROM `download_file` WHERE `type` = 'zip' OR `type` = 'rar' "),0).'<br/>';
$new_arhive = mysql_fetch_array(mysql_query("SELECT * FROM `download_file` WHERE `type` = 'zip' OR `type` = 'rar' ORDER BY `id` DESC LIMIT 1"));
echo Lang::get('Последний добавленный архив:').' <a href="files.php?id='.$new_arhive['id'].'">'.$new_arhive['names'].'</a>';
echo '</div>';
}
if($ok_down){
do {
$result_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `download_file` WHERE `id_dir` = '$ok_down[id]'"),0);
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `download_dir` WHERE `dir_path` LIKE '%$ok_down[dir_path]%' AND `id` != '$ok_down[id]' AND `time` > '". (time()-3600*24*3) ."'"), 0) != 0) ;
echo '<div class="posts">
<img src="icons/dir.png"/> <a href="?dir='.$ok_down['id'].'">'.$ok_down['name'].'</a>
<span class="count">'. $result_count.'</span></div>';
}
while ($ok_down = mysql_fetch_array($yel_down));
}
if(mysql_num_rows($yel_down) == NULL and mysql_num_rows($filew)== NULL )
{
echo '<div class="maintext">';
SHCMS_core::img_shcms('../template/icon/empty.png');
echo Lang::get('В данной папки не найдено файлов').'</div>';
}
$file_while = mysql_fetch_array($filew);
if($file_while != null) {
echo '<div class="maintext">';
do
{
files::files_icon($file_while['type']);
}
while($file_while = mysql_fetch_array($filew));
echo '</div><div class="pages">';
echo $newlist1->pagination('dir='.$id);
echo '</div>';
}
if(isset($user_id)) {
$world = mysql_fetch_array(mysql_query("SELECT * FROM `download_dir` WHERE `id`='$id'"));
echo '<div class="maintext">';
if($world['vib'] == 1 or $user4['team'] == 6){
echo '<div class="posts"><a href="upload.php?dir='.$dir.'&'.$conservation.'">'.Lang::get('Выгрузить файл').'</a></div>';
if($user4['team'] == 6) {
echo '<div class="posts"><a href="new_dir.php?dir='.$dir.'&act_dir&'.$conservation.'">'.Lang::get('Создать папку').'</a></div>';
}
}
echo '</div>';
}
}
include_once'../template/foot.php';
?>