File size: 1.48Kb
<?php
include '../system/start.php';
$title.='Загрузки| Новинки';
//панель навигации
$page.='<div class="linker"><a href="/">главная</a>
| <a href="/dc/">загрузки</a>| новинки</div>
<div class="lister">';
//файлы
$all=mysql_result(mysql_query("SELECT `value` FROM `counter` WHERE `name`='dc';"),0);
if(isset($_GET[p])) $pag=fint($_GET[p]);
else $pag=1;
if($pag==0) $pag=1;
$start=$pag*$user[onpage]-$user[onpage];
if($user[onpage]>$all) $user[onpage]=$all;
$sumpage=@ceil($all/$user[onpage]);
$page.='<div class="margin5">';
$ldata=mysql_query("SELECT * FROM `dc_files` ORDER BY `time` DESC LIMIT $start,$user[onpage];");
while ($data=@mysql_fetch_array($ldata)){
$ddata=mysql_fetch_array(mysql_query("SELECT * FROM `dc_dir` WHERE `id`='$data[d]';"));
//данные $d
$durl=preg_replace('~(.*)/~iu','',preg_replace('~\/$~','',$ddata[url]));
$page.='<div class="border"><a href="/dc/'.$ddata[id].'-'.$durl.'/'.$data[id].'-'.$data[url].'/">'.$data[name].'</a> ('.date('H:i d.m',$data[time]).')</div>';
$k=0;
$text='';
for(;;){
if($ddata[in]==0) break;
$ard=mysql_fetch_array(mysql_query("SELECT * FROM `dc_dir` WHERE `id`='$ddata[in]';"));
$mas[$k]=$ard[name];
$ddata[in]=$ard[in];
$k++;
}
for($j=(count($mas)-1);$j>=0;$j--){
$text.='| '.$mas[$j];
}
$page.='<div class="small">'.$text.'| '.$ddata[name].'</div>';
}
$page.='</div></div>'.pager();
include '../system/pagegen.php';
?>