|
<?
/*
#Бесплатный WAP движок StrongCMS
#Официальный сайт поддержки: http://strongcms.ru
*/
$title = 'Загрузки';
require ('../system/core.php');
require ('../system/head.php');
if ($settings['down'] == 1)
login();
$switch = array(
'adddir',
'addfiles',
'addfiles_import',
'ban',
'deldir',
'delscreen',
'file',
'mycom',
'myfile',
'reit',
'screen',
'search',
'upfile');
if ($act && ($f = array_search($act, $switch)) !== FALSE && file_exists('switch/'.$switch[$f].'.php'))
{
require ('switch/'.$switch[$f].'.php');
} else
{
$dir['id'] = '0';
$dir['name'] = 'Загрузки';
$dir['id_dir'] = '0';
$dir['files'] = '0';
if (isset($_GET['dir']))
{
$direktor = abs(intval($_GET['dir']));
$ldr = $db->super_query("SELECT COUNT(*) as count FROM `load_dir` WHERE `id` = '".$direktor."'");
if ($ldr['count'] > 0)
{
$dir = $db->super_query("SELECT * FROM `load_dir` WHERE `id` = '".$direktor."' LIMIT 1");
}
}
if (isset($dir['url']))
$url = explode('/', $dir['url']);
echo '<div class="title">';
if ($dir['id'] != 0)
{
foreach ($url as $num => $id)
{
if ($id != 0)
{
$cat = $db->super_query("SELECT * FROM `load_dir` WHERE `id` = '".$id."' LIMIT 1");
} else
{
$cat['id'] = '0';
$cat['name'] = 'Загрузки';
}
if ($cat['id'] != 0)
echo ' | ';
echo "<a href='?dir=".$cat['id']."'>".$cat['name']."</a>";
}
echo ' | '.$dir['name'];
} else
{
echo 'Загрузки';
}
echo '</div>';
if ($dir['files'] == 0)
{
require ('panel.php');
$count = $db->super_query("SELECT COUNT(*) as count FROM `load_dir` WHERE `id_dir` = '".$dir['id']."'");
$start = nav($count['count']);
$query = $db->query("SELECT * FROM `load_dir` WHERE `id_dir` = '".$dir['id']."' ORDER BY `id` DESC LIMIT ".$start['s'].",".$max."");
while ($folder = $db->fetch_assoc($query))
{
$cnt = $db->super_query("SELECT COUNT(*) as count FROM `load_file` WHERE `url` like '%".$folder['id']."%'");
if ($folder['icon'])
echo '<img width="16" heaght="16" src="'.HOME.'/files/load_icon/'.$folder['icon'].'" alt="*" />';
echo ' <a href="?dir='.$folder['id'].'" class="menudiv">'.$folder['name'].' <span class="counts_right"><b>'.$cnt['count'].'</b></span> </a>';
}
if ($start['k_post'] < 1)
echo msg('Папок пока еще нет!');
if ($start['k_page'] > 1)
echo str('?dir='.$dir['id'].'&', $start['k_page'], $start['page']); // Вывод страниц
if ($user['level'] == 3)
{
echo '<a href="'.HOME.'/down/adddir'.$dir['id'].'" class="menudiv"><img src="'.HOME.'/images/add.png" alt="*"/> Добавить папку</a>';
if ($dir['id'] != 0)
{
echo '<a href="'.HOME.'/down/deldir'.$dir['id'].'" class="menudiv"><img src="'.HOME.'/images/delete.png" alt="*" /> Удалить папку</a>';
}
}
echo '</div>';
}
if ($dir['files'] != 0)
{
require ('panel.php');
$count = $db->super_query("SELECT COUNT(*) as count FROM `load_file` WHERE `id_dir` = '".$dir['id']."'");
$start = nav($count['count']);
$query = $db->query("SELECT * FROM `load_file` WHERE `id_dir` = '".$dir['id']."' ORDER BY `id` DESC LIMIT ".$start['s'].",".$max."");
while ($file = $db->fetch_assoc($query))
{
$text_v = cut_text($file['about'],20);
echo '<a href="'.HOME.'/down/file'.$file['id'].'" class="menudiv"><img src="'.HOME.'/images/load/'.$file['format'].'.png" alt="*" /> '.$file['name'].'</a>
<div class="news">'.$text_v.'</div>';
}
if ($start['k_post'] < 1)
echo msg('Файлов пока еще нет!');
if ($user['id'])
{
if ($dir['us_access'] == 1 || $user['level'] >= 1)
{
echo '<a href="'.HOME.'/down/addfiles'.$dir['id'].'" class="menudiv"><img src="'.HOME.'/images/add.png" alt="*" /> Добавить файл</a>
<a href="'.HOME.'/down/addfiles_import'.$dir['id'].'" class="menudiv"><img src="'.HOME.'/images/fileimport.png" alt="*" /> Импортировать файл </a>';
}
}
if ($dir['id'] != 0 and $user['level'] == 3)
{
echo '<a href="'.HOME.'/down/deldir'.$dir['id'].'" class="menudiv"><img src="'.HOME.'/images/delete.png" alt="*" /> Удалить папку</a>';
}
if ($start['k_page'] > 1)
echo str('?dir='.$dir['id'].'&', $start['k_page'], $start['page']); // Вывод страниц
}
}
##ноги
require_once ('../system/footer.php');
?>