Файл: www/inc/interface.php
Строк: 276
<?php
echo '<title>'.$titlestr.'</title>';
if(isset($_SESSION['auth']) && $_SESSION['auth']==1){
if($_SERVER['SCRIPT_NAME']!="/.php"){
}
/*Закоментировано!
echo '
<div class="msg" style="padding-right:0px;padding-left:0px;">
<center>
<a href="/character.php">Перс.</a>
|
<a href="/inventory.php">Инв.</a>
|
<a href="/quests.php">Днев.</a>
|
<a href="/party.php">Пати</a>
|
<a href="/skills.php">Способн.</a>
|
<a href="/location.php">Лока.</a>';
if ($account['status']=="gm"){
echo '
|
<a href="/admin.php">Админка</a>
';
}
echo '
</center>
';
Конец коментирования!*/
@$hpe['width']=round(100/($account['max_hp']/$account['hp']));
@$mpe['width']=round(100/($account['max_mp']/$account['mp']));
if ($account['lvl']<50){
@$expe['width']=round(100/(mysql_result(mysql_query("SELECT `exp` FROM `lvl` WHERE `id`='".$account['lvl']."'+'1'"),0)/$account['exp']));
}
echo '<div class="bars">';
echo '
<div style="padding:0px 0px 0px 5px;"><b color="black">:: '.$account['name'].' ::</b> '.
(mysql_result(mysql_query("SELECT COUNT(*) FROM `msg_list` WHERE `acount`='".$account['id']."' AND
`msg` LIKE '%Уровень повышен%'
"),0)?'<img src="style/images/up.png">':null).$account['lvl'].
' ур.</div>';
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `effect` WHERE (`account`='".$account['id']."' AND `target`='0') OR (`target_type`='user' AND `target`='".$account['id']."')"),0)){
$qrea=mysql_query("SELECT * FROM `effect` WHERE (`account`='".$account['id']."' AND `target`='0') OR (`target_type`='user' AND `target`='".$account['id']."')");
while($resea=mysql_fetch_assoc($qrea)){
$skillea=mysql_fetch_assoc(mysql_query("SELECT * FROM `skill` WHERE
`id`='".$resea['skill']."'"));
echo '<img src="/data/img/skill/'.$skillea['icon'].'.jpg" height="10px" width="10px" title="'.$skillea['about'].'">';
}
}
echo '
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" width="50%" style="padding-right:5px;">
<div style="height:14px;opacity:0.5;margin-bottom:2px;border-radius:5px 0px 5px 0px;
-moz-border-radius:0px 5px 0px 5px;
-webkit-border-radius:0px 5px 0px 5px;
border:2px solid black;">
<div style="background:;height:14px;padding-left:5px;float:left;font-size:11px;color:white;padding-left:10px;border-radius:5px 5px 5px 5px;
-moz-border-radius:0px 5px 0px 5px;
-webkit-border-radius:0px 5px 0px 5px;
"><center>'.$account['hp'].'/'.$account['max_hp'].'</center></div>';
echo '<div style="height:14px;border-radius:5px 0px 5px 0px;
-moz-border-radius:0px 5px 0px 5px;
-webkit-border-radius:0px 5px 0px 5px;
width:'.$hpe['width'].'%;background:';
if ($hpe['width'] >= 90){
echo '#32CD32';
}elseif($hpe['width'] <= 89 AND $hpe['width'] >=80){
echo '#9ACD32';
}elseif($hpe['width'] >= 70 AND $hpe['width'] <=79){
echo '#FFD700';
}elseif($hpe['width'] >= 60 AND $hpe['width'] <=69){
echo '#FFA500';
}elseif($hpe['width'] >= 50 AND $hpe['width'] <=59){
echo '#FF8C00';
}elseif($hpe['width'] >= 40 AND $hpe['width'] <=49){
echo '#FF4500';
}elseif($hpe['width'] >= 30 AND $hpe['width'] <=39){
echo '#D2691E';
}elseif($hpe['width'] >= 20 AND $hpe['width'] <=29){
echo '#FF0000';
}elseif($hpe['width'] >= 10 AND $hpe['width'] <=19){
echo '#B22222';
}elseif($hpe['width'] >=1 AND $hpe['width'] <= 9){
echo '#A52A2A';
}
echo ';">';
echo '</div></div>
</td><td valign="top" width="50%">
<div style="height:14px;opacity:0.5;margin-bottom:2px;border-radius:0px 5px 0px 5px;
-moz-border-radius:0px 5px 0px 5px;
-webkit-border-radius:0px 5px 0px 5px;
border:2px solid black;">
<div style="font-align:right;height:14px;padding-left:10px;float:left;font-size:11px;border-radius:0px 5px 0px 5px;
-moz-border-radius:0px 5px 0px 5px;
-webkit-border-radius:0px 5px 0px 5px;
color:white;"><center>'.$account['mp'].'/'.$account['max_mp'].'</center></div>
<div style="height:14px;width:'.$mpe['width'].'%;background:#7B68EE;border-radius:0px 5px 0px 5px;
-moz-border-radius:0px 5px 0px 5px;
-webkit-border-radius:0px 5px 0px 5px;
"></div></div>
</td>
</tr>
</table>';
if ($account['lvl']<50){
echo '<div style="height:5px;opacity:0.5;margin-bottom:2px;border:2px solid black;">
<div style="height:5px;width:'.$expe['width'].'%;background:';
if ($expe['width'] >= 90){
echo '#32CD32';
}elseif($expe['width'] <= 89 AND $expe['width'] >=80){
echo '#9ACD32';
}elseif($expe['width'] >= 70 AND $expe['width'] <=79){
echo '#FFD700';
}elseif($expe['width'] >= 60 AND $expe['width'] <=69){
echo '#FFA500';
}elseif($expe['width'] >= 50 AND $expe['width'] <=59){
echo '#FF8C00';
}elseif($expe['width'] >= 40 AND $expe['width'] <=49){
echo '#FF4500';
}elseif($expe['width'] >= 30 AND $expe['width'] <=39){
echo '#D2691E';
}elseif($expe['width'] >= 20 AND $expe['width'] <=29){
echo '#FF0000';
}elseif($expe['width'] >= 10 AND $expe['width'] <=19){
echo '#B22222';
}elseif($expe['width'] >=1 AND $expe['width'] <= 9){
echo '#A52A2A';
}
echo ';"></div></div>
';
}
echo '<center>';
if (!$account['battle'] && !$account['duel_battle']){
echo ($_SERVER['PHP_SELF']!='/index.php'?'<a class="osite" href="index.php?">Главная</a>':null);
echo ' <a class="osite" href="location.php" title="Локация">Локация</a>'.
($account['party'] && $_SERVER['PHP_SELF']!='/party.php'?' <a class="osite" href="party.php" title="Отряд">Отряд</a>':null).
($account['clan'] && $_SERVER['PHP_SELF']!='/myclan.php'?' <a class="osite" href="myclan.php" title="Мой клан">Мой клан</a>':null);
}
echo '</center>';
echo '</div>';
if (isset($_GET['party'])){
if ($_GET['party']=='ok'){
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `party_add` WHERE `user`='".$account['id']."'"),0)){
$partyy=mysql_result(mysql_query("SELECT `party` FROM `party_add` WHERE `user`='".$account['id']."'"),0);
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `party` WHERE `id`='".$partyy."'"),0)){
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `account` WHERE `party`='".$partyy."'"),0)<5){
mysql_query("UPDATE `account` SET `party`='".$partyy."' WHERE `id`='".$account['id']."'");
mysql_query("DELETE FROM `party_add` WHERE `user`='".$account['id']."'");
header("Location: /party.php?");
exit;
}else{
echo '<div class="help">В группе недостаточно места!</div>';
}
}else{
echo '<div class="help">Приглаение недействительно!</div>';
}
}else{
echo '<div class="help">Приглаение недействительно!</div>';
}
}elseif($_GET['party']=='no'){
@mysql_query("DELETE FROM `party_add` WHERE `user`='".$account['id']."'");
header("Location: ?");
exit;
}else{
header("Locaton:?");
exit;
}
}
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `party_add` WHERE `user`='".$account['id']."'"),0)){
$partynew=mysql_fetch_assoc(mysql_query("SELECT * FROM `party_add` WHERE `user`='".$account['id']."'"));
if (time()-$partynew['time']>360){
mysql_query("DELETE FROM `party_add` WHERE `id`='".$partynew['id']."'");
}else{
echo '<div class="help"><a href="?char.php?id='.$partynew['account'].'">'.mysql_result(mysql_query("SELECT `name` FROM `account` WHERE `id`='".$partynew['account']."'"),0).'</a> приглашает вас в группу</div><a class="link" href="?party=ok">Вступить</a><a class="link" href="?party=no">Отклонить</a>';
}
}
if(isset($_GET['duele']) && $_GET['duele']=='ok'){
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `duel_add` WHERE `account`='".$account['id']."'"),0)){
$duelee=mysql_fetch_assoc(mysql_query("SELECT * FROM `duel_add` WHERE `account`='".$account['id']."'"));
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `account` WHERE `id`='".$duelee['user']."' AND '".time()."'-`last_active` <'360'"),0)){
$_usr=mysql_fetch_assoc(mysql_query("SELECT * FROM `account` WHERE `id`='".$duelee['user']."' AND '".time()."'-`last_active` <'360'"));
if (!$_usr['battle'] && !$_usr['duel_battle']){
if ($_usr['x']==$account['x'] AND $_usr['y']==$account['y']){
mysql_query("DELETE FROM `duel_add` WHERE `id`='".$duelee['id']."'");
mysql_query("INSERT INTO `battle` SET `x`='".$account['x']."',`y`='".$account['y']."',`x1`='".$account['x1']."',`y1`='".$account['y1']."'") or die(mysql_error());
$batele=mysql_insert_id();
mysql_query("UPDATE `account` SET `duel_battle`='".$batele."',`battle_attack`='".$duelee['user']."',`battle_target_type`='user' WHERE `id`='".$account['id']."'");
mysql_query("UPDATE `account` SET `duel_battle`='".$batele."',`battle_attack`='".$account['id']."',`battle_target_type`='user' WHERE `id`='".$duelee['user']."'");
mysql_query("DELETE FROM `battle_log` WHERE `acount`='".$account['id']."'");
mysql_query("DELETE FROM `battle_log` WHERE `acount`='".$duelee['user']."'");
mysql_query("INSERT INTO `battle_log`(`acount`,`mess`)VALUES('".$account['id']."','<div class="help">Дуэль началась</div>')");
mysql_query("INSERT INTO `battle_log`(`acount`,`mess`)VALUES('".$duelee['user']."','<div class="help">Дуэль началась</div>')");
header("Location: ?");
exit;
}else{
mysql_query("DELETE FROM `duel_add` WHERE `id`='".$duelee['id']."'");
echo '<div class="help">Вызов не действителен</div>';
}
}else{
mysql_query("DELETE FROM `duel_add` WHERE `id`='".$duelee['id']."'");
echo '<div class="help">Вызов не действителен</div>';
}
}else{
mysql_query("DELETE FROM `duel_add` WHERE `id`='".$duelee['id']."'");
echo '<div class="help">Вызов не действителен</div>';
}
}
}elseif(isset($_GET['duele']) && $_GET['duele']=='no'){
@$duele=mysql_fetch_assoc(mysql_query("SELECT * FROM `duel_add` WHERE `account`='".$account['id']."'"));
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `duel_add` WHERE `account`='".$account['id']."'"),0)){
mysql_query("DELETE FROM `duel_add` WHERE `id`='".$duele['id']."'");
mysql_query("INSERT INTO `msg_list` SET `msg`='<div class="help">Дуэль отменена</div>',`acount`='".$duele['user']."'");
echo '<div class="help">Дуэль отменена</div>';
}
}
if (isset($_GET['clan'])){
if ($_GET['clan']=='ok'){
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `clan_add` WHERE `account`='".$account['id']."'"),0)){
$clann=mysql_result(mysql_query("SELECT `clan` FROM `clan_add` WHERE `account`='".$account['id']."'"),0);
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `clan` WHERE `id`='".$clann."'"),0)){
mysql_query("UPDATE `account` SET `clan`='".$clann."',`clan_status`='wwnew' WHERE `id`='".$account['id']."'");
mysql_query("DELETE FROM `clan_add` WHERE `account`='".$account['id']."'");
header("Location: /myclan.php?");
exit;
}else{
echo '<div class="help">Приглаение недействительно!</div>';
}
}else{
echo '<div class="help">Приглаение недействительно!</div>';
}
}elseif($_GET['party']=='no'){
@mysql_query("DELETE FROM `clan_add` WHERE `account`='".$account['id']."'");
header("Location: ?");
exit;
}else{
header("Locaton:?");
exit;
}
}
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `clan_add` WHERE `account`='".$account['id']."'"),0)){
$clannew=mysql_fetch_assoc(mysql_query("SELECT * FROM `clan_add` WHERE `account`='".$account['id']."'"));
echo '<div class="help"><a href="?char.php?id='.$clannew['user'].'">'.mysql_result(mysql_query("SELECT `name` FROM `account` WHERE `id`='".$clannew['user']."'"),0).'</a> приглашает вас в клан '.mysql_result(mysql_query("SELECT `name` FROM `clan` WHERE `id`='".$clannew['clan']."'"),0).'</div><a class="link" href="?clan=ok">Вступить</a><a class="link" href="?clan=no">Отклонить</a>';
}
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `duel_add` WHERE `account`='".$account['id']."'"),0)){
$duele=mysql_fetch_assoc(mysql_query("SELECT * FROM `duel_add` WHERE `account`='".$account['id']."'"));
if (!$account['battle'] && !$account['duel_battle']){
echo '<div class="help"><a href="?char.php?id='.$duele['user'].'">'.mysql_result(mysql_query("SELECT `name` FROM `account` WHERE `id`='".$duele['user']."'"),0).'</a> вызывает вас на дуэль </div><a class="link" href="?duele=ok">В бой</a><a class="link" href="?duele=no">Отклонить</a>';
}else{
mysql_query("DELETE FROM `duel_add` WHERE `id`='".$duele['id']."'");
mysql_query("INSERT INTO `msg_list` SET `msg`='<div class="help">Дуэль отменена</div>',`acount`='".$duele['user']."'");
}
}
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `mail` WHERE `to`='".$account['id']."' AND `read`='0'"),0) && !isset($mail)){
echo '<a class="link" href="/mail.php?in">Новое сообщение</a>';
}
if ($_GET['special']){
if (!$account['specialization']){
if ($_GET['special']==1){
mysql_query("UPDATE `account` SET `specialization`='1' WHERE `id`='".$account['id']."'");
$account['specialization']=mysql_result(mysql_query("SELECT `specialization` FROM `account` WHERE `id`='".$account['id']."'"),0);
}elseif ($_GET['special']==2){
mysql_query("UPDATE `account` SET `specialization`='2' WHERE `id`='".$account['id']."'");
$account['specialization']=mysql_result(mysql_query("SELECT `specialization` FROM `account` WHERE `id`='".$account['id']."'"),0);
}if ($_GET['special']==3){
mysql_query("UPDATE `account` SET `specialization`='3' WHERE `id`='".$account['id']."'");
$account['specialization']=mysql_result(mysql_query("SELECT `specialization` FROM `account` WHERE `id`='".$account['id']."'"),0);
}
echo '<div class="title">Специализация</div>';
echo '<div class="help">';
echo '<img src="/data/img/'.$account['race'].$account['class'].'master.jpg" style="float:left;padding-right:5px;">';
echo 'Вы выбрали свой путь, и теперь вы готовы пройти его! Теперь я повествую тебе нашу историю!<br />';
echo '</div>';
if ($account['race']=='man' OR $account['race']=='woman'){
echo '<a class="link" href="/historypeople.php">Выслушать историю</a>';
}else{
echo '<a class="link" href="/historyork.php">Выслушать историю</a>';
}
down();
exit;
}else{
header("Location: ?");
exit;
}
}
if (!$account['specialization']){
echo '<div class="title">Специализация</div>';
if ($account['class']=='warrior'){//если воин
echo '<div class="help">';
echo '<img src="/data/img/'.$account['race'].'warriormaster.jpg" style="float:left;padding-right:5px;">';
echo 'Приветствую смелый воин! Выбери свой путь - путь воина!<br /><br /></div>';
echo '<a class="link" href="?special=1">Борец</a>';
echo '<a class="link" href="?special=2">Титан</a>';
echo '<a class="link" href="?special=3">Истребитель</a>';
down();
exit;
}elseif($account['class']=='mage'){//если маг
echo '<div class="help">';
echo '<img src="/data/img/'.$account['race'].'magemaster.jpg" style="float:left;padding-right:5px;">';
echo 'Приветствую смелый маг! Выбери свой путь - путь разума!<br /><br /></div>';
echo '<a class="link" href="?special=1">Заклинатель</a>';
echo '<a class="link" href="?special=2">Бес</a>';
echo '<a class="link" href="?special=3">Бард</a>';
down();
exit;
}elseif($account['class']=='rogue'){//если разбойник
echo '<div class="help">';
echo '<img src="/data/img/'.$account['race'].'roguemaster.jpg" style="float:left;padding-right:5px;">';
echo 'Приветствую смелый разбойник! Выбери свой путь - путь гордости!<br /></div>';
echo '<a class="link" href="?special=1">Дебошир</a>';
echo '<a class="link" href="?special=2">Лучник</a>';
echo '<a class="link" href="?special=3">Вор</a>';
down();
exit;
}
}
if ($account['historyread']!=1){
if ($account['race']=='man' || $account['race']=='woman'){
if ($_SERVER['SCRIPT_NAME']!='/historypeople.php'){
//echo $_SERVER['SCRIPT_NAME'];
header("Location: /historypeople.php");
exit;
}
}elseif ($_SERVER['SCRIPT_NAME']!='/historyork.php'){
//echo $_SERVER['SCRIPT_NAME'];
header("Location: /historyork.php");
exit;
}
}
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `msg_list` WHERE `acount`='".$account['id']."' ORDER BY `id` DESC"),0)){
$q=mysql_query("SELECT * FROM `msg_list` WHERE `acount`='".$account['id']."'");
while($result=mysql_fetch_assoc($q)){
echo $result['msg'];
//mysql_query("DELETE FROM `msg_list` WHERE `id`='".$result['id']."'");
}
}
}else{
header ("Location: /?"); exit;
}
?>