File size: 2.36Kb
<?php
$title='Новые файлы';
require"../system/config.php";
require"../system/func.php";
require"../system/head.php";
require"../system/error.php";
echo'<div class="i">'.$title.'<br></div>';
switch($_GET['act']){
case 'go':
echo'<form action="new_day.php?" method="get">Файлы за последние<br />
<input name="day" type="text" size="2" maxleght="3" class="form" value="1"/>Дней<br />
<input type="submit" value="Смотреть" class="but"></form>';
break;
default:
$day=(int)$_GET['day'];
if($day==0 or $day==""){echo'Не корректный ввод'; require"../system/foot.php"; exit;}
$cif1=$day*24*60*60;
$cif2=time()-$cif1;
$num=10;
$total=mysql_result(mysql_query("SELECT COUNT(*) FROM `obmen_files` WHERE `kogda`>'$cif2'"),0);
$page = abs((int)$_GET['page']);
if($page < 0 || $page > $total) $page = 0;
if ($total < $page + 10) $end = $total;
else $end = $page + 10;
$sdata=mysql_query("SELECT * FROM `obmen_files` WHERE `kogda`>'$cif2' ORDER BY `id_file` DESC LIMIT $page,$num");
if($total==0){
echo'<div class="p">
За последние '.$day.' дня, не было новых файлов...<br>
</div>';
}else{ echo'<div class="i">Результатов '.$total.'<br></div>';
while($ofile=mysql_fetch_array($sdata)){
$dokuda='../files/'.$ofile['id_file'].'_'.$krsite.'.'.$ofile['format'];
$vesma=round(filesize($dokuda)/1024); #Вес файла
if($vesma==0){$vesma='Менее 1';}
echo'<div class="p">';
echo'<b>Имя:</b> <a href="'.$ofile['id_file'].'.info">'.$ofile['name'].'</a> <br><b>Описание: </b>'; if($ofile['opis']==""){echo'нет';}else{ echo mb_substr($ofile['opis'],0,200,'UTF-8');} echo'<br>
<small>Скачали: '.$ofile['loads'].' раз<br></small>
<a href="load.php?id_file='.$ofile['id_file'].'&'.$s.'">Скачать</a> ['.strtoupper($ofile['format']).'] ['.$vesma.'Кб]<br>
';
$koments=mysql_num_rows(mysql_query("select * from koments where type='obmen' and id_kogo='".$ofile['id_file']."'"));
$koments=mysql_num_rows(mysql_query("select * from koments where type='obmen' and id_kogo='".$ofile['id_file']."'"));
echo'<a href="../pages/koments.php?id_wm='.$ofile['id_file'].'&type=obmen">Комментарии</a> ['.$koments.']<br>
</div>';
}}
strpage($page, 10, $total, 'new_day.php','day='.$day.'&');
break;
} require"../system/foot.php";
?>