Онлайн_Маньяк, На
require('download/includes/functions.php');
$old = time() - 259200;
$sql_down = '';
$max_file = 5; //// количество файлов
if ($id) {
$title_pages = functions::checkout(mb_substr($res_down_cat['rus_name'], 0, 30));
$textl = 'Новые файлы: ' . (mb_strlen($res_down_cat['rus_name']) > 30 ? $title_pages . '...' : $title_pages);
$sql_down = ' AND `dir` LIKE \'' . ($res_down_cat['dir'] . '/' . $res_down_cat['name']) . '%\' ';
}
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `down_files` WHERE `type` = '2' AND `time` > $old $sql_down"), 0);
if ($total) {
$req_down = mysql_query("SELECT * FROM `down_files` WHERE `type` = '2' AND `time` > $old $sql_down ORDER BY `time` DESC LIMIT $max_file");
while ($res_down = mysql_fetch_assoc($req_down)) {
echo ($i % 2) ? '<div class="list2">' : '<div class="list1">';
$down = display_file($res_down);
$down = str_replace('index.php?act=view','download/index.php?act=view', $down);
$down = str_replace('index.php?act=comms','download/index.php?act=comms', $down);
echo $down;
echo '</div>';
++$i;
}
} else {
echo '<div class="menu">Новыx файлов нет!</div>';
}