File size: 3.18Kb
<?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;
if(isset($_GET['st'])){$st=cifry($_GET['st']);}else{$st=0;}
if(isset($_POST['str'])){$str=cifry($_POST['str']);}else{$str=0;}
if(!empty($str)){$st=$str*10-10;}
if(empty($st) or $st<0){$st=0;}
$num=10;
$adata=mysql_query("select * from load_files where dobav>'$cif2'");
$sdata=mysql_query("select * from load_files where dobav>'$cif2' order by id_file desc limit $st,$num");
$kol=mysql_num_rows($adata);
if($st>$kol){echo'Не верный номер страници'; require"../system/foot.php"; exit;}
if($kol==0){
echo'<div class="p">
За последние '.$day.' дня, не было новых загрузок...<br>
</div>';
}else{ echo'<div class="i">Результатов '.$kol.'<br></div>';
while($ofile=mysql_fetch_array($sdata)){
$dokuda='../down/'.$ofile['put'].'/'.$ofile['nastna'].'.'.$ofile['format']; #Путь до файла
$vesma=round(filesize($dokuda)/1024); #Вес файла
if($vesma==0){$vesma='Менее 1';}
echo'<div class="p">';
if(empty($ofile['name'])){
$ofile['name']=$ofile['nastna'].'.'.$ofile['format'];
}
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_load='.$ofile['id_file'].'&'.$s.'">Скачать</a> ['.strtoupper($ofile['format']).'] ['.$vesma.'Кб]<br>
';
$koments=mysql_num_rows(mysql_query("select * from koments where type='downs' and id_kogo='".$ofile['id_file']."'"));
$koments=mysql_num_rows(mysql_query("select * from koments where type='downs' and id_kogo='".$ofile['id_file']."'"));
echo'<a href="../pages/koments.php?id_wm='.$ofile['id_file'].'&type=downs&'.$s.'">Комментарии</a> ['.$koments.']<br>
</div>';
}}
if($st!=0){
echo'<div class="p"><img src="../design/default/act.gif" alt="-"> <a href="new_day.php?st='.($st-$num).'&day='.$day.'&'.$s.'">Назад</a><br></div>';
}
if($kol>$st+$num){
echo'<div class="p"><img src="../design/default/act.gif" alt="-"> <a href="new_day.php?st='.($st+$num).'&day='.$day.'&'.$s.'">Вперед</a><br></div>';}
if($kol>10){
echo'<div class="p">
<form action="new_day.php?day='.$day.'&'.$s.'" method="post">
На страницу (1-'.ceil(($kol/10)).'):<br>
<input type="text" name="str" maxlength="4" class="form" size="3" value="'.ceil(($kol/10)).'">
<input type="submit" value="ОК" class="but"><br>
</form></div>';}
break;
} require"../system/foot.php";
?>