<?
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';

$set['title']='Обменник - Новые';
include_once '../sys/inc/thead.php';
title();
err();
aut(); // форма авторизации

$k_new = mysql_result(mysql_query("SELECT COUNT(*) FROM `obmennik_files` WHERE `time` > ''"), 0);

$k_page = k_page($k_new,$set['p_str']);
$page = page($k_page);
$start = $set['p_str']*$page-$set['p_str'];


echo "<b>Раздел: <a href='/obmen/'>Обменник файлами [в категории]</a></b><br>";
echo "Новые файлы:</b><br><br>";



if ($k_new==0)
{

echo "   <tr>\n";
echo "  <td class='p_t'>\n";
echo "Нет новых файлов\n";
echo "  </td>\n";
echo "   </tr>\n";

}

$q = mysql_query("SELECT * FROM `obmennik_files` WHERE `time` > '' ORDER BY time DESC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_array($q))
{


$ras=$post['ras'];
$file=H."sys/obmen/files/$post[id].dat";
$name=$post['name'];
$size=$post['size'];

echo "   <tr>\n";
if ($set['set_show_icon']==2){
echo "  <td class='icon48' rowspan='2'>\n";
include 'inc/icon48.php';
echo "  </td>\n";
}
elseif ($set['set_show_icon']==1)
{
echo "  <td class='icon14'>\n";

echo "  </td>\n";
}

if($num==1){ 
echo "<div class='rowdown'>"; 
$num=0;
}else{ 
echo "<div class='rowup'>"; 
$num=1;}
include 'inc/icon14.php';
$dir = mysql_fetch_array(mysql_query("SELECT * FROM `obmennik_dir` WHERE `id` = '$post[id_dir]' LIMIT 1"));

if ($set['echo_rassh']==1)$ras=".$post[ras]";else $ras=NULL;

echo "<a href='/obmen$dir[dir]$post[name].$post[ras]?showinfo'>$post[name]$ras</a><br />\n";

if ($set['set_show_icon']==1)
echo " $post[opis]";echo "  </br>\n";


echo ' Папка: <a href="/obmen'.$dir['dir'].'?">'.$dir['name'].'</a>';
echo "</div>\n";
echo "  </td>\n";
echo "   </tr>\n";

}

echo '</table>'."\n";

if ($k_page>1)str('?',$k_page,$page); // Вывод страниц

echo "<div class='foot'>";
echo "&laquo;<a href='index.php'>Обменник файлами [в категории]</a><br />\n";
echo "</div>\n";

include_once '../sys/inc/tfoot.php';
?>