Файл: vsime.com/duels/inc/act_user_duels.php
Строк: 93
<?php
if (isset($_GET['id']))
{
$ank = profile(intval(@$_GET['id']));
if (@!$ank['id'])
{
$title .= ' - Ошибка!';
ex_head();
$error[] = 'Пользователь не найден.';
show_errors();
ex_foot();
}
} else {
if_user('is_reg');
$ank = $user;
}
$links_hist['name'] = "$ank[nick] / Дуэли";
$links_hist['link'] = "/duels/?act=user&id=$ank[id]";
$title .= ' - Мои дуэли';
ex_head();
$count_results = mysqli_result("SELECT COUNT(*) FROM `duels` WHERE `winer` != '0' AND `ok` = '1' AND (`id_user` = '$ank[id]' OR `id_ank` = '$ank[id]')");
$count_pages = count_pages($count_results);
$page = page();
$start = start_pages();
if (!$count_results)
{
echo "<div class='list_empty'>n";
echo "Нет законченых дуэлейn";
echo "</div>n";
}
$query = mysqli_query($dbi, "SELECT * FROM `duels` WHERE `winer` != '0' AND `ok` = '1' AND (`id_user` = '$ank[id]' OR `id_ank` = '$ank[id]') ORDER BY `time_end` DESC LIMIT $start, $config[rop]");
while ($post = mysqli_fetch_array($query))
{
$post['info'] = duel_info($post['id']);
if ($post['id_user']!=$ank['id'])
{
$uid = $post['id_user'];
$post['votes_ank'] = $post['info']['pollen_ank_m'] + $post['info']['pollen_ank_w'];
$post['votes_user'] = $post['info']['pollen_user_m'] + $post['info']['pollen_user_w'];
} else {
$uid = $post['id_ank'];
$post['votes_ank'] = $post['info']['pollen_user_m'] + $post['info']['pollen_user_w'];
$post['votes_user'] = $post['info']['pollen_ank_m'] + $post['info']['pollen_ank_w'];
}
if ($post['winer']==$ank['id'])
{
$post['result'] = pol_word($ank['id'], array("Выиграл", "Выигралa"));
$post['votes_subtract'] = $post['votes_ank'] - $post['votes_user'];
if ($post['votes_subtract'])$post['result'] .= " с отрывом у ".sklon_text($post['votes_subtract'], array('голос','голосa','голосов'));
} elseif ($post['winer']=='draw') {
$post['result'] = "Ничья";
} else {
$post['result'] = pol_word($ank['id'], array("Проиграл", "Проигралa"));
}
$ank2 = profile($uid);
echo "<div class='list'>n";
echo "<div class='left'>n";
show_avatar($ank2['id'], 'small');
echo "</div>n";
echo "<div class='overfl_hid'>n";
echo "Дуэль c ";
echo profile_icon($ank2['id']).profile_nick($ank2['id'], 1).profile_medal($ank2['id']);
echo "<br />n";
echo "$user[nick] набрал ".sklon_text($post['votes_ank'], array('голос','голосa','голосов'))."<br />n";
echo "Результат: $post[result]<br />n";
echo "<img src='/i/site/information.png' /> <a href='?act=info&id=$post[id]'>Подробности</a>n";
echo "</div>n";
echo "<div class='clear'></div>n";
echo "</div>n";
}
pages_show("?");
echo "<div class='foot'>n";
echo image_back()." <a href='$config[profile_page]?id=$ank[id]'>Назад</a>n";
echo "</div>n";
ex_foot();
?>