Файл: setk/plugins/comedy/user.battle.php
Строк: 110
<?
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';
only_reg();
if (isset($_GET['id']))
$ank = get_user(intval($_GET['id']));
if (!isset($_GET['id']) || $ank['id'] == 0)
$ank = $user;
$info = mysql_fetch_assoc(mysql_query("SELECT * FROM `comedy_info` WHERE `id_user` = '".$ank['id']."' LIMIT 1"));
$set['title'] = 'Битвы - ' . user::nick($ank['id'], 0); // заголовок страницы
include_once '../../sys/inc/thead.php';
title();
aut(); // форма авторизации
echo '<div class="foot">';
echo '<img src="/style/icons/str2.gif" alt="S" /> <a href="index.php">Comedy Battle</a> | <b>Битвы ' . user::nick($ank['id']) . '</b>';
echo '</div>';
echo '<div class="mess">';
echo '<b>Cтатистика ' . user::nick($ank['id'], 0) . ':</b><br />';
echo 'Битв всего [' . mysql_result(mysql_query("SELECT COUNT(id) FROM `comedy_battle` WHERE `ban` = '0' AND (`id_user` = '$ank[id]' OR `id_protivnik` = '$ank[id]')"),0) . ']<br />';
echo 'Побед [' . $info['win'] . ']<br />';
echo 'Поражений [' . $info['lesions'] . ']<br />';
echo 'Рейтинг [' . $info['rating'] . ']<br />';
echo '</div>';
$k_post = mysql_result(mysql_query("SELECT COUNT(id) FROM `comedy_battle` WHERE `ban` = '0' AND (`id_user` = '$ank[id]' OR `id_protivnik` = '$ank[id]')"),0);
if ($k_post == 0)
{
echo '<div class="mess">';
echo 'Пользователь еще не учавствовал в баттлах';
echo '</div>';
}
$set['p_str'] = 1;
$k_page = k_page($k_post,$set['p_str']);
$page = page($k_page);
$start = $set['p_str']*$page-$set['p_str'];
$q = mysql_query("SELECT * FROM `comedy_battle` WHERE `ban` = '0' AND (`id_user` = '$ank[id]' OR `id_protivnik` = '$ank[id]') ORDER BY `id` DESC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_assoc($q))
{
if ($post['count_user'] == 10 || $post['count_protivnik'] == 10)
{
echo '<div class="mess">';
echo '<center><b>Победитель ' . ($post['count_user'] == 10 ? user::avatar($post['id_user']) . user::nick($post['id_user']) : user::avatar($post['id_protivnik']) . user::nick($post['id_protivnik'])). '</b></center>';
echo '</div>';
}
echo '<div class="nav1">';
echo user::avatar($post['id_user'], 0) . user::nick($post['id_user']) . ' <a style="color:red" href="user.battle.php?id=' . $post['id_user'] . '">[!]</a><br />';
echo output_text($post['text_user']) . '<br />';
echo '<b><font color="green">Голосов: [<font color="red">' . $post['count_user'] . '</font>]</font></b><br />';
echo '</div>';
echo '<div class="mess">';
echo '<center><b>VS</b></center>';
echo '</div>';
echo '<div class="nav2">';
echo user::avatar($post['id_protivnik'], 0) . user::nick($post['id_protivnik']) . ' <a style="color:red" href="user.battle.php?id=' . $post['id_protivnik'] . '">[!]</a><br />';
echo output_text($post['text_protivnik']) . '<br />';
echo '<b><font color="green">Голосов: [<font color="red">' . $post['count_protivnik'] . '</font>]</font></b><br />';
echo '</div>';
}
if ($k_page>1)str('?id=' . $ank['id'] . '&',$k_page,$page); // Вывод страниц
echo '<div class="foot">';
echo '<img src="/style/icons/str2.gif" alt="S" /> <a href="index.php">Comedy Battle</a> | <b>Битвы ' . user::nick($ank['id']) . '</b>';
echo '</div>';
include_once '../../sys/inc/tfoot.php';
?>