<?php
session_start();
$mod_title="игра-арена";
$mod_status="on";
if($mod_status=="on")
{
function mod_body($auth,$adminauth)
{
$level="";
$guildc="";
$arenac="";
if($auth=="ok")
{
$mcl="";
$query = "SELECT * FROM users WHERE login='$_COOKIE[login]'";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$login,$pass,$mail,$reg,$class,$m,$h,$z,$s,$mon,$gold,$pms,$lvl,$ava,$ban,$online) = mysql_fetch_row($cat))
{
$mcl=$class;
$level=$lvl;
}
$query = "SELECT * FROM count";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$guild,$arena) = mysql_fetch_row($cat))
{
$guildc=$guild;
$arenac=$arena;
}
echo "
<img src='img/bo.png'> <a href='?do=game/char'>персонаж($level)</a>|<img src='img/bs.png'> <a href='?do=game/history'>история</a><br>
<br>
";
$_pg="0";
$ag="-10";
$_pg2="10";
if(!empty($_GET['_pg']))
{
$ag=$_GET['_pg']-"10";
$_pg=$_GET['_pg'];
$_pg2=$_GET['_pg']+"10";
}
$artest="";
$query = "SELECT * FROM arena WHERE name='$_COOKIE[login]' ORDER BY id DESC";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$name) = mysql_fetch_row($cat))
{
$artest=$name;
}
if($artest != "")
{
}
else
{
$query = "INSERT INTO arena (name) VALUES ('$_COOKIE[login]')";
$result = mysql_query ($query)
or die ("<span style='color:red'>ошибка арены!</span>");
echo "<span style='color:red'>Вы вошли на арену!</span><br>";
}
echo "
<a href='?do=game/arena/index'>[обновить]</a><br>
";
$query = "SELECT * FROM arena ORDER BY id DESC";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$name) = mysql_fetch_row($cat))
{
if($name==$_COOKIE['login'])
{
echo "<a href='?do=game/info&dox=$name'>$name</a> <span style='color:green'>[on]</span>-[<a href='?do=game/arena/exit'>выйти из арены</a>]<br>";
}
else
{
$ol="";
$query3 = "SELECT * FROM users WHERE login='$name'";
$cat3 = mysql_query ($query3);
if(!$cat3) exit (mysql_error());
while(list($id4,$login4,$pass4,$mail4,$reg4,$class4,$m4,$h4,$z4,$s4,$mon4,$gold4,$pms4,$lvl4,$ava4,$ban4,$online) = mysql_fetch_row($cat3))
{
if($online=="no")
{
$ol="<span style='color:red'>[off]</span>";
}
else
{
$ol="<span style='color:green'>[on]</span>";
}
}
echo "<a href='?do=game/info&dox=$name'>$name</a> $ol-[<a href='?do=game/arena/battle&login=$name'>напасть</a>]<br>";
}
}
echo "<br>";
include "data/buttons.auth.php";
}
else
{
echo "
Ошибка авторизации!<br>
";
}
}
}
else
{
function mod_body($auth,$adminauth)
{
echo "мод выключен администратором!<br>";
}
}
?>