<div class="sex_chat">
Победители битвы №<?= $sexwars['id']?>
</div>
<?
$q = mysql_query("SELECT id_user, count(id) AS count
FROM sexwars_weapons
WHERE `id_tournament` = '$sexwars[id]' AND `sex` = '$sexwars[win]'
GROUP BY id_user
ORDER BY `count` DESC LIMIT 5"
;
$num = 0;
while($wars = mysql_fetch_assoc($q))
{
$num++;
?>
<div class="sex_menu">
<?= $num?>
<img src="images/medal-<?= $num?>.png" /> <?= user::nick($wars['id_user'], 1, 1, 1)?> <?= des2num($wars['count'], array('очко', 'очка', 'очков'))?>
</div>
<?
}
?>
<? } ?>
<?
if ($ifuser && !isset($ank['id']) && $sexwars['active'] == 1) {
?>
<div class="sex_menu">
<img src="images/fire-plus.png" /> <a href="?id=<?= $sexwars['id']?>&start">Вступить в битву</a>
</div>
<?
}
/**
* Чат битвы полов
*/
?>
<div class="sex_chat">
Чат «Война Полов»
</div>
<?
$k_post = mysql_result(mysql_query("SELECT COUNT(id) FROM `sexwars_chat` WHERE `id_tournament` = '$sexwars[id]'"
, 0);
$k_page = k_page($k_post, $set['p_str']);
$page = page($k_page);
$start = $set['p_str'] * $page - $set['p_str'];
if ($ifuser && isset($ank['id']) && $sexwars['active'] == 1)
{
?><form class="weapon_form" method="post" name="message" action="?id=<?= $sexwars['id']?>page=<?= $page . REPLY?>"><?
if (is_file(H.'style/themes/' . $set['set_them'] . '/altername_post_form.php')) {
include_once H.'style/themes/' . $set['set_them'] . '/altername_post_form.php';
} else {
echo $tPanel . '<textarea name="msg">' . $insert . '</textarea><br />';
}
?>
<input value="Отправить" type="submit" /> <a class="btn btn-link" href="?id=<?= $sexwars['id']?>">Обновить</a>
</form>
<?
}
?><table class="post"><?
if ($k_post == 0)
{
?>
<div class="mess" id="no_object">
Нет сообщений
</div>
<?
}
$q = mysql_query("SELECT * FROM `sexwars_chat` WHERE `id_tournament` = '$sexwars[id]' ORDER BY id DESC LIMIT $start, $set[p_str]"
;
$num = 0;
while ($post = mysql_fetch_assoc($q))
{
// Лесенка
?><div class="post-<?= $post['sex']?>"><?
$num++;
echo user::avatar($post['id_user'], 2) . user::nick($post['id_user'], 1, 1, 1);
if (isset($user) && $user['id'] != $post['id_user']) {
echo ' <a href="?id=' . $sexwars['id'] . '&=' . $page . '&response=' . $post['id_user'] . '">[*]</a> ';
}
echo ' (' . vremja($post['time']) . ') <br />';
echo output_text($post['msg']);
?>
<span class="pull-right">
<?
if (user_access('guest_delete')) {
?><a href="?id=<?= $sexwars['id']?>&delete=<?= $post['id']?>"><img src="/style/icons/delete.gif" alt="*" title="Удалить сообщение"></a><?
}
?>
</span>
</div>
<?
}
?></table><?
if ($k_page > 1) {
str('?id=' . $sexwars['id'] . '&', $k_page, $page);
}
?>
<div class="foot">
« <a href="index.php">Главная игры</a>
</div>
<?
include_once H.'sys/inc/tfoot.php';