Просмотр файла obmen/top_zag.php

Размер файла: 962B
<?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>';
$num=10;

$total=mysql_result(mysql_query("SELECT COUNT(*) `cn`, `avtor` FROM `obmen_files` GROUP BY `avtor` ORDER BY `cn`"),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 COUNT(*) `cn`, `avtor` FROM `obmen_files` GROUP BY `avtor` ORDER BY `cn` DESC LIMIT $page,$num"); if($total==0){
echo'<div class="p">
пусто<br>
</div>';
}else{
while($ofile=mysql_fetch_array($sdata)){
echo'<div class="p">'.nik_one($ofile['avtor']).' <a href="user_files.php?id='.$ofile['avtor'].'">['.$ofile['cn'].']</a></div>';


}}

strpage($page, 10, $total, "top_zag.php");
require"../system/foot.php";
?>