<?php
$corec = $_SERVER['DOCUMENT_ROOT'];
require_once $corec.'/sys/inc/core.php';
$set['title']='Мои рейтинг';
require_once $corec.'/sys/inc/thead.php';
title();
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `ava_resu` WHERE `ank` = '".$user['id']."'"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];


if ($k_post==0){msg('За вашу страничку еще не голосовали<br/>');}


$q=mysql_query("
SELECT `ava_resu`.*, `user`.`nick`   
FROM `ava_resu` 
LEFT JOIN `user` ON `user`.`id` = `ava_resu`.`user` 
WHERE `ava_resu`.`ank` = '".$user['id']."' 
ORDER BY `ava_resu`.`stamp` DESC 
LIMIT ".$start.", ".$set['p_str']."");
while ($post = mysql_fetch_array($q))
{

if($num==1){ 
echo "<div class='prof'>"; 
$num=0;
}else{ 
echo "<div class='prof'>"; 
$num=1;}


echo "".online($post['user'])."\n";
echo "<a href='/info.php?id=$post[user]'>$post[nick]</a>\n";
echo "<font color='#ff0000'><b>+$post[var]</b></font>\n";
echo "(".$post['stamp'].")<br/>\n";
?></div><?

}
if ($k_page>1)str("rating_ym.php?",$k_page,$page);
?></div><?
require_once $corec.'/sys/inc/tfoot.php';
?>