Файл: modules/share/index.php
Строк: 45
<?php
if(isset($user)) {
$locate = 'in_share';
$title = $lang->word('share');
require_once(SYS.'/view/header.php');
$tpl->div('title', $lang->word('share'));
$tpl->div('post','Новые: <a href="/share/new_files/">'. $lang->word('user_files').'</a> | '.' <a href="/share/search">'. $lang->word('search') .'</a>'.($user['level'] >=6 ? ' | <a href="/share/add_dir/">'. $lang->word('create_dir') .'</a><br/>' : NULL));
$share_r = $db->query("SELECT * FROM `share`")->rowCount();
if($share_r == 0) {
echo $tpl->div('menu', $lang->word('no_folders'));
}
else {
$share_q = $db->query("SELECT * FROM `share` ORDER BY name");
while($share = $share_q->fetch()) {
$num = $db->query("SELECT * FROM `share_c` WHERE `rid` = '". $share['id'] ."'")->rowCount();
if ($num) {
$q = $db->query("SELECT * FROM `share_c` WHERE `rid` = '". $share['id'] ."'");
$i=0;
$plps = 0;
while ($a = $q->fetch()) {
$n = $db->query("SELECT * FROM `share_files` WHERE `cat_id` = '". $a['id'] ."'")->rowCount();
$plp = $db->query("SELECT * FROM `share_files` WHERE `cat_id` = '". $a['id'] ."' and `time`>'".(time()-60*60*24)."'")->rowCount();
$plps = ($plps+$plp);
$i = ($i+$n);
}
$num = $i;
} else {$num = 0;}
if ($plps) {$plps = '<font color="red">+'.$plps.'</font>';} else {$plps = '';}
$tpl->div('menu', img('folder.png') . ' <a href="/share/'. $share['id'] .'/">'. $share['name'] .'</a> ['.$num.'] '.$plps.' ' . ($user['level'] >= 6 ? ' <span style="float:right">( <a href="/share/delete_dir/'.$share['id'].'/">'.img('delete_11.png').'</a> | <a href="/share/edit_dir/'.$share['id'].'/">'.img('edit_11.png').'</a> )</span>' : NULL) .'<br/>
<span style="font-size: xx-small;">'. $share['desc'] .'</span>');
}
}
$tpl->div('block',HICO .' <a href="/">'. $lang->word('home') .'</a>');
require_once(SYS.'/view/footer.php');
} else {
$title = 'Загруз-центр';
require_once(SYS.'/view/header.php');
$tpl->div('title', 'Загруз-центр');
$tpl->div('menu', '<center>Загруз-центр доступен только зарегистрированным пользователям!</center>');
$tpl->div('block',HICO .'<a href="/">'. $lang->word('home').'</a>');
require_once(SYS.'/view/footer.php');
}
?>