Файл: test.masteram.us/lib/inc/dir.php
Строк: 76
<?
if ($l=='/')
$set['title']='Библиотека'; // заголовок страницы
else $set['title']='Библиотека - '.$dir_id['name']; // заголовок страницы
$_SESSION['page']=1;
include_once '../sys/inc/thead.php';
title();
if ($l!='/')include 'inc/upload_act.php';
include 'inc/admin_act.php';
err();
if ($l!='/'){
echo "<div class='foot'>";
echo "<a href='/lib/'>Библиотека</a> > ".lib_path($l)."<br />n";
echo "</div>n";
}
echo "<table class='post'>n";
$list=null;
$q=mysql_query("SELECT * FROM `lib_dir` WHERE `dir_osn` = '/$l' OR `dir_osn` = '$l/' OR `dir_osn` = '$l' ORDER BY `name`,`num` ASC");
while ($post = mysql_fetch_assoc($q))
{
$list[]=array('dir'=>1,'post'=>$post);
}
$q=mysql_query("SELECT * FROM `lib_files` WHERE `id_dir` = '$id_dir' ORDER BY `time` DESC");
while ($post = mysql_fetch_assoc($q))
{
$list[]=array('dir'=>0,'post'=>$post);
}
$k_post=sizeof($list);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
if ($k_post==0)
{
echo " <tr>n";
echo " <td class='p_t'>n";
echo "Папка пустаn";
echo " </td>n";
echo " </tr>n";
}
for ($i=$start;$i<$k_post && $i<$set['p_str']*$page;$i++)
{
if ($list[$i]['dir']==1) // папка
{
$post=$list[$i]['post'];
echo " <tr>n";
if($num==1){
echo "<div class='rowdown'>";
$num=0;
}else{
echo "<div class='rekl'>";
$num=1;}
if ($set['set_show_icon']==2){
echo "<img src='/style/themes/$set[set_them]/loads/14/dir.png' alt='' />n";
}
elseif ($set['set_show_icon']==1){
echo "<img src='/style/themes/$set[set_them]/loads/14/dir.png' alt='' />n";
}
echo "<a href='/lib$post[dir]'>$post[name]</a>";
$k_f=0;
$k_n=0;
$q3=mysql_query("SELECT * FROM `lib_dir` WHERE `dir_osn` like '$post[dir]%'");
while ($post2 = mysql_fetch_assoc($q3))
{
$k_f=$k_f+mysql_result(mysql_query("SELECT COUNT(*) FROM `lib_files` WHERE `id_dir` = '$post2[id]'"),0);
$k_n=$k_n+mysql_result(mysql_query("SELECT COUNT(*) FROM `lib_files` WHERE `id_dir` = '$post2[id]' AND `time` > '".(time()-86400)."'",$db), 0);
}
$k_f=$k_f+mysql_result(mysql_query("SELECT COUNT(*) FROM `lib_files` WHERE `id_dir` = '$post[id]'"),0);
$k_n=$k_n+mysql_result(mysql_query("SELECT COUNT(*) FROM `lib_files` WHERE `id_dir` = '$post[id]' AND `time` > '".(time()-86400)."'",$db), 0);
if ($k_n==0)$k_n=NULL;
else $k_n='/+'.$k_n;
echo " ($k_f$k_n)<br />n";
}
else // файл
{
$post=$list[$i]['post'];
$ras='txt';
$file=H."sys/lib/stats/$post[id].txt.gz";
$name=$post['name'];
$size=$post['size'];
echo "<div class='rekl'>n";
if ($set['set_show_icon']==2){
//include 'inc/icon48.php';
}
elseif ($set['set_show_icon']==1)
{
include 'inc/icon14.php';
}
echo "<img src='/style/icons/blogs.gif' alt='' class='icon'/>n";
echo " <a href='/lib$dir_id[dir]$post[name].htm'><b>$post[name]</b></a><br />n";
include 'inc/opis.php';
echo "</div>n";
}
}
echo "</div>n";
if ($k_page>1)str('?',$k_page,$page); // Вывод страниц
if ($l!='/'){
echo "<div class='foot'>";
echo "<a href='/lib/'>Библиотека</a> > ".lib_path($l)."<br />n";
echo "</div>n";
}
if ($l!='/')include 'inc/upload_form.php';
include 'inc/admin_form.php';
?>