<?
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';


$set['title']='Лучшие фото';
include_once '../sys/inc/thead.php';
title();
err();
aut();
$set['p_str'] = 5;
$k_rxn = mysql_num_rows(mysql_query("SELECT `id` FROM `gallery_foto` WHERE `rating` > '0'"));
$k_page = k_page($k_rxn,$set['p_str']);
$page = page($k_page);
$start = $set['p_str']*$page-$set['p_str'];
if ($k_rxn=='0')
{

echo 'Нет результатов';
}

$r_xn = mysql_query("SELECT * FROM `gallery_foto` WHERE `rating` > '0' ORDER BY `rating` DESC LIMIT $start, $set[p_str]");

while ($ank = mysql_fetch_array($r_xn))
{
if($num==1){ 
echo "<div class='page_foot'>"; 
$num=0;}
else{ 
echo "<div class='page_foot'>"; 
$num=1;}
 

echo "<img src='/foto/foto128/$ank[id].$ank[ras]' alt='$ank[name]' /><br />\n";
echo "</div>"; 
echo "<div class='gend'>";
echo "<a href='/foto/foto0/$ank[id].$ank[ras]' title='Скачать оригинал'>";
echo "Скачать оригинал";
echo " (".size_file(filesize(H.'files/gallery/foto/'.$ank['id'].'.jpg')).")";
echo "</a><br />\n";





echo "Голосов: $ank[rating]<br />\n";
echo "Формат $ank[ras]<br />\n";
echo "Описание: $ank[name]<br />\n";
echo "</div>"; 

}

if ($k_page>1)str("ratingfoto.php?",$k_page,$page);

include_once '../sys/inc/tfoot.php';
?>
