<?
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();

$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 'Нет результатов';
}

//$q=mysql_query("SELECT * FROM `gallery_foto` WHERE `id_gallery` = '$gallery[id]' ORDER BY `id` DESC LIMIT $start, $set[p_str]");

$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='menu_razd'>"; 
$num=1;}
 
echo "<img src='/foto/foto128/$ank[id].$ank[ras]' alt='$ank[name]' /><br />\n";
echo "<img src='/style/icons/konkurs16.png' alt='' class='icon'/>\n";
echo "Pейтинг: <b>$ank[rating]</b> %<br />\n";
echo "<img src='/style/icons/foto.png' alt='' class='icon'/>\n";
echo "Описание: $ank[name]<br />\n";
echo "</div>"; 

}

if ($k_page>1)str("rating.php?",$k_page,$page);
echo "<div class='foot'>"; 
echo "<a href='/foto/'>Альбомы</a> \n";
echo "</div>"; 
include_once '../sys/inc/tfoot.php';
?>
