# |
Сайты из категории Top-100 |
Хосты |
Хиты |
В топ |
Из |
? |
';
$all = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `status` = '1' AND `ban` = '0' AND `hosts` > '0' AND `category` != '19'"));
if($all != 0){
$total = intval(($all-1)/20)+1;
$page = abs(intval($_GET['page']));
if($id or $id >= 1){
$result = mysql_query("SELECT `hosts` FROM `".$prefix."sait` WHERE `id` = '".$id."' AND `status` = '1' AND `ban` = '0' AND `hosts` > '0' AND `category` != '19' LIMIT 1;");
$row = mysql_fetch_array($result);
$host_today = $row['hosts'];
$topt = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `status` = '1' AND `ban` = '0' AND `category` != '19' AND `hosts`>= '".$host_today."' ORDER BY `hosts` DESC;"));
$page = ceil($topt/20);
}
if(empty($page) OR $page <= 0){
$page = 1;
}
if($page > $total){
$page = $total;
}
$past=intval($all/20);
$start=$page*20-20;
$top = mysql_query("SELECT * FROM `".$prefix."sait` WHERE `status` = '1' AND `ban` = '0' AND `hosts` > '0' AND `category` != '19' ORDER BY `hosts` DESC LIMIT ".$start.",20");
while($row = mysql_fetch_array($top)){
$start++;
echo ''.$start.' | ';
if($row['id'] == $id){
echo''.$row['url'].'';
} else {
echo' | '.$row['url'].'';
}
echo' '.$row['about'].' |
'.stats($row['hosts']).' |
'.stats($row['hits']).' |
'.$row['in'].' |
'.$row['out'].' | ';
if($row['mem'] == 0){echo' |
';
}else{echo' | ';}}
echo'';
navigation($all,20,$page,'index.php?',$total);
} else {
echo 'Сайтов в топе пока нет!
';}
}else{
$l = mysql_query("SELECT * FROM `".$prefix."rek` WHERE `status` = '1' ORDER BY `id` DESC");
echo '';
echo'';
$all = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `status` = '1' AND `ban` = '0' AND `hosts` > '0' AND `category` != '19'"));
if($all != 0){
$total = intval(($all-1)/$page_top)+1;
$page = abs(intval($_GET['page']));
if($id or $id >= 1){
$result = mysql_query("SELECT `hosts` FROM `".$prefix."sait` WHERE `id` = '".$id."' AND `status` = '1' AND `ban` = '0' AND `hosts` > '0' AND `category` != '19' LIMIT 1;");
$row = mysql_fetch_array($result);
$host_today = $row['hosts'];
$topt = mysql_num_rows(mysql_query("SELECT * FROM `".$prefix."sait` WHERE `status` = '1' AND `ban` = '0' AND `category` != '19' AND `hosts`>= '".$host_today."' ORDER BY `hosts` DESC;"));
$page = ceil($topt/$page_top);
}
if(empty($page) OR $page <= 0){
$page = 1;
}
if($page > $total){
$page = $total;
}
$past=intval($all/$page_top);
$start=$page*$page_top-$page_top;
$top = mysql_query("SELECT * FROM `".$prefix."sait` WHERE `status` = '1' AND `ban` = '0' AND `hosts` > '0' AND `category` != '19' ORDER BY `hosts` DESC LIMIT ".$start.",".$page_top."");
while($row = mysql_fetch_array($top)){
if($row['id'] == $id){
$start++;
echo ''.$start.'.
'.$row['url'].' ('.$row['hosts'].'/'.$row['hits'].'';
//echo ($row['hits'] > 999 ? round($row['hits']/1000).'К' : $row['hits']);
if($row['mem'] == 0){
echo') ';}else{echo'
) ';}
} else {
$start++;
echo '
'.$start.'. '.$row['url'].' ('.$row['hosts'].'/'.$row['hits'].'';
//echo ($row['hits'] > 999 ? round($row['hits']/1000).'К' : $row['hits']);
if($row['mem'] == 0){
echo') ';}else{echo'
) ';}}
echo'
'.$row['about'].'
';
echo '
Ушло на сайт: '.$row['out'].'
';
}
echo'';
navigation($all,$page_top,$page,'index.php?',$total);
} else {
echo 'Сайтов в топе пока нет!
';}
echo'';
echo '';
}
?>