<?
include '../config.php';
include '../func.php';

head();
aut();
ban();
////////////////////////////////////////
mysql_query("UPDATE `profile` SET `online` = 'fo' WHERE `id` = '".$id_session."'");



echo head . "Обменник файлов /  <b>Новые файлы</b>" . div;   
echo katalog;

$time=time()-3600*24;

$all = mysql_result(mysql_query("SELECT count(*) FROM `fo_fil` WHERE `date` > '".$time."' "), 0);

if ( $all == 0 ) {
    
    echo 'Файлы еще не загружены';
} else {

 $onpage = 5;
 $allpage = ceil($all/$onpage);
 $this_page = (isset($_GET['p'])) ? intval($_GET['p']) : 1 ;
 if($this_page < 1 || $this_page > $allpage)$this_page = 1;
 $start = $this_page*$onpage - $onpage;
$result = mysql_query("SELECT * FROM `fo_fil` WHERE `date` > '".$time."' order by date desc  limit ".num($start).",".num($onpage)."");
while($file = mysql_fetch_assoc($result)){

if ( $cat['tip'] == 1 ) {
    echo "<img src=\"../pict.php?file=newobmen/files/".$file['file']."\" alt=\".\" /><br/>";
} else {

if ( !empty($file['screen']) ) {
    
    echo "<img src=\"../pict.php?file=newobmen/screen/".$file['screen']."\" alt=\".\" /><br/>";
} else {
    echo 'Без скриншота<br/ >';
}

}
$f = 'files/'.$file['file'];
echo '<a href="view.php?file='.$file['id'].'">'.$file['name'].'</a> ('.size(filesize($f)).')<hr>';
}
    echo link1 . '<b>Страницы:</b> ';
    navigation($allpage,"new.php?p={p}",1,1);
    echo div;

}




echo div;
/////////////////////////////////////////

navig();
foot();
?>