View file foto/rating.php

File size: 1.75Kb
<?
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();
aut();
err();


?>
<link rel="stylesheet" href="/foto/foto.css" type="text/css" />
<?
echo '<a class="link" href="/foto/"><img src="/style/icons/str2.gif"> Альбомы</a>';
$set['p_str'] = 1;
$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'];

	echo '<div class="nav1">';

if ($k_rxn=='0')
{
echo "<div class='err'>"; 
echo 'Нет результатов';
echo "</div>";
}

$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))
{


$f=$ank['id'];
$foto = mysql_fetch_assoc(mysql_query("SELECT * FROM `gallery_foto` WHERE `id` = '" . $f . "'  LIMIT 1"));
$gallery = mysql_fetch_assoc(mysql_query("SELECT * FROM `gallery` WHERE `id`='" . $foto['id_gallery'] . "'  LIMIT 1"));
$ank_p=get_user($gallery['id_user']);


echo '<a href="/foto/' . $ank_p['id'] . '/' . $gallery['id'] . '/' . $ank['id'] . '/" title="Посмотреть">';
echo " <img src='/foto/foto640/$ank[id].$ank[ras]' alt='*' style='width:128px; height:128px; '/></a></div>";
}

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

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