Merge pull request 'header.tpl' (#4) from header.tpl into master

Reviewed-on: https://src.liks.pw/lopar/battles/pulls/4
This commit is contained in:
Ivor Barhansky 2020-09-30 22:23:57 +00:00
commit d9d41b9398
1326 changed files with 8828 additions and 17843 deletions

View File

@ -7,11 +7,11 @@
session_start();
//require_once '../functions.php';
if (empty($user['admin'])) {
$user = new User($_SESSION['uid']);
if (!$user->admin) {
header("HTTP/1.0 404 Not Found");
exit;
}
header("Cache-Control: no-cache");
$al = db::c()->query('SELECT * FROM `aligns` WHERE `align` = "?s" LIMIT 1', $user['align'])->fetch_assoc();
@ -64,35 +64,11 @@ if ($_POST['ali']) { //Что делает эта штука?
db::c()->query('INSERT INTO `aligns` (`align`,`img`,`name`,`accses`) VALUES ("?s","?s","?s","?s") ON DUPLICATE KEY UPDATE `img` = "?s", `name` = "?s", `accses` = "?s"', $_POST['ali'], $_POST['im'], $_POST['txt'], imp($accs), $_POST['im'], $_POST['txt'], imp($accs));
}
if ($_POST['sbr_par']) {
$sb_pers = db::c()->query('SELECT `id`, `nextup`, `level` FROM `users` WHERE `login` = "?s" LIMIT 1', $_POST['sbr_par'])->fetch_assoc_array();
undressall($sb_pers['id']);
$levelstats = statsat($sb_pers['nextup']);
//Ох боюсь я за этот запрос!
db::c()->query('
UPDATE `users`
SET `stats` = ?i, `sila` = ?i, `lovk` = ?i, `inta` = ?i, `intel` = ?i, `vinos` = ?i,
`maxhp` = ?i, `master` = ?i, `noj` = ?i, `mec` = ?i, `topor` = ?i, `dubina` = ?i,
`mlight` = ?i, `mgray` = ?i, `mdark` = ?i
WHERE `id` = ?i',
($levelstats['stats'] - 9), 3, 3, 3, 0, $levelstats['vinos'], ($levelstats['vinos'] * 6), $levelstats['master'], 0, 0, 0, 0, 0, 0, 0, $sb_pers['id']);
echo "<span class='success'>Все прошло удачно. Персонаж может перераспределить параметры.</span>";
}
$aligns = db::c()->query('SELECT `img`,`align`,`name` FROM `aligns` ORDER BY `align`');
Template::header('ᐰdminка');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel=stylesheet href="/css/main.css">
<link rel=stylesheet href="/css/admin.css">
<title>ᐰdmin</title>
</head>
<body>
<form action='admin.php' method='post'>
<link rel=stylesheet href="/css/admin.css">
<form method='post'>
<fieldset>
<legend><a href='#' onclick='show("sk")'>Склонности</a></legend>
<div id=sk style='display:none;'>
@ -196,7 +172,7 @@ $aligns = db::c()->query('SELECT `img`,`align`,`name` FROM `aligns` ORDER BY `al
</fieldset>
</form>
<form method=post action="admin.php">
<form method=post>
<fieldset>
<legend><a href='#' onclick='show("sk3")'>Кланы</a></legend>
<div id=sk3 style='display:none;'>
@ -248,10 +224,6 @@ $aligns = db::c()->query('SELECT `img`,`align`,`name` FROM `aligns` ORDER BY `al
</div>
</fieldset>
</form>
<form method=post>
<legend>Сброс параметров персонажа</legend>
<input name='sbr_par' placeholder="Логин"> <input type=submit value='Применить'></form>
<form method=post>
<legend><a href='#' onclick='show("sk2")'>Добавить вещь</a></legend>
<div id=sk2 style='display:none;'>
@ -871,8 +843,7 @@ if ($_POST['login'] && $_POST['krest']) {
}
if ($_POST['krest'] == -1) {
db::c()->query('UPDATE `users` SET `align`="?s", `status`="?s" WHERE `login` = "?s" LIMIT 1;', '0', '', $_POST['login']);
}
else {
} else {
db::c()->query('UPDATE `users` SET `align` = "?s", `status` = "?s" WHERE `login` = "?s"', $_POST['krest'], $rang, $_POST['login']);
}
}
@ -1125,7 +1096,4 @@ if ($_POST['login'] && $_POST['krest']) {
}
return xmlHttp1;
}
</script>
</body>
</html>
</script>

View File

@ -45,15 +45,8 @@ if ($del) {
}
db::c()->query('DELETE FROM `inventory` WHERE `id` = ?i', $del);
}
Template::header('ᐰdminка инвентаря');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ᐰdmin</title>
</head>
<link type="text/css" rel="stylesheet" href="../css/main.css">
<body>
<h1>Администрирование инвентаря <?php if (isset($_SESSION['player_name'])) echo $_SESSION['player_name']; ?></h1>
<table class='adm'>
<tr>
@ -95,6 +88,4 @@ if ($del) {
</form>
</th>
<?php endif; ?>
</table>
</body>
</html>
</table>

View File

@ -1,28 +0,0 @@
<?
/**
* Copyright (c) 2018.
* Author: Igor Barkov <lopar.4ever@gmail.com>
* Project name: Battles-Game
*/
require_once "../functions.php";
$id = mysql_query("SELECT * FROM `clans`");
$clans = mysql_num_rows($id);
$check = 0;
while($check++ < $clans) {
$shor = mysql_fetch_array(mysql_query("SELECT * FROM `clans` WHERE `id` = '{$check}' LIMIT 1"));
$short = $shor['short'];
$exp = mysql_fetch_row(mysql_query("SELECT `exp`, COUNT(*) FROM `users` WHERE `klan` = '{$short}'"));
$id = mysql_query("SELECT `id` FROM `users` WHERE `klan` = '{$short}'");
$kolvo_us = mysql_num_rows($id);
echo "$exp[0];||$kolvo_us Q";
$site_r_clan = 0; // рейтинг клан сайта
$fight_r_clan = 0; // боевой рейтинг клана
$grash_point = 0; // очки гражданства
$Clan_ration = (($exp/$kolvo_us)+($site_r_clan*100000))+$fight_r_clan+$grash_point;
$l_p = mysql_query("UPDATE `clans` SET `rating` = 'Clan_ration' WHERE `id` = '{$check}'");
if($l_p) {
echo "Клановый рейтинг для клана '$short' удачно обновлен";
}
}

View File

@ -1,16 +1,23 @@
<?php
session_start();
if ($_SESSION['uid'] == null) header("Location: index.php");
require_once 'functions.php';
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
if ($user['room'] != 61) {
require_once 'functions.php';
$user = $user ?? null;
if ($user->room != 61) {
header("Location: main.php");
die();
exit;
}
if ($user['battle'] != 0) {
if ($user->battle) {
header('location: fight.php');
die();
exit;
}
const SMITH = 'оружейник';
const MERCENARY = 'наёмник';
const MEDIC = 'лекарь';
$status = 'Внимание! Моментальная оплата без подтверждения!';
$get = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING'));
@ -19,57 +26,71 @@ function setProfession($name, $type, $needMoney, $needLevel)
{
global $user;
$profId = 0;
if (!in_array($name, ['оружейник', 'наёмник', 'лекарь'])) return 'Такой профессии не существует!';
if ($user['money'] < $needMoney) return 'Недостаточно денег!';
if ($user['level'] < $needLevel) return 'Ваш уровень ещё мал для этой профессии!';
if (!empty($user['prof1']) AND $type == 1) return 'Ошибка! У вас уже есть другая мирная профессия!';
if (!empty($user['prof2']) AND $type == 2) return 'Ошибка! У вас уже есть другая боевая профессия!';
if ($name == 'оружейник') $profId = 1;
if ($name == 'наёмник') $profId = 21;
if ($name == 'лекарь') $profId = 22;
$status = null;
if (!in_array($name, [SMITH, MERCENARY, MEDIC])) {
$status = 'Такой профессии не существует!';
}
if ($user['money'] < $needMoney) {
$status = 'Недостаточно денег!';
}
if ($user['level'] < $needLevel) {
$status = 'Ваш уровень ещё мал для этой профессии!';
}
if (!empty($user['prof1']) && $type == 1) {
$status = 'Ошибка! У вас уже есть другая мирная профессия!';
}
if (!empty($user['prof2']) && $type == 2) {
$status = 'Ошибка! У вас уже есть другая боевая профессия!';
}
if ($name == SMITH && !$status) {
$profId = 1;
}
if ($name == MERCENARY && !$status) {
$profId = 21;
}
if ($name == MEDIC && !$status) {
$profId = 22;
}
if (!empty($profId)) {
try {
db::c()->query('UPDATE `users` SET ?f = ?i, `money` = `money` - ?i WHERE `id` = ?i', 'prof' . $type, $profId, $needMoney, $_SESSION['uid']);
} catch (\Krugozor\Database\Mysql\Exception $e) {
}
$user->money -= $needMoney;
Bank::setWalletMoney($user->money, $user->id);
db::c()->query('UPDATE `users` SET ?f = ?i WHERE `id` = ?i', 'prof' . $type, $profId, $user->id);
$deloText = "{$user['login']} купил профессию «{$name}» в академии за {$needMoney} кр.";
addToDelo($deloText);
$user['prof'.$type] = true;
$user['money'] -= $needMoney;
return 'Вы получили профессию!';
} else return 'Что-то пошло не так...';
$user['prof' . $type] = true;
$status = 'Вы получили профессию!';
} else {
$status = 'Что-то пошло не так...';
}
return $status;
}
if ($get == 'smith') $status = setProfession('оружейник', 1, 300, 3);
if ($get == 'mercenary') $status = setProfession('наёмник', 2, 700, 5);
if ($get == 'medic') $status = setProfession('лекарь', 2, 700, 5);
if ($get == 'smith') {
$status = setProfession(SMITH, 1, 300, 3);
}
if ($get == 'mercenary') {
$status = setProfession(MERCENARY, 2, 700, 5);
}
if ($get == 'medic') {
$status = setProfession(MEDIC, 2, 700, 5);
}
if ($get == 'exit') {
try {
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 2702, `online`.`room` = 2702 WHERE `users`.`id` = ?i AND `online`.`id` = ?i', $_SESSION['uid'], $_SESSION['uid']);
} catch (\Krugozor\Database\Mysql\Exception $e) {
}
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 2702, `online`.`room` = 2702 WHERE `users`.`id` = ?i AND `online`.`id` = ?i', $user->id, $user->id);
header('Location: city.php');
}
Template::header('Академия');
?>
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<link href="css/main.css" rel="stylesheet">
<link href="css/secondary.css" rel="stylesheet"/>
<title></title>
</head>
<body>
<link href="css/secondary.css" rel="stylesheet"/>
<div style="float: right;">
<button onclick="location.href='?exit'">Вернуться</button>
</div>
<h1>Академия</h1>
<div><?php if (!empty($status)) err($status); ?></div>
<div><?= $status ?></div>
<div class="appblock appblock-main">
<span class="legend">Информация</span>
<span class="wrap">Кредиты<span class="num"><?= $user['money'] ?></span></span>
<span class="wrap">Уровень персонажа<span class="num"><?= $user['level'] ?></span></span>
<span class="wrap">Кредиты<span class="num"><?= $user->money ?></span></span>
<span class="wrap">Уровень персонажа<span class="num"><?= $user->level ?></span></span>
</div>
<div class="appblock">
<span class="legend">Наёмник</span>
@ -138,6 +159,4 @@ if ($get == 'exit') {
<span class="wrap">
Алхимик может создавать новые зелья используя расходные материалы. Мирная профессия.
</span>
</div>
</body>
</html>
</div>

View File

@ -1,10 +1,11 @@
<?php
session_start();
if ($_SESSION['uid'] == null) {
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
include("config.php");
include("functions.php");
require_once "functions.php";
$start = db::c()->query('SELECT `value` FROM `variables` WHERE `var` = "arena_of_gods"')->fetch_assoc();
$is_now = db::c()->query('SELECT `id` FROM `battle` WHERE `aren_of` = 1 AND `win` = 3 ORDER BY `id` DESC')->fetch_assoc();
@ -19,8 +20,8 @@ function join_arena($u, $btl, $team, $at)
$ak = array_keys($battle[$at]);
$battle[$u] = $battle[$ak[0]];
foreach ($battle[$u] as $k => $v) {
$battle[$u][$k] = array(0, 0, time());
$battle[$k][$u] = array(0, 0, time());
$battle[$u][$k] = [0, 0, time()];
$battle[$k][$u] = [0, 0, time()];
}
if ($team == 1) {
$adtxt = 'За сторону <b>Тьмы</b>.';
@ -35,9 +36,9 @@ function join_arena($u, $btl, $team, $at)
function aligntype($a)
{
$lightaligns = array("1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9");
$darkaligns = array("2.2", "3", "8.21");
$neutralaligns = array("2", "8.31");
$lightaligns = ["1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9"];
$darkaligns = ["2.2", "3", "8.21"];
$neutralaligns = ["2", "8.31"];
if (in_array($a, $lightaligns)) {
return 1;
}
@ -125,15 +126,9 @@ if (isset($_GET['append'])) {
}
}
}
Template::header('Арена Ангелов');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="css/main.css" rel="stylesheet"/>
<link href="css/fight.css" rel="stylesheet"/>
</head>
<link href="css/fight.css" rel="stylesheet"/>
<style>
.hs {
font-weight: bold;
@ -212,7 +207,6 @@ if (isset($_GET['append'])) {
color: Red;
}
</style>
<body>
<h1>Арена Ангелов</h1>
<div class="contentContainer">
<div class="buttonContainer">
@ -223,12 +217,14 @@ if (isset($_GET['append'])) {
<div class="credenzaItem">
<? if (!isset($is_now['id'])) { ?>
<div class="credenza-stateCaption">
<?=$winers?>.<br/>Следующая битва для 7-21 ур. состоится: <?=date("d.m.Y H:i", $start['value'])?>
<?= $winers ?>.<br/>Следующая битва для 7-21 ур.
состоится: <?= date("d.m.Y H:i", $start['value']) ?>
</div>
<? } else { ?>
<div class="credenza-stateCaption">
<h2>Идет сражение [7-21 уровни]</h2>
<br/><a href="/logs.php?log=<?=$is_now['id']?>" target="_blank" style="text-align: center;">ход боя »»</a>
<br/><a href="/logs.php?log=<?= $is_now['id'] ?>" target="_blank" style="text-align: center;">ход
боя »»</a>
</div>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
@ -251,6 +247,4 @@ if (isset($_GET['append'])) {
</div>
</div>
</div>
<? if (!empty($error)) err($error); ?>
</body>
</html>
<?= $error ?>

View File

@ -1,16 +1,20 @@
<?php
session_start();
if ($_SESSION['uid'] == null) header("Location: index.php");
require_once 'functions.php';
if ($user['room'] != 50) {
header("Location: main.php");
die();
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
if ($user['battle'] != 0) {
require_once 'functions.php';
if ($user->room != 50) {
header("Location: main.php");
exit;
}
if ($user->battle) {
header('location: fbattle.php');
die();
exit;
}
$bank = db::c()->query('SELECT `ekr` FROM `bank` WHERE `id`=?i', $_SESSION['uid'])->fetch_assoc();
@ -32,13 +36,14 @@ while ($row = $shopItems->fetch_assoc()) {
}
if (!empty($_GET['buy'])) {
$dress = db::c()->query('SELECT * FROM `ashop` WHERE `id`=?i', $_GET['buy'])->fetch_assoc();
$itemWeight = db::c()->query('SELECT sum(`massa`) AS `m` FROM `inventory` WHERE `owner` = ?i AND `setsale` = 0', $user['id'])->fetch_assoc();
if (($dress['massa'] + $itemWeight['m']) > (get_meshok())) $status = 'Недостаточно места в рюкзаке.';
elseif ($bank['ekr'] >= $dress['ecost'] AND ($dress['count'] > 0 OR $dress['count'] == -1)) {
$goden = '';
if (isset($dress['goden'])) $goden = $dress['goden'] * 24 * 60 * 60 + time(); // Ну вот нахуя?
$dress = db::c()->query('SELECT * FROM `ashop` WHERE `id`=?i', $_GET['buy'])->fetch_assoc();
$itemWeight = db::c()->query('SELECT sum(`massa`) AS `m` FROM `inventory` WHERE `owner` = ?i AND `setsale` = 0', $user['id'])->fetch_assoc();
if (($dress['massa'] + $itemWeight['m']) > (get_meshok())) {
$status = 'Недостаточно места в рюкзаке.';
} elseif ($bank['ekr'] >= $dress['ecost'] && ($dress['count'] > 0 || $dress['count'] == -1)) {
$goden = '';
if (isset($dress['goden'])) {
$goden = $dress['goden'] * 24 * 60 * 60 + time(); // Ну вот нахуя?}
db::c()->query('
INSERT INTO `inventory`
(
@ -59,11 +64,11 @@ if (!empty($_GET['buy'])) {
$dress['nlevel'], $dress['nalign'], $goden, $dress['goden'], $dress['razdel'], $dress['artefact'], $dress['koll']);
$inventoryItemId = db::c()->getLastInsertId();
if ($dress['count'] != -1) db::c()->query('UPDATE `ashop` SET `count` = `count`- 1 WHERE `id` = ?i', $_GET['buy']);
if ($dress['count'] != -1) {
db::c()->query('UPDATE `ashop` SET `count` = `count`- 1 WHERE `id` = ?i', $_GET['buy']);
}
$deloText = "{$user['login']} купил товар «{$dress['name']}» id:({$inventoryItemId}) в магазине «Берёзка» за {$dress['ecost']} екр.";
addToDelo($deloText);
$status = "Вы купили «{$dress['name']}» за {$dress['ecost']} екр.";
db::c()->query('UPDATE `bank` SET `ekr` = `ekr` - ?i WHERE `id` = ?i', $dress['ecost'], $_SESSION['uid']);
// Для обновления данных о деньгах на странице
@ -134,18 +139,12 @@ switch ($shopCategoryTypeNumber) {
$shopCategory = "Букеты";
break;
}
Template::header('Берёзка');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="css/main.css" rel="stylesheet"/>
<script src="js/main.js"></script>
</head>
<body>
<script src="js/main.js"></script>
<h1>Магазин Берёзка</h1>
<a href=# onclick=hrefToFrame('city.php?cp')> ← выйти на Центральную площадь</a>
<div><?php if (!empty($status)) err($status); ?></div>
<div><?= $status ?></div>
<table border=0 width=100% cellspacing="0" cellpadding="4">
<tr>
<td valign=top align=left>
@ -198,5 +197,4 @@ switch ($shopCategoryTypeNumber) {
</td>
</tr>
</table>
</body>
</html>
<?php } ?>

View File

@ -23,6 +23,7 @@ if ($get == 'exit') {
$_SESSION[BANK_SESSION_NAME] = null;
}
$bank = new Bank($user->id);
$status = '';
if (isset($_POST['userlogin'])) {
$_SESSION[BANK_SESSION_NAME] = $bank->user_id;
@ -31,7 +32,6 @@ if ($_SESSION[BANK_SESSION_NAME]) {
$toid = (int)$_POST['to_id'] ?? 0;
$summa = (int)$_POST['summa'] ?? 0;
$submit = $_POST['action'] ?? '';
$status = '';
// Зачисление кредитов на счёт.
if ($submit === 'depositMoney' && $summa) {
$bank->depositMoney($summa);
@ -49,17 +49,10 @@ if ($_SESSION[BANK_SESSION_NAME]) {
}
unset($submit, $summa, $toid);
}
Template::header('Банк');
?>
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<link href="css/main.css" rel="stylesheet"/>
<link href="css/secondary.css" rel="stylesheet"/>
<script src="js/main.js"></script>
<title>Банк</title>
</head>
<body>
<h1>Банк</h1>
<?php if (!$_SESSION[BANK_SESSION_NAME]): ?>
<a href=# onclick=hrefToFrame('city.php?strah')> ← выйти из банка</a>
@ -94,8 +87,6 @@ if ($_SESSION[BANK_SESSION_NAME]) {
<input type="hidden" name="action" value="sendMoney">
<input type="submit" value="Перевести кредиты">
</form>
<span class="wrap">Комиссия: <?= Bank::BANK_COMISSION * 100 ?>% от переводимой суммы, но не менее 1 кр.</span>
<span class="wrap">Комиссия: <?= Config::$bank_comission * 100 ?>% от переводимой суммы, но не менее 1 кр.</span>
</div>
<?php endif; ?>
</body>
</html>
<?php endif; ?>

View File

View File

@ -1,25 +1,18 @@
<?php
session_start();
if ($_SESSION['uid'] == null) {
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
include_once "config.php";
include_once "functions.php";
header("Cache-Control: no-cache");
$header = filter_input(INPUT_GET, 'header');
$ch = filter_input(INPUT_GET, 'ch');
require_once "functions.php";
$header = $_GET['header'] ?? null;
$ch = $_GET['ch'] ?? null;
if ($header) {
die();
exit;
} elseif ($ch != null) {
Template::header('buttons');
?>
<html>
<head>
<link rel="stylesheet" href="css/main.css"/>
<meta charset="utf-8"/>
<script type="text/javascript" src="js/ZeroClipboard.js"></script>
<script language="JavaScript" src="js/ch.js"></script>
<script language="JavaScript" src="js/sl2.js"></script>
<script language="JavaScript" src="js/chat.js"></script>
@ -212,8 +205,6 @@ if ($header) {
}
</script>
</head>
<body marginheight=0 marginwidth=0">
<div id="fixednew"
style="position: fixed; margin: -3px; padding: 0; z-index: 999; width: 100%; text-align: center; overflow: auto;">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
@ -244,10 +235,7 @@ if ($header) {
<div id="oMenu" style="position: absolute; border:1px solid #666; background-color:#CCC; display:none; "></div>
<div id="ClearMenu" style="position: absolute; border:1px solid #666; background-color: #e2e0e0; display: none;"></div>
<? } else { ?>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-type"/>
<? } else { Template::header(buttons); ?>
<script language="JavaScript" src="js/chat.js"></script>
<script language="JavaScript">
@ -313,8 +301,6 @@ if ($header) {
document.F1.om.value = '';
}
}
function subm() {
t = top.frames['chat'].currenttab;
$('input[name="chtype"]:hidden').val(t);
@ -440,10 +426,6 @@ if ($header) {
window.onresize = rslength;
</script>
</head>
<body marginheight=0 marginwidth=0 bgcolor=#E6E6E6 onload="top.strt();"> <!-- rslength(); -->
<form action="ch.php" target="refreshed" method="GET" name="F1" id="F1" onsubmit="subm(); top.NextRefreshChat();">
<input type="hidden" name="color" value="000000"/>
<input type="hidden" name="sys" value=""/>
@ -551,6 +533,4 @@ if ($header) {
}
</script>
</FORM>
<? } ?>
</body>
</html>
<? } ?>

28
buy.php
View File

@ -1,29 +1,29 @@
<?php
//Покупка абилок? Тут?!
session_start();
if (!isset($_SESSION['uid'])) die();
if (empty($_SESSION['uid'])) {
header('Location: Index.php');
exit;
}
include('config.php');
#include('functions.php');
$is_now = db::c()->query('SELECT `id`, `uid` FROM `abils_user` WHERE `uid` = ?i', $user['id'])->fetch_assoc();
function add_user_abil($ab, $cost)
{
global $user, $banks;
if (isset($ab)) {
if ($banks['ekr'] >= $cost) {
$isset = mysql_fetch_array(mysql_query('SELECT `id`, `' . $ab . '` FROM `abils_user` WHERE `uid` = "' . $user['id'] . '" LIMIT 1'));
$isset[$ab] += 1;
mysql_query('UPDATE `abils_user` SET `' . $ab . '` = "' . $isset[$ab] . '" WHERE `uid` = "' . $user['id'] . '" LIMIT 1');
$banks['ekr'] -= $cost;
mysql_query('UPDATE `bank` SET `ekr` = "' . $banks['ekr'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
return true;
}
if (isset($ab) && $banks['ekr'] >= $cost) {
$isset = mysql_fetch_array(mysql_query('SELECT `id`, `' . $ab . '` FROM `abils_user` WHERE `uid` = "' . $user['id'] . '" LIMIT 1'));
$isset[$ab] += 1;
mysql_query('UPDATE `abils_user` SET `' . $ab . '` = "' . $isset[$ab] . '" WHERE `uid` = "' . $user['id'] . '"');
$banks['ekr'] -= $cost;
mysql_query('UPDATE `bank` SET `ekr` = "' . $banks['ekr'] . '" WHERE `id` = "' . $user['id'] . '"');
return true;
}
return false;
}
$cost = array(1, 2, 10, 0.50, 0.80, 1, 1, 0.10, 0.20, 4, 0.02, 20, 10, 1, 1);
$mag = array('sleep15', 'sleep30', 'closebattle', 'heal20', 'heal35', 'heal50', 'travmoff', 'attack', 'bloodattack', 'death', 'comment', 'openbattle', 'reamdeath', 'clone', 'unclone');
$cost = [1, 2, 10, 0.50, 0.80, 1, 1, 0.10, 0.20, 4, 0.02, 20, 10, 1, 1];
$mag = ['sleep15', 'sleep30', 'closebattle', 'heal20', 'heal35', 'heal50', 'travmoff', 'attack', 'bloodattack', 'death', 'comment', 'openbattle', 'reamdeath', 'clone', 'unclone'];
if (isset($_POST['type'], $_POST['user'])) {
if (isset($user['id'])) {
@ -33,7 +33,7 @@ if (isset($_POST['type'], $_POST['user'])) {
if ($banks['ekr'] >= $price) {
if (isset($is_now['id'])) {
if ($user['battle'] == 0) {
if (add_user_abil($abil, $price) == true) {
if (add_user_abil($abil, $price)) {
echo 'success';
} else {
echo 'Error';

View File

@ -1,32 +1,29 @@
<?php
session_start();
if (!isset($_SESSION['uid'])) {
die();
if (empty($_SESSION['uid'])) {
exit;
}
include('config.php');
include('functions.php');
require_once "functions.php";
if ($user['klan'] == '') {
die();
if (empty($user->clan)) {
exit;
}
$is_now = db::c()->query('SELECT `id` FROM `abils_klan` WHERE `klan` = ?i', $user['klan'])->fetch_assoc();
$clan = db::c()->query('SELECT `glava` FROM `clans` WHERE `id` = ?i', $user['klan'])->fetch_assoc();
$cost = array(1, 2, 10, 0.50, 0.80, 1, 1, 0.10, 0.20, 4, 0.02, 20, 10, 1, 1);
$mag = array('sleep15', 'sleep30', 'closebattle', 'heal20', 'heal35', 'heal50', 'travmoff', 'attack', 'bloodattack', 'death', 'comment', 'openbattle', 'reamdeath', 'clone', 'unclone');
$cost = [1, 2, 10, 0.50, 0.80, 1, 1, 0.10, 0.20, 4, 0.02, 20, 10, 1, 1];
$mag = ['sleep15', 'sleep30', 'closebattle', 'heal20', 'heal35', 'heal50', 'travmoff', 'attack', 'bloodattack', 'death', 'comment', 'openbattle', 'reamdeath', 'clone', 'unclone'];
function add_klan_abil($ab, $cost)
{
global $user, $banks;
$clan = mysql_fetch_array(mysql_query('SELECT `id`, `glava` FROM `clans` WHERE `id` = "' . $user['klan'] . '" LIMIT 1'));
if (isset($ab)) {
if ($banks['ekr'] >= $cost && $clan['glava'] == $user['id']) {
$isset = mysql_fetch_array(mysql_query('SELECT `id`, `' . $ab . '` FROM `abils_klan` WHERE `klan` = "' . $user['klan'] . '" LIMIT 1'));
$isset[$ab] += 1;
mysql_query('UPDATE `abils_klan` SET `' . $ab . '` = "' . $isset[$ab] . '" WHERE `klan` = "' . $user['klan'] . '" LIMIT 1');
$banks['ekr'] -= $cost;
mysql_query('UPDATE `bank` SET `ekr` = "' . $banks['ekr'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
return true;
}
$clan = mysql_fetch_array(mysql_query('SELECT `id`, `glava` FROM `clans` WHERE `id` = "' . $user['klan'] . '"'));
if (isset($ab) && $banks['ekr'] >= $cost && $clan['glava'] == $user['id']) {
$isset = mysql_fetch_array(mysql_query('SELECT `id`, `' . $ab . '` FROM `abils_klan` WHERE `klan` = "' . $user['klan'] . '"'));
$isset[$ab] += 1;
mysql_query('UPDATE `abils_klan` SET `' . $ab . '` = "' . $isset[$ab] . '" WHERE `klan` = "' . $user['klan'] . '"');
$banks['ekr'] -= $cost;
mysql_query('UPDATE `bank` SET `ekr` = "' . $banks['ekr'] . '" WHERE `id` = "' . $user['id'] . '"');
return true;
}
return false;
}
@ -39,7 +36,7 @@ if (isset($_POST['type'], $_POST['user'])) {
if ($banks['ekr'] >= $price && $user['id'] == $clan['glava']) {
if (isset($is_now['id'])) {
if ($user['battle'] == 0) {
if (add_klan_abil($abil, $price) == true) {
if (add_klan_abil($abil, $price)) {
echo 'success';
} else {
echo 'Error';

View File

@ -1,28 +1,27 @@
<?
session_start();
require_once('functions.php');
if (!isset($_SESSION['uid'])) {
if (empty($_SESSION['uid'])) {
header('Location: index.php');
die();
exit;
}
if ($user['room'] == 51) {
if ($user->room == 51) {
header('location: city.php');
die();
exit;
}
$forest = db::c()->query('SELECT `id`, `room`, `room_id`, `time`, `user`, `data` FROM `forest` WHERE `user` = ?i', $user['id'])->fetch_assoc();
$error = '';
$map_page = '';
if (empty($forest['id'])) {
die('Ошибка. Сообщите Администрации. Код ошибки : 00.');
exit('Ошибка. Сообщите Администрации. Код ошибки : 00.');
}
function loadmap_cell()
{
global $forest;
$dat = unserialize($forest['data']);
$dat = ['Up' => $dat[$forest['room']]['Up'], 'Down' => $dat[$forest['room']]['Down'], 'Left' => $dat[$forest['room']]['Left'], 'Right' => $dat[$forest['room']]['Right']];
return $dat;
return ['Up' => $dat[$forest['room']]['Up'], 'Down' => $dat[$forest['room']]['Down'], 'Left' => $dat[$forest['room']]['Left'], 'Right' => $dat[$forest['room']]['Right']];
}
$map_user = loadmap_cell();
@ -73,33 +72,40 @@ if ($_GET['move'] == 'true') {
} else {
$error = 'Not in this life';
}
if (empty($error)) db::c()->query('UPDATE `forest` SET `room` = "?s", `room_id` = ?i WHERE `id` = ?i', $forest['room'], $forest['room_id'], $forest['id']);
if (empty($error)) {
db::c()->query('UPDATE `forest` SET `room` = "?s", `room_id` = ?i WHERE `id` = ?i', $forest['room'], $forest['room_id'], $forest['id']);
}
}
if ($map_user['Right'] == 1) $map_page = <<<MAP
if ($map_user['Right'] == 1) {
$map_page = <<<MAP
<img style="position: absolute; bottom: 30px; left: 740px; cursor: pointer; width: 20px; height: 117px;"
class="pngimg" src="i/forest/pointer_2.png" title="{$var_map['cell_' . ($forest['room_id'] + 1)]}"
onclick="location.href='?move=true&Dir=Right';"/>
onclick="location.href='?move=true&Dir=Right';" alt="Вправо">
MAP;
if ($map_user['Left'] == 1) $map_page = <<<MAP
}
if ($map_user['Left'] == 1) {
$map_page = <<<MAP
<img style="position: absolute; bottom: 30px; left: 20px; cursor: pointer; width: 20px; height: 117px; "
class="pngimg" src="i/forest/pointer_6.png" title="{$var_map['cell_' . ($forest['room_id'] - 1)]}"
onclick="location.href='?move=true&Dir=Left';"/>
onclick="location.href='?move=true&Dir=Left';" alt="Влево">
MAP;
if ($map_user['Down'] == 1) $map_page = <<<MAP
}
if ($map_user['Down'] == 1) {
$map_page = <<<MAP
<img style="position: absolute; bottom: 10px; left: 332px; cursor: pointer; width: 117px; height: 20px;"
class="pngimg" src="i/forest/pointer_4.png" title="{$var_map['cell_' . ($forest['room_id'] + 5)]}"
onclick="location.href='?move=true&Dir=Down';"/>
onclick="location.href='?move=true&Dir=Down';" alt="Вниз">
MAP;
if ($map_user['Up'] == 1) $map_page = <<<MAP
}
if ($map_user['Up'] == 1) {
$map_page = <<<MAP
<img style="position: absolute; bottom: 30px; left: 740px; cursor: pointer; width: 117px; height: 20px;"
class="pngimg" src="i/forest/pointer_8.png" title="{$var_map['cell_' . ($forest['room_id'] + 5)]}"
onclick="location.href='?move=true&Dir=Up';"/>
onclick="location.href='?move=true&Dir=Up';" alt="Вверх">
MAP;
}
Template::header('forest');
?>
<!doctype html>
<html lang="ru">
<head>
<title>forest</title>
<link rel="stylesheet" type="text/css" href="css/hostel.css"/>
<style>
.bt {
@ -112,8 +118,6 @@ MAP;
margin-right: 18px;
}
</style>
</head>
<body>
<div id="ajaxContainer" style="display: none;"></div>
<div class="contentContainer">
<div class="buttonContainer">
@ -135,6 +139,4 @@ MAP;
<div style="position: relative; width: 780px; height: 350px; background-image: url('forest/<?= $forest['room'] ?>.jpg');">
<?= $map_page ?>
</div>
</div>
</body>
</html>
</div>

View File

@ -1,279 +1,268 @@
<?php
session_start();
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
include "functions.php";
if ($user->room != 600) {
header("Location: main.php");
exit;
}
if ($user->battle) {
header('location: fbattle.php');
exit;
}
session_start();
if (!($_SESSION['uid'] >0)) header("Location: index.php");
include "config.php";
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
$in_haos = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_status` WHERE `id` = '{$user['id']}';"));
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = " . $user['id'] . " AND (type=13 OR type=12 OR type=14) limit 1;"));
$wait_msg = "Ждем подтверждения от всей группы...";
/** Генерация случайного пароля через хэш случайной строки.
*
* @return string
*/
function getPass():string
{
return hash('crc32', mt_rand());
}
if (!$in_haos) {
mysql_query("INSERT INTO cit_haos_status(id) values('{$user['id']}');");
$in_haos = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_status` WHERE `id` = '{$user['id']}' LIMIT 1;"));
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = ".$user['id']." AND (type=13 OR type=12 OR type=14) limit 1;"));
$wait_msg="Ждем подтверждения от всей группы...";
function getPass($length = 6)
{
$chars = 'abcdefghijklmnopqrstyvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789';
$numChars = strlen($chars);
$string = '';
for ($i = 0; $i < $length; $i++) {
$string .= substr($chars, rand(1, $numChars) - 1, 1);
}
return $string;
}
if(!$in_haos)
{
mysql_query("INSERT INTO cit_haos_status(id) values('{$user['id']}');");
$in_haos=mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_status` WHERE `id` = '{$user['id']}' LIMIT 1;"));
}
include "functions.php";
$pass_s=getPass(6);
if ($user['room'] != 600) { header("Location: main.php"); die(); }
if ($user['battle'] != 0) { header('location: fbattle.php'); die(); }
if ($_POST['pay'])
{
if(!$_POST['pay_gr']) $_POST['pay_gr']=1;
$group_num=mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$_POST['pay_gr']}';"));
$cit_haos_pl=mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='".$_POST['pay_gr']."' LIMIT 1;"));
$gps=$_POST['gr_pass_in'.$_POST['pay_gr']];
if($gps)
$gps=str_replace(" ","",$gps);
if($group_num<4)
if($user['hp']>=(int)($user['maxhp']/3) && !$owntravma[0])
if($user['money']>=20)
if(
!preg_match('/[\/\:*?"<>|+%]/',$gps)&&
(
($gps==$cit_haos_pl['password'] && strlen($cit_haos_pl['password'])>1)||
(strlen($cit_haos_pl['players'])<3)
)
)
{
mysql_query("UPDATE `cit_haos_status` SET `status` = '1',`group` = '{$_POST['pay_gr']}' WHERE `id` ='{$user['id']}'; ");
mysql_query("UPDATE `users` set `money` = `money`- '20' WHERE id = '{$user['id']}';");
$cit_haos_gr=mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_var`;"));
if($_POST['pay_gr']>$cit_haos_gr)
mysql_query("INSERT INTO `cit_haos_var`(`group`,`password`) values('".$_POST['pay_gr']."','".$pass_s."');");
$cit_haos_pl=mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='".$_POST['pay_gr']."' LIMIT 1;"));
if(!in_array($user['id'],explode(";",$cit_haos_pl['players'])))
{
if($cit_haos_pl['players']!='')
$ch_pl_t=$cit_haos_pl['players'].";".$user['id'];
else
$ch_pl_t=$user['id'];
mysql_query("UPDATE `cit_haos_var` SET `players`='{$ch_pl_t}' WHERE `group`='".$_POST['pay_gr']."';");
}
}
else ($pass_in_err="Неверный пароль!");
else ($pay_err="Недостаточно денег для подачи стартового взноса!");
else ($pay_err="Вы слишком ослаблены либо травмированы! ");
else ($pay_err="Группа уже набрана!");
}
if ($_POST['adm_start_raid'] && $user['id']==1256)
{
mysql_query("DELETE FROM `cit_haos_status`;");
mysql_query("DELETE FROM `cit_haos_var`;");
AddChatSystem('<font color=red>Начинается прием заявок в рейд на Цитадель Хаоса! Начало рейда через 15 минут.</font>');
$ch_time=time();
mysql_query("UPDATE variables SET value='{$ch_time}' where var='cit_haos_time';");
}
if ($_POST['test_start_raid'] && $user['id']==1256)
{
mysql_query("DELETE FROM `cit_haos_status`;");
mysql_query("DELETE FROM `cit_haos_var`;");
// AddChatSystem('<font color=red>Начинается прием заявок в рейд на Цитадель Хаоса! Начало рейда через 15 минут.</font>');
$ch_time=time();
mysql_query("UPDATE variables SET value='{$ch_time}' where var='cit_haos_time';");
}
if ($in_haos['room'] != 0 && $in_haos['status'] == 2)
{
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '601',`online`.`room` = '601' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;");
header('location: c_haos_in.php');
}
if ($in_haos['status'] == 2)
{
$group_num=mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$in_haos['group']}';"));
$group_ready=mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE (`status` = '2' AND `group` = '{$in_haos['group']}');"));
if($group_num==$group_ready && $group_ready>0)
{
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '601',`online`.`room` = '601' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;");
mysql_query("UPDATE `cit_haos_status` SET room='1' WHERE id = '{$user['id']}'; ");
header('location: c_haos_in.php');
};
}
$in_haos = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_status` WHERE `id` = '{$user['id']}' LIMIT 1;"));
?>
<HTML><HEAD>
<!-- JS -->
<script>
function refreshPeriodic()
{
location.href='c_haos.php';//reload()
timerID=setTimeout("refreshPeriodic()",30000);
}
timerID=setTimeout("refreshPeriodic()",30000);
</script>
<link rel=stylesheet type="text/css" href="css/main.css">
<meta content="text/html; charset=utf-8" http-equiv=Content-type>
<META Http-Equiv=Cache-Control Content=no-cache>
<meta http-equiv=PRAGMA content=NO-CACHE>
<META Http-Equiv=Expires Content=0>
</HEAD>
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor=#d4d4d4>
<TABLE border=0 width=600 cellspacing="0" cellpadding="0" align=left>
<tr><td><h3>Цитадель Хаоса</td></tr>
<?php
$tm=time();
$cit_haos_t=mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE `var` = 'cit_haos_time' LIMIT 1;"));
if($tm<$cit_haos_t['value'] || $tm>($cit_haos_t['value']+900))//def 900
{
$tob_all=array();
mysql_query("DELETE FROM `cit_haos_var` WHERE CHAR_LENGTH(players)<3;");
if ($in_haos['status']==1)
{
$dbb=mysql_query("SELECT * FROM `cit_haos_var`;");
while($ch_tob=mysql_fetch_array($dbb))
if(!in_array($ch_tob['players'],$tob_all))
$tob_all = $tob_all.";".$ch_tob['players'];
foreach(explode(";",$tob_all) as $tob)
mysql_query("UPDATE `cit_haos_status` SET status='2' WHERE id = '{$tob}'; ");
//header('location: c_haos.php');
}
$tm=time();
$test_tm=time()+900;
$show_tm=$cit_haos_t['value']+0.5*24*60*60;
switch (date("N",$show_tm))
{
case 1:$d_o="в понедельник";break;
case 2:$d_o="во вторник";break;
case 3:$d_o="в среду";break;
case 4:$d_o="в четверг";break;
case 5:$d_o="в пятницу";break;
case 6:$d_o="в субботу";break;
case 7:$d_o="в воскресение";break;
}
if($tm<$cit_haos_t['value'])echo '<tr><td>Следующий рейд начнется <b>'.date("j.m </b> в <b> H:i</b>",$cit_haos_t['value']).'</td></tr>';
else echo '<tr><td>Готовьтесь! Следующий рейд будет <b>'.$d_o.'</td></tr>';
echo '<tr><td><FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="bps"></FORM></td></tr>';
if($user['id']==1256) echo '<tr><td><FORM action="c_haos.php" method=POST><INPUT TYPE="submit" value="Тест (Начать рейд)" name="test_start_raid"><br></FORM></td></tr>';
if($user['id']==1256) echo '<tr><td><FORM action="c_haos.php" method=POST><INPUT TYPE="submit" value="Админ - Начать рейд" name="adm_start_raid"><br></FORM></td></tr>';
}
elseif ($in_haos['status']==0)
{
$cit_haos_gr=mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_var`;"));
if($cit_haos_gr==0)
{
$pass_s=getPass(6);
mysql_query("INSERT INTO `cit_haos_var`(`group`,`password`) values('1','{$pass_s}');");
$cit_haos_gr=mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_var`;"));
}
echo '<tr><td>Рейд начинается <b>'.date("j.m </b> в <b> H:i</b>",$cit_haos_t['value']+900).'</td></tr>';
echo '<tr><td><FORM action="c_haos.php" method=POST>Взнос за участие в рейде <strong>20 кр</strong><br>';
echo '<tr><td><FORM action="c_haos.php" method=POST>Максимальный размер группы - <strong>4</strong> участника<br>';
echo '<tr><td>'.$pass_in_err.'<br />';
$check_em=mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE `group`=1 ;"));
if($check_em<1)
{
$i=1;
echo('<INPUT TYPE="radio" value="'.$i.'" name="pay_gr">Группа '.$i.":");
$cit_haos_pl=mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='".$i."' LIMIT 1;"));
if($cit_haos_pl['players']!='')
{
foreach(explode(";",$cit_haos_pl['players']) as $ch_p)
echo(Nick::id($ch_p)->full(1).",");
echo('Пароль:<input type="text" size="10" NAME="gr_pass_in'.$i.'">');
}
else echo(' <em>(Создать новую группу)</em>');
echo '<BR>';
}
else
for($i=1;$i<=$cit_haos_gr+1;$i++)
{
echo('<INPUT TYPE="radio" value="'.$i.'" name="pay_gr">Группа '.$i.":");
$cit_haos_pl=mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='".$i."' LIMIT 1;"));
if(strlen($cit_haos_pl['players'])>1)
{
foreach(explode(";",$cit_haos_pl['players']) as $ch_p)
echo(Nick::id($ch_p)->full(1).",");
echo('Пароль:<input type="text" size="10" NAME="gr_pass_in'.$i.'">');
}
else echo(' <em>(Создать новую группу)</em>');
echo '<BR />';
}
echo '<INPUT TYPE="submit" value="Вступить" name="pay"></FORM>';
if($pay_err) echo ($pay_err);
echo '<tr><td><FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="bps"></FORM></td></tr>';
$pass_s = getPass();
if ($_POST['pay']) {
if (!$_POST['pay_gr']) $_POST['pay_gr'] = 1;
$group_num = mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$_POST['pay_gr']}';"));
$cit_haos_pl = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='" . $_POST['pay_gr'] . "' LIMIT 1;"));
$gps = $_POST['gr_pass_in' . $_POST['pay_gr']];
if ($gps)
$gps = str_replace(" ", "", $gps);
if ($group_num < 4)
if ($user['hp'] >= (int)($user['maxhp'] / 3) && !$owntravma[0])
if ($user['money'] >= 20)
if (
!preg_match('/[\/\:*?"<>|+%]/', $gps) &&
(
($gps == $cit_haos_pl['password'] && strlen($cit_haos_pl['password']) > 1) ||
(strlen($cit_haos_pl['players']) < 3)
)
) {
mysql_query("UPDATE `cit_haos_status` SET `status` = '1',`group` = '{$_POST['pay_gr']}' WHERE `id` ='{$user['id']}'; ");
mysql_query("UPDATE `users` set `money` = `money`- '20' WHERE id = '{$user['id']}';");
$cit_haos_gr = mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_var`;"));
if ($_POST['pay_gr'] > $cit_haos_gr)
mysql_query("INSERT INTO `cit_haos_var`(`group`,`password`) values('" . $_POST['pay_gr'] . "','" . $pass_s . "');");
$cit_haos_pl = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='" . $_POST['pay_gr'] . "' LIMIT 1;"));
if (!in_array($user['id'], explode(";", $cit_haos_pl['players']))) {
if ($cit_haos_pl['players'] != '')
$ch_pl_t = $cit_haos_pl['players'] . ";" . $user['id'];
else
$ch_pl_t = $user['id'];
mysql_query("UPDATE `cit_haos_var` SET `players`='{$ch_pl_t}' WHERE `group`='" . $_POST['pay_gr'] . "';");
}
} else ($pass_in_err = "Неверный пароль!");
else ($pay_err = "Недостаточно денег для подачи стартового взноса!");
else ($pay_err = "Вы слишком ослаблены либо травмированы! ");
else ($pay_err = "Группа уже набрана!");
}
elseif ($in_haos['status']==1)
{
//echo '<tr><td><FORM action="c_haos.php" method=POST>Начать первый рейд: <INPUT TYPE="submit" value="Готов!" name="join_raid"></FORM></td></tr>';
$cit_haos_pl=mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='".$in_haos['group']."' LIMIT 1;"));
echo '<tr><td>Рейд начинается <b>'.date("j.m </b> в <b> H:i</b>",$cit_haos_t['value']+900).'</td></tr>';
echo("<tr><td>Ждем начала рейда...<br /></td></tr>");
echo("<tr><td>Ваша группа ");
if($cit_haos_pl['password']!='')
echo(":: <strong>Пароль - [".$cit_haos_pl['password']."]</strong> <br />");
//else
//echo(" - <em>без пароля</em><br />");
if($pass_err) echo($pass_err."<br />");
$num=mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE `group`='".$in_haos['group']."';"));
echo("<br /><b>".$num."</b> из <b>4</b>");
//if($num==1) echo (" - <strong>Группа не набрана</strong>");
/*else*/if($num==4) echo (" - <strong>Группа заполнена</strong>");
echo("<br />");
$cit_haos_pl=mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='".$in_haos['group']."' LIMIT 1;"));
foreach(explode(";",$cit_haos_pl['players']) as $ch_p)
echo(Nick::id($ch_p)->full(1)."<br />");
echo("</td></tr>");
if ($_POST['adm_start_raid'] && $user['id'] == 1256) {
mysql_query("DELETE FROM `cit_haos_status`;");
mysql_query("DELETE FROM `cit_haos_var`;");
AddChatSystem('<font color=red>Начинается прием заявок в рейд на Цитадель Хаоса! Начало рейда через 15 минут.</font>');
$ch_time = time();
mysql_query("UPDATE variables SET value='{$ch_time}' where var='cit_haos_time';");
}
elseif ($in_haos['status']==2)
{
echo '<tr><td>';
if($wait_msg) echo ($wait_msg);
echo'</td></tr>';
//echo '<tr><td><FORM action="c_haos.php" method=POST>Еще рейд: <INPUT TYPE="submit" value="Группа 1" name="join_raid"></FORM></td></tr>';
if ($_POST['test_start_raid'] && $user['id'] == 1256) {
mysql_query("DELETE FROM `cit_haos_status`;");
mysql_query("DELETE FROM `cit_haos_var`;");
// AddChatSystem('<font color=red>Начинается прием заявок в рейд на Цитадель Хаоса! Начало рейда через 15 минут.</font>');
$ch_time = time();
mysql_query("UPDATE variables SET value='{$ch_time}' where var='cit_haos_time';");
}
if ($in_haos['room'] != 0 && $in_haos['status'] == 2) {
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '601',`online`.`room` = '601' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;");
header('location: c_haos_in.php');
}
elseif ($in_haos['status']==4)
{
mysql_query("DELETE FROM `cit_haos_status` WHERE `id` ='{$user['id']}'; ");
echo '<tr><td><FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="bps"></FORM></td></tr>';
}
elseif ($in_haos['status']==5)
{
mysql_query("UPDATE users SET `doblest`=`doblest`+'1' WHERE `id` = '".$user['id']."';");
addchp ('За убийство босса ЦХ вы получили 1 доблести','{[]}'.Nick::id($user['id'])->short().'{[]}');
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`)
VALUES ('','0','{$cur_user['id']}','\"".$user['login']."\" получил в ЦХ 1 доблести',1,'".time()."');");
mysql_query("DELETE FROM `cit_haos_status` WHERE `id` ='{$user['id']}'; ");
header('location: c_haos.php');
/*echo '<tr><td><FORM action="c_haos.php" method=POST>Начать новый рейд: <INPUT TYPE="submit" value="Готов!" name="join_raid"></FORM></td></tr>';*/
}
?>
}
if ($in_haos['status'] == 2) {
$group_num = mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$in_haos['group']}';"));
$group_ready = mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE (`status` = '2' AND `group` = '{$in_haos['group']}');"));
if ($group_num == $group_ready && $group_ready > 0) {
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '601',`online`.`room` = '601' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;");
mysql_query("UPDATE `cit_haos_status` SET room='1' WHERE id = '{$user['id']}'; ");
header('location: c_haos_in.php');
}
}
$in_haos = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_status` WHERE `id` = '{$user['id']}' LIMIT 1;"));
Template::header('Цитадель Хаоса');
?>
<!-- JS -->
<script>
function refreshPeriodic() {
location.href = 'c_haos.php';//reload()
timerID = setTimeout("refreshPeriodic()", 30000);
}
timerID = setTimeout("refreshPeriodic()", 30000);
</script>
<TABLE border=0 width=600 cellspacing="0" cellpadding="0" align=left>
<tr>
<td><h3>Цитадель Хаоса</td>
</tr>
<?php
$tm = time();
$cit_haos_t = mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE `var` = 'cit_haos_time' LIMIT 1;"));
if ($tm < $cit_haos_t['value'] || $tm > ($cit_haos_t['value'] + 900))//def 900
{
$tob_all = [];
mysql_query("DELETE FROM `cit_haos_var` WHERE CHAR_LENGTH(players)<3;");
if ($in_haos['status'] == 1) {
$dbb = mysql_query("SELECT * FROM `cit_haos_var`;");
while ($ch_tob = mysql_fetch_array($dbb)) {
if (!in_array($ch_tob['players'], $tob_all)) {
$tob_all = $tob_all . ";" . $ch_tob['players'];
}
}
foreach (explode(";", $tob_all) as $tob) {
mysql_query("UPDATE `cit_haos_status` SET status='2' WHERE id = '{$tob}'; ");
}
}
$tm = time();
$test_tm = time() + 900;
$show_tm = $cit_haos_t['value'] + 0.5 * 24 * 60 * 60;
switch (date("N", $show_tm)) {
default:
case 1:
$d_o = "в понедельник";
break;
case 2:
$d_o = "во вторник";
break;
case 3:
$d_o = "в среду";
break;
case 4:
$d_o = "в четверг";
break;
case 5:
$d_o = "в пятницу";
break;
case 6:
$d_o = "в субботу";
break;
case 7:
$d_o = "в воскресение";
break;
}
if ($tm < $cit_haos_t['value']) {
echo '<tr><td>Следующий рейд начнется <b>' . date("j.m </b> в <b> H:i</b>", $cit_haos_t['value']) . '</td></tr>';
} else {
echo '<tr><td>Готовьтесь! Следующий рейд будет <b>' . $d_o . '</td></tr>';
}
echo '<tr><td><FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="bps"></FORM></td></tr>';
if ($user['id'] == 1256) {
echo '<tr><td><FORM method=POST><INPUT TYPE="submit" value="Тест (Начать рейд)" name="test_start_raid"><br></FORM></td></tr>
<tr><td><FORM method=POST><INPUT TYPE="submit" value="Админ - Начать рейд" name="adm_start_raid"><br></FORM></td></tr>';
}
} elseif ($in_haos['status'] == 0) {
$cit_haos_gr = mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_var`;"));
if ($cit_haos_gr == 0) {
$pass_s = getPass();
mysql_query("INSERT INTO `cit_haos_var`(`group`,`password`) values('1','{$pass_s}');");
$cit_haos_gr = mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_var`;"));
}
echo '<tr><td>Рейд начинается <b>' . date("j.m </b> в <b> H:i</b>", $cit_haos_t['value'] + 900) . '</td></tr>';
echo '<tr><td><FORM action="c_haos.php" method=POST>Взнос за участие в рейде <strong>20 кр</strong><br>';
echo '<tr><td><FORM action="c_haos.php" method=POST>Максимальный размер группы - <strong>4</strong> участника<br>';
echo '<tr><td>' . $pass_in_err . '<br />';
$check_em = mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE `group`=1 ;"));
if ($check_em < 1) {
$i = 1;
echo '<INPUT TYPE="radio" value="' . $i . '" name="pay_gr">Группа ' . $i . ":";
$cit_haos_pl = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='" . $i . "' LIMIT 1;"));
if ($cit_haos_pl['players'] != '') {
foreach (explode(";", $cit_haos_pl['players']) as $ch_p) {
echo Nick::id($ch_p)->full(1) . ",";
}
echo 'Пароль:<input type="text" size="10" NAME="gr_pass_in' . $i . '">';
} else {
echo ' <em>(Создать новую группу)</em>';
}
echo '<BR>';
} else {
for ($i = 1; $i <= $cit_haos_gr + 1; $i++) {
echo '<INPUT TYPE="radio" value="' . $i . '" name="pay_gr">Группа ' . $i . ":";
$cit_haos_pl = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='" . $i . "' LIMIT 1;"));
if (strlen($cit_haos_pl['players']) > 1) {
foreach (explode(";", $cit_haos_pl['players']) as $ch_p) {
echo Nick::id($ch_p)->full(1) . ",";
}
echo 'Пароль:<input type="text" size="10" NAME="gr_pass_in' . $i . '">';
} else {
echo ' <em>(Создать новую группу)</em>';
}
echo '<BR />';
}
}
echo '<INPUT TYPE="submit" value="Вступить" name="pay"></FORM>';
if ($pay_err) {
echo $pay_err;
}
echo '<tr><td><FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="bps"></FORM></td></tr>';
} elseif ($in_haos['status'] == 1) {
echo '<tr><td><FORM action="c_haos.php" method=POST>Начать первый рейд: <INPUT TYPE="submit" value="Готов!" name="join_raid"></FORM></td></tr>';
$cit_haos_pl = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='" . $in_haos['group'] . "' LIMIT 1;"));
echo '<tr><td>Рейд начинается <b>' . date("j.m </b> в <b> H:i</b>", $cit_haos_t['value'] + 900) . '</td></tr>';
echo "<tr><td>Ждем начала рейда...<br /></td></tr>";
echo "<tr><td>Ваша группа ";
if (!empty($cit_haos_pl['password'])) {
echo ":: <strong>Пароль - [" . $cit_haos_pl['password'] . "]</strong> <br />";
}
if ($pass_err) {
echo $pass_err . "<br />";
}
$num = mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE `group`='" . $in_haos['group'] . "';"));
echo "<br /><b>" . $num . "</b> из <b>4</b>";
if ($num == 4) {
echo " - <strong>Группа заполнена</strong>";
}
echo "<br />";
$cit_haos_pl = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='" . $in_haos['group'] . "' LIMIT 1;"));
foreach (explode(";", $cit_haos_pl['players']) as $ch_p) {
echo Nick::id($ch_p)->full(1) . "<br />";
}
echo "</td></tr>";
} elseif ($in_haos['status'] == 2) {
echo '<tr><td>';
if ($wait_msg) {
echo $wait_msg;
}
echo '</td></tr>';
header('location: c_haos_in.php');
} elseif ($in_haos['status'] == 4) {
mysql_query("DELETE FROM `cit_haos_status` WHERE `id` ='{$user['id']}'; ");
echo '<tr><td><FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="bps"></FORM></td></tr>';
} elseif ($in_haos['status'] == 5) {
mysql_query("UPDATE users SET `doblest`=`doblest`+'1' WHERE `id` = '" . $user['id'] . "';");
addchp('За убийство босса ЦХ вы получили 1 доблести', '{[]}' . Nick::id($user['id'])->short() . '{[]}');
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`)
VALUES ('','0','{$cur_user['id']}','\"" . $user['login'] . "\" получил в ЦХ 1 доблести',1,'" . time() . "');");
mysql_query("DELETE FROM `cit_haos_status` WHERE `id` ='{$user['id']}'; ");
header('location: c_haos.php');
}
?>
</table>
<div align=right><img width="260" src="i/zitadel/1.jpg" /></div>
<?php
?>
</BODY>
</HTML>
<div align=right><img width="260" src="i/zitadel/1.jpg"/></div>

View File

@ -1,427 +1,370 @@
<?php
session_start();
if (!($_SESSION['uid'] >0)) header("Location: index.php");
include "config.php";
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
$in_haos = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_status` WHERE `id` = '{$user['id']}' LIMIT 1;"));
include "functions.php";
$wait_msg="Ждем готовности всей группы...";
//rooms
$ch_rooms=array
(
session_start();
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
include "functions.php";
$in_haos = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_status` WHERE `id` = '{$user['id']}' LIMIT 1;"));
$wait_msg = "Ждем готовности всей группы...";
//rooms
$ch_rooms = [
// 0 - empty
"1"=>"Ворота (1)",
"2"=>"Двор (2)",
"3"=>"Внешний корридор (3)",
"4"=>"Спуск в подвал (4)",
"5"=>"Подвал (5)",//босс Душа
"6"=>"Люк на Западную стену (6)",
"7"=>"Западная стена (7)",
"8"=>"Галерея Страха (8)",
"9"=>"Западная башня (9)",
"10"=>"Галерея Смерти (10)",//босс Зомби
"11"=>"Проход к Северной стене (11)",
"12"=>"Галерея Тьмы (12)",
"13"=>"Северная стена (13)",
"14"=>"Галерея Бликов (14)",
"15"=>"Внутренний корридор (15)",//босс Повелитель
"16"=>"Гостевая (16)",
"17"=>"Руины Северной башни (17)",
"18"=>"Поминальная комната (18)",
"19"=>"Галерея Порталов (19)",
"20"=>"Зал Посвященных (20)",//босс Хромой Билли
"21"=>"Старая лестница (21)",
"22"=>"Трофейная (22)",
"23"=>"Костяной зал (23)",
"24"=>"Склеп (24)",
"25"=>"Лабиринт (25)",//босс Мародер
"26"=>"Тронный зал (26)",
"27"=>"Тайный корридор (27)",
"28"=>"Комната прислуги (28)",
"29"=>"Королевские покои (29)",
"30"=>"Переход (30)"//босс Грохобот
);
//bots
$ch_bots=array();
//1 - упырь
//2 - падший
//3 - душа
$db=mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='".$in_haos['group']."' limit 1; "));
if(!$db['bots'])
{
$bot_low=array
(
"1" => "Ворота (1)",
"2" => "Двор (2)",
"3" => "Внешний корридор (3)",
"4" => "Спуск в подвал (4)",
"5" => "Подвал (5)",//босс Душа
"6" => "Люк на Западную стену (6)",
"7" => "Западная стена (7)",
"8" => "Галерея Страха (8)",
"9" => "Западная башня (9)",
"10" => "Галерея Смерти (10)",//босс Зомби
"11" => "Проход к Северной стене (11)",
"12" => "Галерея Тьмы (12)",
"13" => "Северная стена (13)",
"14" => "Галерея Бликов (14)",
"15" => "Внутренний корридор (15)",//босс Повелитель
"16" => "Гостевая (16)",
"17" => "Руины Северной башни (17)",
"18" => "Поминальная комната (18)",
"19" => "Галерея Порталов (19)",
"20" => "Зал Посвященных (20)",//босс Хромой Билли
"21" => "Старая лестница (21)",
"22" => "Трофейная (22)",
"23" => "Костяной зал (23)",
"24" => "Склеп (24)",
"25" => "Лабиринт (25)",//босс Мародер
"26" => "Тронный зал (26)",
"27" => "Тайный корридор (27)",
"28" => "Комната прислуги (28)",
"29" => "Королевские покои (29)",
"30" => "Переход (30)"//босс Грохобот
];
//bots
$ch_bots = [];
//1 - упырь
//2 - падший
//3 - душа
$db = mysql_fetch_array(mysql_query("SELECT * FROM `cit_haos_var` WHERE `group`='" . $in_haos['group'] . "' limit 1; "));
if (!$db['bots']) {
$bot_low = [
// 0 - empty
"1"=>"Упырь",
"2"=>"Посланник смерти",
"3"=>"Падший",
"4"=>"Отморозок",
"5"=>"Проклятие глубин"
);
for($i=1;$i<=30;$i++)
{
$ch_get_bot=rand(1,5);
$ch_bots[$i]=array("0"=>$bot_low[$ch_get_bot]);
}
$ch_bots[5]=array("0"=>"Душа");
$ch_bots[10]=array("0"=>"Зомби");
$ch_bots[15]=array("0"=>"Повелитель");
$ch_bots[20]=array("0"=>"Хромой Билли");
$ch_bots[25]=array("0"=>"Мародер");
$ch_bots[30]=array("0"=>"Грохобот");
$dbb=serialize($ch_bots);
mysql_query("UPDATE `cit_haos_var` SET bots='".$dbb."' WHERE `group`='".$in_haos['group']."'; ");
"1" => "Упырь",
"2" => "Посланник смерти",
"3" => "Падший",
"4" => "Отморозок",
"5" => "Проклятие глубин"
];
for ($i = 1; $i <= 30; $i++) {
$ch_get_bot = rand(1, 5);
$ch_bots[$i] = ["0" => $bot_low[$ch_get_bot]];
}
else
{
$ch_bots=unserialize($db['bots']);
$ch_bots[5] = ["0" => "Душа"];
$ch_bots[10] = ["0" => "Зомби"];
$ch_bots[15] = ["0" => "Повелитель"];
$ch_bots[20] = ["0" => "Хромой Билли"];
$ch_bots[25] = ["0" => "Мародер"];
$ch_bots[30] = ["0" => "Грохобот"];
$dbb = serialize($ch_bots);
mysql_query("UPDATE `cit_haos_var` SET bots='" . $dbb . "' WHERE `group`='" . $in_haos['group'] . "'; ");
} else {
$ch_bots = unserialize($db['bots']);
}
// комната - опыт == доблесть
$ch_priz = [
"5" => [100, 1],
"10" => [200, 2],
"15" => [300, 3],
"20" => [400, 4],
"25" => [500, 5],
"30" => [600, 10]
];
// комната - кирка == уник_7 == цветок == уник_8
$ch_drop = [
"25" => [10, 60, 95, 100],
"30" => [3, 6, 7, 8],
];
$priz_low =
["727"];
$priz_med =
["775", "776", "777", "778"];
$priz_flow =
["14"];
$priz_high =
["803", "804", "805", "806"];
/*$ch_bots[1]=array
(
"0"=>"Младший страж глубин",
"1"=>"Младший страж глубин",
"2"=>"Босс глубин"
);
$ch_bots[2]=array
(
"0"=>"Младший страж глубин",
"1"=>"Босс глубин"
);*/
if ($user->room != 601) {
header("Location: main.php");
exit;
}
if ($user->battle) {
header('location: fbattle.php');
exit;
}
if ($in_haos['status'] == 4) {
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '600',`online`.`room` = '600' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;");
mysql_query("UPDATE `cit_haos_status` SET room='0',bot='0',group='0' WHERE id = '{$user['id']}'; ");
header('location: c_haos.php');
}
if (!$ch_rooms[$in_haos['room']]) {
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '600',`online`.`room` = '600' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;");
if ($in_haos['status'] == 2) {
mysql_query("UPDATE `cit_haos_status` SET room='0',status='5',bot='0' WHERE id = '{$user['id']}'; ");
addchp('Вы пробились до двери на 2 уровень подземелий Цитадели Хаоса. Только опытный воин и храбрый страж сможет пройти через нее (10 уровень, страж 2 уровня)', '{[]}' . Nick::id($user['id'])->short() . '{[]}');
}
// комната - опыт == доблесть
$ch_priz=array
(
"5" => array (100,1),
"10" => array (200,2),
"15" => array (300,3),
"20" => array (400,4),
"25" => array (500,5),
"30" => array (600,10)
);
// комната - кирка == уник_7 == цветок == уник_8
$ch_drop=array
(
"25" => array (10,60,95,100),
"30" => array (3,6,7,8),
);
$priz_low=
array("727");
$priz_med=
array("775","776","777","778");
$priz_flow=
array("14");
$priz_high=
array("803","804","805","806");
/*$ch_bots[1]=array
(
"0"=>"Младший страж глубин",
"1"=>"Младший страж глубин",
"2"=>"Босс глубин"
);
$ch_bots[2]=array
(
"0"=>"Младший страж глубин",
"1"=>"Босс глубин"
);*/
if ($user['room'] != 601) { header("Location: main.php"); die(); }
if ($user['battle'] != 0) { header('location: fbattle.php'); die(); }
if ($in_haos['status'] == 4)
{
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '600',`online`.`room` = '600' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;");
mysql_query("UPDATE `cit_haos_status` SET room='0',bot='0',group='0' WHERE id = '{$user['id']}'; ");
header('location: c_haos.php');
}
if (!$ch_rooms[$in_haos['room']])
{
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '600',`online`.`room` = '600' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;");
if ($in_haos['status'] == 2)
{
mysql_query("UPDATE `cit_haos_status` SET room='0',status='5',bot='0' WHERE id = '{$user['id']}'; ");
addchp ('Вы пробились до двери на 2 уровень подземелий Цитадели Хаоса. Только опытный воин и храбрый страж сможет пройти через нее (10 уровень, страж 2 уровня)','{[]}'.Nick::id($user['id'])->short().'{[]}');
mysql_query("UPDATE `cit_haos_var` SET bots='',players='' WHERE group='" . $in_haos['group'] . "'; ");
header('location: c_haos.php');
}
Template::header('c_haos_in');
?>
<script>
function refreshPeriodic() {
location.href = 'c_haos_in.php';//reload()
timerID = setTimeout("refreshPeriodic()", 30000);
}
timerID = setTimeout("refreshPeriodic()", 30000);
</script>
<TABLE border=0 width=340 cellspacing="0" cellpadding="0" align=left>
<tr>
<td><h3>Цитадель Хаоса: <?= $ch_rooms[$in_haos['room']] ?><br/>
<br/></td>
</tr>
<?php
//attack
if ($_POST['go_attack']) {
if ($in_haos['status'] == 2) {
$bot_name = $ch_bots[$in_haos['room']][$in_haos['bot']];
switch ($bot_name) {
case "Упырь":
$bot_id = 2897;
$bot_count = rand(10, 30);
break;
case "Падший":
$bot_id = 2903;
$bot_count = rand(3, 9);
break;
case "Посланник смерти":
$bot_id = 2896;
$bot_count = 2;
break;
case "Отморозок":
$bot_id = 2893;
$bot_count = 3;
break;
case "Проклятие глубин":
$bot_id = 2892;
$bot_count = rand(1, 5);
break;
case "Душа":
$bot_id = 2895;
$bot_count = 1;
break;
case "Зомби":
$bot_id = 2901;
$bot_count = 5;
break;
case "Повелитель":
$bot_id = 2902;
$bot_count = 1;
break;
case "Хромой Билли":
$bot_id = 2898;
$bot_count = 1;
break;
case "Мародер":
$bot_id = 2899;
$bot_count = 1;
break;
case "Грохобот":
$bot_id = 2900;
$bot_count = 1;
break;
}
mysql_query("UPDATE `cit_haos_var` SET bots='',players='' WHERE group='".$in_haos['group']."'; ");
header('location: c_haos.php');
}
?>
<HTML><HEAD>
<!-- JS -->
<script>
function refreshPeriodic()
{
location.href='c_haos_in.php';//reload()
timerID=setTimeout("refreshPeriodic()",30000);
}
timerID=setTimeout("refreshPeriodic()",30000);
</script>
<link rel=stylesheet type="text/css" href="css/main.css">
<meta content="text/html; charset=utf-8" http-equiv=Content-type>
<META Http-Equiv=Cache-Control Content=no-cache>
<meta http-equiv=PRAGMA content=NO-CACHE>
<META Http-Equiv=Expires Content=0>
</HEAD>
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor=#d4d4d4>
<TABLE border=0 width=340 cellspacing="0" cellpadding="0" align=left>
<tr><td><h3>Цитадель Хаоса: <?= $ch_rooms[$in_haos['room']]?><br />
<br /></td></tr>
<!--tr><td><FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="bps"></FORM></td></tr-->
<?php
//attack
if($_POST['go_attack'])
{
if($in_haos['status'] == 2)
{
$bot_name=$ch_bots[$in_haos['room']][$in_haos['bot']];
switch ($bot_name)
{
case "Упырь":
//$bot_hp=200;
$bot_id=2897;
$bot_count=rand(10,30);
break;
case "Падший":
//$bot_hp=300;
$bot_id=2903;
$bot_count=rand(3,9);
break;
case "Посланник смерти":
//$bot_hp=700;
$bot_id=2896;
$bot_count=2;
break;
case "Отморозок":
//$bot_hp=500;
$bot_id=2893;
$bot_count=3;
break;
case "Проклятие глубин":
//$bot_hp=1000;
$bot_id=2892;
$bot_count=rand(1,5);
break;
case "Душа":
//$bot_hp=1000;
$bot_id=2895;
$bot_count=1;
break;
case "Зомби":
//$bot_hp=1000;
$bot_id=2901;
$bot_count=5;
break;
case "Повелитель":
//$bot_hp=2000;
$bot_id=2902;
$bot_count=1;
break;
case "Хромой Билли":
//$bot_hp=3000;
$bot_id=2898;
$bot_count=1;
break;
case "Мародер":
//$bot_hp=5000;
$bot_id=2899;
$bot_count=1;
break;
case "Грохобот":
//$bot_hp=10000;
$bot_id=2900;
$bot_count=1;
break;
};
$b_pers=mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id='{$bot_id}' LIMIT 1;"));;
$bot_hp=$b_pers['maxhp'];
$bots=array();
$group_raw=mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$in_haos['group']}' AND status='2';");
while ($gr = mysql_fetch_array($group_raw))
{
addchp ('<font color=red>Внимание!</font> '.$bot_name.' напал на Вашу группу!','{[]}'.Nick::id($gr['id'])->short().'{[]}');
$b_pers = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id='{$bot_id}' LIMIT 1;"));
$bot_hp = $b_pers['maxhp'];
$bots = [];
$group_raw = mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$in_haos['group']}' AND status='2';");
while ($gr = mysql_fetch_array($group_raw)) {
addchp('<font color=red>Внимание!</font> ' . $bot_name . ' напал на Вашу группу!', '{[]}' . Nick::id($gr['id'])->short() . '{[]}');
}
for($bot_c=0;$bot_c<$bot_count;$bot_c++)
{
$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '".$bot_name."%';"));
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`) values ('".$bot_name." ".($nb[0]+1)."','".$bot_id."','','".$bot_hp."');");
$bot = mysql_insert_id();
$bots[]=$bot;
}
// командный вход
$group_fight=array();
$group_raw=mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$in_haos['group']}' AND status='2';");
while ($gr = mysql_fetch_array($group_raw))
$group_fight[]=$gr['id'];
{
$teams = array();
foreach($bots as $b)
foreach($group_fight as $gf)
{
$teams[$gf][$b] = array(0,0,time());
$teams[$b][$gf] = array(0,0,time());
for ($bot_c = 0; $bot_c < $bot_count; $bot_c++) {
$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '" . $bot_name . "%';"));
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`) values ('" . $bot_name . " " . ($nb[0] + 1) . "','" . $bot_id . "','','" . $bot_hp . "');");
$bot = mysql_insert_id();
$bots[] = $bot;
}
// командный вход
$group_fight = [];
$group_raw = mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$in_haos['group']}' AND status='2';");
while ($gr = mysql_fetch_array($group_raw)) {
$group_fight[] = $gr['id'];
}
$teams = [];
foreach ($bots as $b) {
foreach ($group_fight as $gf) {
$teams[$gf][$b] = [0, 0, time()];
$teams[$b][$gf] = [0, 0, time()];
mysql_query("UPDATE `cit_haos_status` SET `status` = '3' WHERE `id` ='{$gf}'; ");
}
mysql_query("INSERT INTO `battle`
}
mysql_query("INSERT INTO `battle`
(
`id`,`coment`,`teams`,`timeout`,`type`,`status`,`t1`,`t2`,`to1`,`to2`
)
VALUES
(
NULL,'','".serialize($teams)."','3','1','0','".implode(";", $group_fight)."','".implode(";", $bots)."','".time()."','".time()."'
NULL,'','" . serialize($teams) . "','3','1','0','" . implode(";", $group_fight) . "','" . implode(";", $bots) . "','" . time() . "','" . time() . "'
)");
$id = mysql_insert_id();
// апдейтим бота
foreach($bots as $b) mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE `id` = {$b} LIMIT 1;");
// создаем лог
//$rr = "<b>".nick3($user['id'])."</b> и <b>".nick3($bot)."</b>";
//addlog($id,"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." сошлись в поединке. <BR>");
}
foreach($group_fight as $gf) mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$gf};");
//}
die("<script>location.href='fbattle.php';</script>");
}
}
$group_num=mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$in_haos['group']}';"));
$group_ready=mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE (`room` = '{$in_haos['room']}' AND `group` = '{$in_haos['group']}');"));
$cit_haos_t=mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE `var` = 'cit_haos_time' LIMIT 1;"));
$tm=time();
if($in_haos['status'] == 2)
{if(($tm>($cit_haos_t['value']+960))||($tm<($cit_haos_t['value']-600)))//def 960
{
$flag_ref=1;
foreach($ch_bots[$in_haos['room']] as $bot_id=>$bot_name)
if($bot_id>=$in_haos['bot'])
{
echo '<tr><td><FORM action="c_haos_in.php" method=POST>';
if($bot_id==$in_haos['bot']) echo'<strong>'.$bot_name.'</strong>'; else echo($bot_name);
if($bot_id==$in_haos['bot']) echo' - <INPUT TYPE="submit" value="Напасть" name="go_attack">';
echo ' </FORM></td></tr>';
$flag_ref=0;
}
if (!array_key_exists($in_haos['bot'],$ch_bots[$in_haos['room']]))
{
echo($wait_msg);
//проверяем есть ли приз
if(array_key_exists($in_haos['room'],$ch_priz))
{
$priz_exp=$ch_priz[$in_haos['room']][0];
$priz_dobl=$ch_priz[$in_haos['room']][1];
}
else
{
$priz_exp=0;
$priz_dobl=0;
}
if(array_key_exists($in_haos['room'],$ch_drop))
{
$got_drop=rand(0,400);//100 - norm, 400 - 25%
}
else
{
$got_drop=-1;
}
//выбираем приз
if($in_haos['room']<30)
{
if($got_drop>=0 && $got_drop<$ch_drop[$in_haos['room']][0])
{
$rand_k = array_rand($priz_low, 1);
$p_id=$priz_low[$rand_k];
$p_shop="shop";
}
elseif($got_drop>=$ch_drop[$in_haos['room']][0] && $got_drop<$ch_drop[$in_haos['room']][1])
{
$rand_k = array_rand($priz_med, 1);
$p_id=$priz_med[$rand_k];
$p_shop="shop";
}
elseif($got_drop>=$ch_drop[$in_haos['room']][1] && $got_drop<$ch_drop[$in_haos['room']][2])
{
$rand_k = array_rand($priz_flow, 1);
$p_id=$priz_flow[$rand_k];
$p_shop="fshop";
}
elseif($got_drop>=$ch_drop[$in_haos['room']][2] && $got_drop<=$ch_drop[$in_haos['room']][3])
{
$rand_k = array_rand($priz_high, 1);
$p_id=$priz_high[$rand_k];
$p_shop="shop";
}
}
elseif($in_haos['room']==30)
{
if($got_drop<=200)//400max/4=>50%
{
$priz_low=
array("808","809");
$rand_k = array_rand($priz_low, 1);
$p_id=$priz_low[$rand_k];
$p_shop="shop";
$id = mysql_insert_id();
// апдейтим бота
foreach ($bots as $b) {
mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE `id` = {$b} LIMIT 1;");
}
foreach ($group_fight as $gf) {
mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$gf};");
}
exit("<script>location.href='fbattle.php';</script>");
}
//выбираем получателя
$all_get=array();
$gr_raw=mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$in_haos['group']}';");
while($g_id=mysql_fetch_array($gr_raw))
$all_get[]=$g_id['id'];
$l_id=rand(0,count($all_get)-1);
//$all_get[$l_id];
//if($priz_exp>0) addchp ('CH get priz - '.$all_get[$l_id],'{[]}'.nick7 (1258).'{[]}');
//даем призы
if($p_id>0)
}
$group_num = mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$in_haos['group']}';"));
$group_ready = mysql_num_rows(mysql_query("SELECT * FROM `cit_haos_status` WHERE (`room` = '{$in_haos['room']}' AND `group` = '{$in_haos['group']}');"));
$cit_haos_t = mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE `var` = 'cit_haos_time' LIMIT 1;"));
$tm = time();
if ($in_haos['status'] == 2) {
if (($tm > ($cit_haos_t['value'] + 960)) || ($tm < ($cit_haos_t['value'] - 600)))//def 960
{
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `{$p_shop}` WHERE `id` = '{$p_id}' LIMIT 1;"));
mysql_query("INSERT INTO `inventory`
$flag_ref = 1;
foreach ($ch_bots[$in_haos['room']] as $bot_id => $bot_name)
if ($bot_id >= $in_haos['bot']) {
echo '<tr><td><FORM action="c_haos_in.php" method=POST>';
if ($bot_id == $in_haos['bot']) echo '<strong>' . $bot_name . '</strong>'; else echo($bot_name);
if ($bot_id == $in_haos['bot']) echo ' - <INPUT TYPE="submit" value="Напасть" name="go_attack">';
echo ' </FORM></td></tr>';
$flag_ref = 0;
}
if (!array_key_exists($in_haos['bot'], $ch_bots[$in_haos['room']])) {
echo($wait_msg);
//проверяем есть ли приз
if (array_key_exists($in_haos['room'], $ch_priz)) {
$priz_exp = $ch_priz[$in_haos['room']][0];
$priz_dobl = $ch_priz[$in_haos['room']][1];
} else {
$priz_exp = 0;
$priz_dobl = 0;
}
if (array_key_exists($in_haos['room'], $ch_drop)) {
$got_drop = rand(0, 400);//100 - norm, 400 - 25%
} else {
$got_drop = -1;
}
//выбираем приз
if ($in_haos['room'] < 30) {
if ($got_drop >= 0 && $got_drop < $ch_drop[$in_haos['room']][0]) {
$rand_k = array_rand($priz_low, 1);
$p_id = $priz_low[$rand_k];
$p_shop = "shop";
} elseif ($got_drop >= $ch_drop[$in_haos['room']][0] && $got_drop < $ch_drop[$in_haos['room']][1]) {
$rand_k = array_rand($priz_med, 1);
$p_id = $priz_med[$rand_k];
$p_shop = "shop";
} elseif ($got_drop >= $ch_drop[$in_haos['room']][1] && $got_drop < $ch_drop[$in_haos['room']][2]) {
$rand_k = array_rand($priz_flow, 1);
$p_id = $priz_flow[$rand_k];
$p_shop = "fshop";
} elseif ($got_drop >= $ch_drop[$in_haos['room']][2] && $got_drop <= $ch_drop[$in_haos['room']][3]) {
$rand_k = array_rand($priz_high, 1);
$p_id = $priz_high[$rand_k];
$p_shop = "shop";
}
} elseif ($in_haos['room'] == 30) {
if ($got_drop <= 200)//400max/4=>50%
{
$priz_low =
["808", "809"];
$rand_k = array_rand($priz_low, 1);
$p_id = $priz_low[$rand_k];
$p_shop = "shop";
}
}
//выбираем получателя
$all_get = [];
$gr_raw = mysql_query("SELECT * FROM `cit_haos_status` WHERE `group` = '{$in_haos['group']}';");
while ($g_id = mysql_fetch_array($gr_raw)) {
$all_get[] = $g_id['id'];
}
$l_id = rand(0, count($all_get) - 1);
//даем призы
if ($p_id > 0) {
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `{$p_shop}` WHERE `id` = '{$p_id}' LIMIT 1;"));
mysql_query("INSERT INTO `inventory`
(`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`isrep`,
`gsila`,`glovk`,`ginta`,`gintel`,`ghp`,`gnoj`,`gtopor`,`gdubina`,`gmech`,`gfire`,`gwater`,`gair`,`gearth`,`glight`,`ggray`,`gdark`,`needident`,`nsila`,`nlovk`,`ninta`,`nintel`,`nmudra`,`nvinos`,`nnoj`,`ntopor`,`ndubina`,`nmech`,`nfire`,`nwater`,`nair`,`nearth`,`nlight`,`ngray`,`ndark`,
`mfkrit`,`mfakrit`,`mfuvorot`,`mfauvorot`,`bron1`,`bron2`,`bron3`,`bron4`,`maxu`,`minu`,`magic`,`nlevel`,`nalign`,`dategoden`,`goden`,`otdel`,`gmp`,`gmeshok`,`encicl`,`artefact`,`duration`,`present`
)
VALUES
('{$dress['id']}','{$all_get[$l_id]}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}',
'{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','".(($dress['goden'])?($dress['goden']*24*60*60+time()):"")."','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','{$dur}','Мусорщик'
'{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','" . (($dress['goden']) ? ($dress['goden'] * 24 * 60 * 60 + time()) : "") . "','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','{$dur}','Мусорщик'
) ;");
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','$all_get[$l_id]','\"".$user['login']."\" получил в ЦХ предмет: \"".$dress['name']."\" ".$dresscount."id:(".$dressid.") [0/".$dress['maxdur']."]',1,'".time()."');");
addchp ('За убийство босса Цитадели Хаоса вы получили '.$dress['name'],'{[]}'.Nick::id($all_get[$l_id])->short().'{[]}');
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','$all_get[$l_id]','\"" . $user['login'] . "\" получил в ЦХ предмет: \"" . $dress['name'] . "\" " . $dresscount . "id:(" . $dressid . ") [0/" . $dress['maxdur'] . "]',1,'" . time() . "');");
addchp('За убийство босса Цитадели Хаоса вы получили ' . $dress['name'], '{[]}' . Nick::id($all_get[$l_id])->short() . '{[]}');
}
if ($priz_exp > 0) {
GiveExp($all_get[$l_id], $priz_exp);
addchp('За убийство босса Цитадели Хаоса вы получили ' . $priz_exp . ' опыта', '{[]}' . Nick::id($all_get[$l_id])->short() . '{[]}');
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`)
VALUES ('','0','{$cur_user['id']}','\"" . $all_get[$l_id] . "\" получил в ЦХ \"" . $priz_exp . "\" опыта',1,'" . time() . "');");
}
if ($priz_dobl > 0) {
mysql_query("UPDATE users SET `doblest`=`doblest`+'" . $priz_dobl . "' WHERE `id` = '" . $all_get[$l_id] . "';");
addchp('За убийство босса Цитадели Хаоса вы получили ' . $priz_dobl . ' доблести', '{[]}' . Nick::id($all_get[$l_id])->short() . '{[]}');
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`)
VALUES ('','0','{$cur_user['id']}','\"" . $all_get[$l_id] . "\" получил в ЦХ \"" . $priz_dobl . "\" доблести',1,'" . time() . "');");
}
mysql_query("UPDATE `cit_haos_status` SET `room` = `room`+1,`bot`=0 WHERE `group` = '{$in_haos['group']}'; ");
if (!headers_sent()) {
header('location: c_haos_in.php');
}
}
if ($flag_ref == 0 && !headers_sent()) {
header('location: c_haos_in.php');
}
} else {
echo "<TR><TD>Ждем готовности группы... Приготовьтесь!</TR></TD>";
echo '<tr><td><FORM action="c_haos_in.php" method=POST><INPUT TYPE="submit" value="Обновить" name="refresh">';
echo ' </FORM></td></tr>';
}
if($priz_exp>0)
{
GiveExp($all_get[$l_id],$priz_exp);
addchp ('За убийство босса Цитадели Хаоса вы получили '.$priz_exp.' опыта','{[]}'.Nick::id($all_get[$l_id])->short().'{[]}');
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`)
VALUES ('','0','{$cur_user['id']}','\"".$all_get[$l_id]."\" получил в ЦХ \"".$priz_exp."\" опыта',1,'".time()."');");
}
if($priz_dobl>0)
{
mysql_query("UPDATE users SET `doblest`=`doblest`+'".$priz_dobl."' WHERE `id` = '".$all_get[$l_id]."';");
addchp ('За убийство босса Цитадели Хаоса вы получили '.$priz_dobl.' доблести','{[]}'.Nick::id($all_get[$l_id])->short().'{[]}');
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`)
VALUES ('','0','{$cur_user['id']}','\"".$all_get[$l_id]."\" получил в ЦХ \"".$priz_dobl."\" доблести',1,'".time()."');");
}
mysql_query("UPDATE `cit_haos_status` SET `room` = `room`+1,`bot`=0 WHERE `group` = '{$in_haos['group']}'; ");
if (!headers_sent()) header('location: c_haos_in.php');
}
if($flag_ref==0 && !headers_sent()) header('location: c_haos_in.php');
}
else
{
echo("<TR><TD>Ждем готовности группы... Приготовьтесь!</TR></TD>");
echo '<tr><td><FORM action="c_haos_in.php" method=POST><INPUT TYPE="submit" value="Обновить" name="refresh">';
echo ' </FORM></td></tr>';
}
}
?>
?>
</table>
<?php
echo('<div align=right><img width="260" src="i/zitadel/'.($in_haos['room']+1).'.jpg" /></div>');
?>
</BODY>
</HTML>
<?php
echo '<div align=right><img width="260" src="i/zitadel/' . ($in_haos['room'] + 1) . '.jpg" /></div>';
?>

View File

@ -1,249 +1,220 @@
<?php
session_start();
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
$in_park = mysql_fetch_array(mysql_query("SELECT * FROM `cit_park` WHERE `id` = '{$user['id']}' LIMIT 1;"));
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = " . $user['id'] . " AND (type=13 OR type=12 OR type=14) limit 1;"));
session_start();
if (!($_SESSION['uid'] >0)) header("Location: index.php");
include "config.php";
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
if (!$in_park) {
mysql_query("INSERT INTO cit_park(id) values('{$user['id']}');");
$in_park = mysql_fetch_array(mysql_query("SELECT * FROM `cit_park` WHERE `id` = '{$user['id']}' LIMIT 1;"));
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = ".$user['id']." AND (type=13 OR type=12 OR type=14) limit 1;"));
if(!$in_park)
{
mysql_query("INSERT INTO cit_park(id) values('{$user['id']}');");
$in_park=mysql_fetch_array(mysql_query("SELECT * FROM `cit_park` WHERE `id` = '{$user['id']}' LIMIT 1;"));
}
include "functions.php";
if ($user['room'] != 602) { header("Location: main.php"); die(); }
if ($user['battle'] != 0) { header('location: fbattle.php'); die(); }
//комнаты парка
$ch_rooms=array
(
}
include "functions.php";
if ($user->room != 602) {
header("Location: main.php");
exit;
}
if ($user->battle) {
header('location: fbattle.php');
exit;
}
//комнаты парка
$ch_rooms = [
// 0 - empty
"1"=>"Площадь (1)",
"2"=>"Аллея Геры (2)",
"3"=>"Фонтан Снов (3)",
"4"=>"Лабиринт Фавна (4)",
"5"=>"Поляна Сказок (5)",//босс Душа
"6"=>"Переулок Зеленый (6)",
"7"=>"Дубрава (7)",
"8"=>"Старая Роща (8)",
"9"=>"Лукоморье (9)",
"10"=>"Золотая Роща (10)",//босс Зомби
"11"=>"Вечная Осень (11)",
"12"=>"Заливные Луга (12)",
"13"=>"Терра Нова (13)",
"14"=>"Гора Райдинг (14)",
"15"=>"Пасифик-Риф (15)"//босс Повелитель
);
// выдаем ботов
$ch_bots=array();
$bot_low=array
("4150","4152","4153","4154","4155","4156");
$bot_high=array
("4157","4158","4159");
if($in_park['bots']=='')
{
for($i=1;$i<=15;$i++)
{
$rand_num=rand(3,7);
$rand_bot='';
for($j=1;$j<=$rand_num;$j++)
{
$rand_bot.=$bot_low[array_rand($bot_low,1)];
$rand_bot.=';';
}
if($i%5==0)
$rand_bot.=$bot_high[array_rand($bot_high,1)];
$rand_bot.=';';
$ch_bots[$i]=$rand_bot;
"1" => "Площадь (1)",
"2" => "Аллея Геры (2)",
"3" => "Фонтан Снов (3)",
"4" => "Лабиринт Фавна (4)",
"5" => "Поляна Сказок (5)",//босс Душа
"6" => "Переулок Зеленый (6)",
"7" => "Дубрава (7)",
"8" => "Старая Роща (8)",
"9" => "Лукоморье (9)",
"10" => "Золотая Роща (10)",//босс Зомби
"11" => "Вечная Осень (11)",
"12" => "Заливные Луга (12)",
"13" => "Терра Нова (13)",
"14" => "Гора Райдинг (14)",
"15" => "Пасифик-Риф (15)"//босс Повелитель
];
// выдаем ботов
$ch_bots = [];
$bot_low = ["4150", "4152", "4153", "4154", "4155", "4156"];
$bot_high = ["4157", "4158", "4159"];
if ($in_park['bots'] == '') {
for ($i = 1; $i <= 15; $i++) {
$rand_num = rand(3, 7);
$rand_bot = '';
for ($j = 1; $j <= $rand_num; $j++) {
$rand_bot .= $bot_low[array_rand($bot_low, 1)];
$rand_bot .= ';';
}
$dbb=serialize($ch_bots);
mysql_query("UPDATE `cit_park` SET bots='{$dbb}' WHERE `id`='{$user['id']}'; ");
if ($i % 5 == 0) {
$rand_bot .= $bot_high[array_rand($bot_high, 1)];
}
$rand_bot .= ';';
$ch_bots[$i] = $rand_bot;
}
else
{
$ch_bots=unserialize($in_park['bots']);
$dbb = serialize($ch_bots);
mysql_query("UPDATE `cit_park` SET bots='{$dbb}' WHERE `id`='{$user['id']}'; ");
} else {
$ch_bots = unserialize($in_park['bots']);
}
// начинаем расчет действий
if ($_POST['start_raid']) {
mysql_query("UPDATE `cit_park` SET `counter`=`counter`+1, `room`=`room`+1 WHERE `id`='{$user['id']}';");
$in_park = mysql_fetch_array(mysql_query("SELECT * FROM `cit_park` WHERE `id` = '{$user['id']}' LIMIT 1;"));
}
//старт боя - началоа
if ($_POST['attack']) {
$bots_raw = explode(";", $ch_bots[$in_park['room']]);
$bots = [];
foreach ($bots_raw as $bot_id) {
if ($bot_id > 0) {
$b_pers = mysql_fetch_array(mysql_query("SELECT `login`,`maxhp` FROM users WHERE id='{$bot_id}' LIMIT 1;"));
$bot_hp = $b_pers['maxhp'];
$bot_name = $b_pers['login'];
$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '" . $bot_name . "%';"));
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`) values ('" . $bot_name . " " . ($nb[0] + 1) . "','" . $bot_id . "','','" . $bot_hp . "');");
$bots[] = mysql_insert_id();
}
}
// начинаем расчет действий
if($_POST['start_raid'])
{
mysql_query("UPDATE `cit_park` SET `counter`=`counter`+1, `room`=`room`+1 WHERE `id`='{$user['id']}';");
$in_park=mysql_fetch_array(mysql_query("SELECT * FROM `cit_park` WHERE `id` = '{$user['id']}' LIMIT 1;"));
$teams = [];
foreach ($bots as $b) {
$teams[$user['id']][$b] = [0, 0, time()];
$teams[$b][$user['id']] = [0, 0, time()];
}
//старт боя - началоа
if($_POST['attack'])
{
$bots_raw=explode(";",$ch_bots[$in_park['room']]);
$bots=array();
foreach($bots_raw as $bot_id)
if($bot_id>0)
{
$b_pers=mysql_fetch_array(mysql_query("SELECT `login`,`maxhp` FROM users WHERE id='{$bot_id}' LIMIT 1;"));
$bot_hp=$b_pers['maxhp'];
$bot_name=$b_pers['login'];
$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '".$bot_name."%';"));
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`) values ('".$bot_name." ".($nb[0]+1)."','".$bot_id."','','".$bot_hp."');");
$bots[]=mysql_insert_id();
}
$teams = array();
foreach($bots as $b)
{
$teams[$user['id']][$b] = array(0,0,time());
$teams[$b][$user['id']] = array(0,0,time());
}
mysql_query("INSERT INTO `battle`
mysql_query("INSERT INTO `battle`
(
`id`,`coment`,`teams`,`timeout`,`type`,`status`,`t1`,`t2`,`to1`,`to2`
)
VALUES
(
NULL,'','".serialize($teams)."','3','1','0','".$user['id']."','".implode(";", $bots)."','".time()."','".time()."'
NULL,'','" . serialize($teams) . "','3','1','0','" . $user['id'] . "','" . implode(";", $bots) . "','" . time() . "','" . time() . "'
)");
$id = mysql_insert_id();
foreach($bots as $b) mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE `id` = {$b} LIMIT 1;");
mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$user['id']};");
addchp ('<font color=red>Внимание!</font> Вы вступили в бой c бандитами!','{[]}'.Nick::id($user['id'])->short().'{[]}');
die("<script>location.href='fbattle.php';</script>");
$id = mysql_insert_id();
foreach ($bots as $b) {
mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE `id` = {$b} LIMIT 1;");
}
//старт боя - конец
?>
<HTML><HEAD>
<!-- JS -->
mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$user['id']};");
addchp('<font color=red>Внимание!</font> Вы вступили в бой c бандитами!', '{[]}' . Nick::id($user['id'])->short() . '{[]}');
exit("<script>location.href='fbattle.php';</script>");
}
//старт боя - конец
Template::header('Городской Парк');
?>
<script>
function refreshPeriodic()
{
location.href='c_park.php';//reload()
timerID=setTimeout("refreshPeriodic()",30000);
}
timerID=setTimeout("refreshPeriodic()",30000);
</script>
<link rel=stylesheet type="text/css" href="css/main.css">
<meta content="text/html; charset=utf-8" http-equiv=Content-type>
<META Http-Equiv=Cache-Control Content=no-cache>
<meta http-equiv=PRAGMA content=NO-CACHE>
<META Http-Equiv=Expires Content=0>
function refreshPeriodic() {
location.href = 'c_park.php';//reload()
timerID = setTimeout("refreshPeriodic()", 30000);
}
</HEAD>
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor=#d4d4d4>
timerID = setTimeout("refreshPeriodic()", 30000);
</script>
<TABLE border=0 width=600 cellspacing="0" cellpadding="0" align=left>
<TABLE border=0 width=600 cellspacing="0" cellpadding="0" align=left>
<tr><td><h3>Городской Парк</td></tr>
<?php
if($in_park['room']==0 || $in_park['room']>=15)
{
echo('<tr><td>Вы стоите на парковой площади</strong></td></tr>');
echo("<tr><td>За сегодня Вы посетили парк <b>".$in_park['counter']."/3</b> раз.</td></tr>");
if($in_park['room']==15)
{
echo("<tr><td>Вы вышли из парка с чувством глубокого удовлетворения...</td></tr>");
//раздача гаек
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '856' LIMIT 1;"));
$gadget_num=mt_rand(1,8);
for($i=0;$i<$gadget_num;$i++)
{
mysql_query("INSERT INTO `inventory`
<tr>
<td><h3>Городской Парк</td>
</tr>
<?php
if ($in_park['room'] == 0 || $in_park['room'] >= 15) {
echo '<tr><td>Вы стоите на парковой площади</strong></td></tr>';
echo "<tr><td>За сегодня Вы посетили парк <b>" . $in_park['counter'] . "/3</b> раз.</td></tr>";
if ($in_park['room'] == 15) {
echo "<tr><td>Вы вышли из парка с чувством глубокого удовлетворения...</td></tr>";
//раздача гаек
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '856' LIMIT 1;"));
$gadget_num = mt_rand(1, 8);
for ($i = 0; $i < $gadget_num; $i++) {
mysql_query("INSERT INTO `inventory`
(`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`isrep`,
`gsila`,`glovk`,`ginta`,`gintel`,`ghp`,`gnoj`,`gtopor`,`gdubina`,`gmech`,`gfire`,`gwater`,`gair`,`gearth`,`glight`,`ggray`,`gdark`,`needident`,`nsila`,`nlovk`,`ninta`,`nintel`,`nmudra`,`nvinos`,`nnoj`,`ntopor`,`ndubina`,`nmech`,`nfire`,`nwater`,`nair`,`nearth`,`nlight`,`ngray`,`ndark`,
`mfkrit`,`mfakrit`,`mfuvorot`,`mfauvorot`,`bron1`,`bron2`,`bron3`,`bron4`,`maxu`,`minu`,`magic`,`nlevel`,`nalign`,`dategoden`,`goden`,`otdel`,`gmp`,`gmeshok`,`encicl`,`artefact`,`duration`
)
VALUES
('{$dress['id']}','{$user[id]}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}',
'{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','".(($dress['goden'])?($dress['goden']*24*60*60+time()):"")."','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0'
) ;");
'{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','" . (($dress['goden']) ? ($dress['goden'] * 24 * 60 * 60 + time()) : "") . "','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0'
) ;");
}
//раздача страничек
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '867' LIMIT 1;"));
$gadget_num=mt_rand(1,5);
for($i=0;$i<$gadget_num;$i++)
{
mysql_query("INSERT INTO `inventory`
//раздача страничек
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '867' LIMIT 1;"));
$gadget_num = mt_rand(1, 5);
for ($i = 0; $i < $gadget_num; $i++) {
mysql_query("INSERT INTO `inventory`
(`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`isrep`,
`gsila`,`glovk`,`ginta`,`gintel`,`ghp`,`gnoj`,`gtopor`,`gdubina`,`gmech`,`gfire`,`gwater`,`gair`,`gearth`,`glight`,`ggray`,`gdark`,`needident`,`nsila`,`nlovk`,`ninta`,`nintel`,`nmudra`,`nvinos`,`nnoj`,`ntopor`,`ndubina`,`nmech`,`nfire`,`nwater`,`nair`,`nearth`,`nlight`,`ngray`,`ndark`,
`mfkrit`,`mfakrit`,`mfuvorot`,`mfauvorot`,`bron1`,`bron2`,`bron3`,`bron4`,`maxu`,`minu`,`magic`,`nlevel`,`nalign`,`dategoden`,`goden`,`otdel`,`gmp`,`gmeshok`,`encicl`,`artefact`,`duration`
)
VALUES
('{$dress['id']}','{$user[id]}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}',
'{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','".(($dress['goden'])?($dress['goden']*24*60*60+time()):"")."','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0'
) ;");
'{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','" . (($dress['goden']) ? ($dress['goden'] * 24 * 60 * 60 + time()) : "") . "','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0'
) ;");
}
//раздача ингридиентов
$ing_list=array("859","860","861","862","863","864","865");
$ing_id=$ing_list[array_rand($ing_list)];
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '{$ing_id}' LIMIT 1;"));
$gadget_num=mt_rand(1,3);
for($i=0;$i<$gadget_num;$i++)
{
mysql_query("INSERT INTO `inventory`
$ing_list = ["859", "860", "861", "862", "863", "864", "865"];
$ing_id = $ing_list[array_rand($ing_list)];
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '{$ing_id}' LIMIT 1;"));
$gadget_num = mt_rand(1, 3);
for ($i = 0; $i < $gadget_num; $i++) {
mysql_query("INSERT INTO `inventory`
(`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`isrep`,
`gsila`,`glovk`,`ginta`,`gintel`,`ghp`,`gnoj`,`gtopor`,`gdubina`,`gmech`,`gfire`,`gwater`,`gair`,`gearth`,`glight`,`ggray`,`gdark`,`needident`,`nsila`,`nlovk`,`ninta`,`nintel`,`nmudra`,`nvinos`,`nnoj`,`ntopor`,`ndubina`,`nmech`,`nfire`,`nwater`,`nair`,`nearth`,`nlight`,`ngray`,`ndark`,
`mfkrit`,`mfakrit`,`mfuvorot`,`mfauvorot`,`bron1`,`bron2`,`bron3`,`bron4`,`maxu`,`minu`,`magic`,`nlevel`,`nalign`,`dategoden`,`goden`,`otdel`,`gmp`,`gmeshok`,`encicl`,`artefact`,`duration`
)
VALUES
('{$dress['id']}','{$user[id]}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}',
'{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','".(($dress['goden'])?($dress['goden']*24*60*60+time()):"")."','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0'
) ;");
'{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','" . (($dress['goden']) ? ($dress['goden'] * 24 * 60 * 60 + time()) : "") . "','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0'
) ;");
}
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$user['id']}','\"".$user['login']."\" Подобрал в Парке гайки ( \"".$gadget_num."\" ".$dresscount."id:(".$dressid.") [0/".$dress['maxdur']."]',1,'".time()."');");
addchp ('В Парке Вы подобрали гайки ('.$gadget_num.' шт.)','{[]}'.Nick::id($user['id'])->short().'{[]}');
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$user['id']}','\"" . $user['login'] . "\" Подобрал в Парке гайки ( \"" . $gadget_num . "\" " . $dresscount . "id:(" . $dressid . ") [0/" . $dress['maxdur'] . "]',1,'" . time() . "');");
addchp('В Парке Вы подобрали гайки (' . $gadget_num . ' шт.)', '{[]}' . Nick::id($user['id'])->short() . '{[]}');
//денежный приз
$priz=mt_rand(1,10);
$priz = mt_rand(1, 10);
mysql_query("UPDATE users set money=money+{$priz} where id='{$user['id']}';");
addchp ('После посещения Парка Вы обогатились на '.$priz.' кр. ','{[]}'.Nick::id($user['id'])->short().'{[]}');
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`)
VALUES ('','0','{$user['id']}','\"".$user['login']."\" нашел в Парке ".$priz." кр. ',1,'".time()."');");
addchp('После посещения Парка Вы обогатились на ' . $priz . ' кр. ', '{[]}' . Nick::id($user['id'])->short() . '{[]}');
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`)
VALUES ('','0','{$user['id']}','\"" . $user['login'] . "\" нашел в Парке " . $priz . " кр. ',1,'" . time() . "');");
//переход
mysql_query("UPDATE `cit_park` SET `room`=0,`bots`='',`time`='".time()."' WHERE `id` ='{$user['id']}'; ");
}
if($in_park['counter']>=3)
echo('<tr><td>По какому-то странному совпадению Вам не хочется идти в парк. Может, подождать до завтра? </td></tr>');
elseif(($in_park['time']+3600)>time())
{/**/
$tm=time();
$t_wait=round(((3600-$tm+$in_park['time'])/60),1);
echo('<tr><td>Вы совсем недавно вернулись из парка, бесполезно идти туда снова. <br/>(Осталось ждать: <strong>'.$t_wait.'</strong> мин.)</td></tr>');
mysql_query("UPDATE `cit_park` SET `room`=0,`bots`='',`time`='" . time() . "' WHERE `id` ='{$user['id']}'; ");
}
else
echo('<tr><td><FORM action="c_park.php" method=POST><INPUT TYPE="submit" value="Прогуляться" name="start_raid"><br></FORM></td></tr>');
echo '<tr><td><FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="ps"></FORM></td></tr>';
}
else
{
echo('<tr><td>Вы видите табличку с названием улицы: <strong>'.$ch_rooms[$in_park['room']].'</strong></td></tr>');
echo('<tr><td>В парке пустынно и темно, только какие-то подозрительные личности шныряют по своим делам.</td></tr>');
echo('<tr><td>Вы видите несколько бандитов. Они замышляют зловещие преступления в городе!</td></tr>');
echo('<tr><td><FORM action="c_park.php" method=POST><INPUT TYPE="submit" value="Напасть" name="attack"><br></FORM></td></tr>');
}
?>
if ($in_park['counter'] >= 3) {
echo '<tr><td>По какому-то странному совпадению Вам не хочется идти в парк. Может, подождать до завтра? </td></tr>';
}
elseif (($in_park['time'] + 3600) > time()) {
$tm = time();
$t_wait = round(((3600 - $tm + $in_park['time']) / 60), 1);
echo '<tr><td>Вы совсем недавно вернулись из парка, бесполезно идти туда снова. <br/>(Осталось ждать: <strong>' . $t_wait . '</strong> мин.)</td></tr>';
} else {
echo '<tr><td><FORM action="c_park.php" method=POST><INPUT TYPE="submit" value="Прогуляться" name="start_raid"><br></FORM></td></tr>';
}
echo '<tr><td><FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="ps"></FORM></td></tr>';
} else {
echo '<tr><td>Вы видите табличку с названием улицы: <strong>' . $ch_rooms[$in_park['room']] . '</strong></td></tr>';
echo '<tr><td>В парке пустынно и темно, только какие-то подозрительные личности шныряют по своим делам.</td></tr>';
echo '<tr><td>Вы видите несколько бандитов. Они замышляют зловещие преступления в городе!</td></tr>';
echo '<tr><td><FORM action="c_park.php" method=POST><INPUT TYPE="submit" value="Напасть" name="attack"><br></FORM></td></tr>';
}
?>
</table>
<div align=right><img width="260" src="i/park/<?php echo($in_park['room']+1); ?>.jpg" /></div>
<?php
?>
</BODY>
</HTML>
<div align=right><img width="260" src="i/park/<?php echo($in_park['room'] + 1); ?>.jpg"/></div>

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
<?
if ($user['room'] == 403) {
<?php
if ($user->room == 403) {
$s = db::c()->query('SELECT * FROM podzem2 WHERE name= "?s"', $mir['name'])->fetch_assoc();
$rooms[0] = "";
@ -320,7 +320,7 @@ if ($user['room'] == 403) {
$s .= '<div style="position:absolute; left:165px; top:115px;"><img src="labirint3/zel.gif" width="50" border="0" height="50" alt="Зелье"></div>';
}
if (($repa["n$mesto"] == '11.1' or $repa["n$mesto"] == '11.0') and $vector == $repa["v$mesto"]) {
$s .= '<div onmouseout="closeMenu();" style="position:absolute; left:180px; top:165px;"><img src="labirint3/1/kanal.gif" width="40" height="40" border="0" alt="Водосток" style="CURSOR:pointer;" onClick="stok(' . $mesto . ');"></div>';
$s .= '<div onmouseout="closeMenu();" style="position:absolute; left:180px; top:165px;"><img src="labirint3/1/kanal.gif" width="40" height="40" border="0" alt="Водосток" style="CURSOR:pointer;" onClick="stok(' . $mesto . ')"></div>';
}
if (($repa["n$loc2"] == '11.1' or $repa["n$loc2"] == '11.0') and $vector == $repa["v$loc2"]) {
$s .= '<div style="position:absolute; left:180px; top:140px;"><img src="labirint3/1/kanal.gif" width="25" height="25" border="0" alt="Водосток"></div>';
@ -333,7 +333,7 @@ if ($user['room'] == 403) {
}
/////////////
if (($repa["n$loc2"] == '12.1' or $repa["n$loc2"] == '12.0') and $vector == $repa["v$loc2"]) {
$s .= '<div onmouseout="closeMenu();" style="position:absolute; left:160px; top:170px;"><img src="labirint3/1/stok.gif" width="60" height="15" border="0" alt="Водосток" style="CURSOR:pointer;" onClick="stok2(' . $loc2 . ');"></div>';
$s .= '<div onmouseout="closeMenu();" style="position:absolute; left:160px; top:170px;"><img src="labirint3/1/stok.gif" width="60" height="15" border="0" alt="Водосток" style="CURSOR:pointer;" onClick="stok2(' . $loc2 . ')"></div>';
}
if (($repa["n$loc3"] == '12.1' or $repa["n$loc3"] == '12.0') and $vector == $repa["v$loc3"]) {
$s .= '<div style="position:absolute; left:175px; top:150px;"><img src="labirint3/1/stok.gif" width="40" height="8" border="0" alt="Водосток"></div>';
@ -373,7 +373,7 @@ if ($user['room'] == 403) {
$nomers = '10';
}
if (($repa["n$mesto"] == 'key1' or $repa["n$mesto"] == 'key2' or $repa["n$mesto"] == 'key3' or $repa["n$mesto"] == 'key4' or $repa["n$mesto"] == 'key5' or $repa["n$mesto"] == 'key6' or $repa["n$mesto"] == 'key7' or $repa["n$mesto"] == 'key8' or $repa["n$mesto"] == 'key9' or $repa["n$mesto"] == 'key10') and $vector == $repa["v$mesto"]) {
$s .= '<div onmouseout="closeMenu();" style="position:absolute; left:160px; top:165px;"><img src="labirint3/' . $repa["n$mesto"] . '.gif" width="60" height="60" border="0" alt="Ключ №' . $nomers . '" style="CURSOR:pointer;" onClick="key(' . $mesto . ',' . $nomers . ');"></div>';
$s .= '<div onmouseout="closeMenu();" style="position:absolute; left:160px; top:165px;"><img src="labirint3/' . $repa["n$mesto"] . '.gif" width="60" height="60" border="0" alt="Ключ №' . $nomers . '" style="CURSOR:pointer;" onClick="key(' . $mesto . ',' . $nomers . ')"></div>';
}
if (($repa["n$loc2"] == 'key1' or $repa["n$loc2"] == 'key2' or $repa["n$loc2"] == 'key3' or $repa["n$loc2"] == 'key4' or $repa["n$loc2"] == 'key5' or $repa["n$loc2"] == 'key6' or $repa["n$loc2"] == 'key7' or $repa["n$loc2"] == 'key8' or $repa["n$loc2"] == 'key9' or $repa["n$loc2"] == 'key10') and $vector == $repa["v$loc2"]) {
$s .= '<div style="position:absolute; left:175px; top:140px;"><img src="labirint3/' . $repa["n$loc2"] . '.gif" width="40" height="40" border="0" alt="Ключ №' . $nomers . '"></div>';
@ -539,10 +539,10 @@ if ($user['room'] == 403) {
}
///////////////////////////////////////////
if ($step1['fwd'] and ($repa["n$loc2"] == '13.1' or $repa["n$loc2"] == '13.0')) {
$s .= '<div onmouseout="closeMenu();" style="position:absolute; left:155px; top:130px;"><img src="labirint3/sun.gif" width="60" height="60" border="0" alt="Сундук" style="CURSOR:pointer;" onClick="sunduk(' . $loc2 . ');"></div>';
$s .= '<div onmouseout="closeMenu();" style="position:absolute; left:155px; top:130px;"><img src="labirint3/sun.gif" width="60" height="60" border="0" alt="Сундук" style="CURSOR:pointer;" onClick="sunduk(' . $loc2 . ')"></div>';
}
if ($step1['fwd'] and ($repa["n$loc2"] == '14.1' or $repa["n$loc2"] == '14.0')) {
$s .= '<div onmouseout="closeMenu();" style="position:absolute; left:155px; top:130px;"><img src="labirint3/2.gif" width="60" height="60" border="0" alt="Сундук" style="CURSOR:pointer;" onClick="sunduk2(' . $loc2 . ');"></div>';
$s .= '<div onmouseout="closeMenu();" style="position:absolute; left:155px; top:130px;"><img src="labirint3/2.gif" width="60" height="60" border="0" alt="Сундук" style="CURSOR:pointer;" onClick="sunduk2(' . $loc2 . ')"></div>';
}
/////////////////////1/////////////////////
@ -550,20 +550,20 @@ if ($user['room'] == 403) {
if ($k_b2 == '1') {
if ($rt["n$loc2"] == '8') {
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:135px; top:40px;"><img src="labirint3/' . $ob2 . '.gif" width="100" height="160" title=' . $b_n2 . ' style="CURSOR:pointer;" onClick="Opendialog(' . $loc2 . ',event);"></div>';
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:135px; top:40px;"><img src="labirint3/' . $ob2 . '.gif" width="100" height="160" title=' . $b_n2 . ' style="CURSOR:pointer;" onClick="Opendialog(' . $loc2 . ',event)"></div>';
} else {
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:135px; top:40px;"><img src="labirint3/' . $ob2 . '.gif" width="100" height="160" title=' . $b_n2 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event);"></div>';
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:135px; top:40px;"><img src="labirint3/' . $ob2 . '.gif" width="100" height="160" title=' . $b_n2 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event)"></div>';
}
}
if ($k_b2 == '2') {
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:90px; top:40px;"><img src="labirint3/' . $ob2 . '.gif" width="100" height="160" title=' . $b_n2 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event);"></div>';
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:180px; top:40px;"><img src="labirint3/' . $ob22 . '.gif" width="100" height="160" title=' . $b_n22 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event);"></div>';
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:90px; top:40px;"><img src="labirint3/' . $ob2 . '.gif" width="100" height="160" title=' . $b_n2 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event)"></div>';
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:180px; top:40px;"><img src="labirint3/' . $ob22 . '.gif" width="100" height="160" title=' . $b_n22 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event)"></div>';
}
if ($k_b2 == '3') {
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:80px; top:40px;"><img src="labirint3/' . $ob2 . '.gif" width="100" height="160" title=' . $b_n2 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event);"></div>';
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:195px; top:40px;"><img src="labirint3/' . $ob23 . '.gif" width="100" height="160" title=' . $b_n23 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event);"></div>';
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:140px; top:60px;"><img src="labirint3/' . $ob22 . '.gif" width="100" height="160" title=' . $b_n22 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event);"></div>';
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:80px; top:40px;"><img src="labirint3/' . $ob2 . '.gif" width="100" height="160" title=' . $b_n2 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event)"></div>';
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:195px; top:40px;"><img src="labirint3/' . $ob23 . '.gif" width="100" height="160" title=' . $b_n23 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event)"></div>';
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:140px; top:60px;"><img src="labirint3/' . $ob22 . '.gif" width="100" height="160" title=' . $b_n22 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event)"></div>';
}
}

111
cave.php
View File

@ -207,11 +207,11 @@ function redirectbyroom($r)
{
if (in_array($r, Config::$canalenters)) {
header("location: enter_cave.php");
die();
exit;
}
if ($r == 1) {
header("location: main.php");
die();
exit;
}
}
@ -229,7 +229,7 @@ if ($user["login"] == "Rallo Tabs") {
if ($user['battle'] > 0) {
header("location: fbattle.php");
die();
exit;
}
$objsizes = [0 => [0, 0], 1 => [120, 60], 2 => [120, 60], 3 => [120, 60], 4 => [110, 72], 5 => [120, 120]];
@ -288,15 +288,15 @@ function makedeath()
{
global $user, $floor, $loses, $x, $y, $dir;
$cavedata = Config::$cavedata ?? [];
if (!isset($cavedata[$user['room']]['x' . $floor])) {
if (!isset($cavedata[$user->room]['x' . $floor])) {
$floor = 1;
loadmap();
}
mysql_query("UPDATE `caveparties` SET `floor` = $floor, `x` = '" . $cavedata[$user['room']]['x' . $floor] . "', `y` = '" . $cavedata[$user['room']]['y' . $floor] . "', `dir` = '" . $cavedata[$user['room']]['dir' . $floor] . "', `loses` = (`loses`+1) WHERE `user` = '$user[id]' LIMIT 1");
mysql_query("UPDATE `caveparties` SET `floor` = $floor, `x` = '" . $cavedata[$user->room]['x' . $floor] . "', `y` = '" . $cavedata[$user->room]['y' . $floor] . "', `dir` = '" . $cavedata[$user->room]['dir' . $floor] . "', `loses` = (`loses`+1) WHERE `user` = '$user[id]' LIMIT 1");
mysql_query('UPDATE `users` SET `hp` = 1 WHERE `id` = "' . $user['id'] . '" LIMIT 1');
$x = $cavedata[$user['room']]['x' . $floor];
$y = $cavedata[$user['room']]['y' . $floor];
$dir = $cavedata[$user['room']]['dir' . $floor];
$x = $cavedata[$user->room]['x' . $floor];
$y = $cavedata[$user->room]['y' . $floor];
$dir = $cavedata[$user->room]['dir' . $floor];
updparties();
$loses++;
}
@ -447,9 +447,9 @@ function getcavedata($caveleader, $floor)
return unserialize(implode("", file("cavedata/$caveleader-$floor.dat")));
}
if (!in_array($user['room'], Config::$caverooms)) {
if (!in_array($user->room, Config::$caverooms)) {
header("Location: main.php");
die('Not in this life ...');
exit('Not in this life ...');
}
if (isset($_GET['direction'])) {
@ -472,7 +472,7 @@ while ($rec = mysql_fetch_assoc($r)) {
$party[] = $rec;
}
if ($user['room'] == 621) {
if ($user->room == 621) {
$base = "/underdesigns/alchcave";
}
@ -535,7 +535,7 @@ if (@$_GET['useitem'] || @$_GET['usewallitem']) {
loadmap();
if (@$_GET['useitem']) {
if ($_GET['useitem']) {
if ($dir == 0) {
$tx = $x - 1;
$ty = $y;
@ -553,8 +553,8 @@ if (@$_GET['useitem']) {
$ty = $y + 1;
}
if (@$_GET['useitem']) {
if (file_exists("underground/objects/$user[room].php")) {
include "underground/objects/$user[room].php";
if (file_exists("underground/objects/$user->room.php")) {
include "underground/objects/$user->room.php";
}
}
@ -650,7 +650,7 @@ if ($wander && !isset($_GET['attack'])) {
$ty = $v['y'] + 2;
}
if ($user['room'] == 74 || $user['room'] == 76) {
if ($user->room == 74 || $user->room == 76) {
if (strpos($map[$ty][$tx], 's/') !== false && !@$mapbots[$ty][$tx]) {
break;
}
@ -718,8 +718,8 @@ if ($moved && (substr($map[$y * 2][$x * 2], 0, 1) === "e" || substr($map[$y * 2]
$tx = $x;
$ty = $y;
$tmp = explode("/", $map[$y * 2][$x * 2]);
if (file_exists("underground/events/$user[room].php")) {
include("underground/events/$user[room].php");
if (file_exists("underground/events/$user->room.php")) {
include("underground/events/$user->room.php");
}
}
@ -744,7 +744,7 @@ if ($ambushes[$y * 2][$x * 2 - 2] && $map[$y * 2][$x * 2 - 1] == 0) {
if ($ax && $ay && $user['hp'] > 0) {
$cavedata = Config::$cavedata ?? [];
if (!($cavedata[$user['room']]['x' . $floor] == $x && $cavedata[$user['room']]['y' . $floor] == $y)) {
if (!($cavedata[$user->room]['x' . $floor] == $x && $cavedata[$user->room]['y' . $floor] == $y)) {
if ($ax < $x) {
$dir1 = 0;
} elseif ($ax > $x) {
@ -818,12 +818,12 @@ if (@$_GET['speak']) {
$tmp = explode("/", $cell);
if ($tmp[0] == "d") {
header("location: dialog.php?char=$tmp[2]");
die();
exit;
}
if ($tmp[0] == "b" && isset($dialogs[CaveBots::$bots[$tmp[1]]])) {
header("location: dialog.php?char=" . CaveBots::$bots[$tmp[1]]);
die();
exit;
}
}
@ -908,28 +908,15 @@ if (@$_GET['exit']) {
}
}
mysql_query("DELETE FROM `inventory` WHERE `owner` = '$user[id]' AND `foronetrip` = 1");
gotoroom($user['room'] - 1);
gotoroom($user->room - 1);
}
$standingon = $map[$y * 2][$x * 2];
foreach ($party as $k => $v) {
$map[$v['y'] * 2][$v['x'] * 2] = "u/" . $v['user'];
}
Template::header('cave');
?>
<head>
<script LANGUAGE='JavaScript'>
document.ondragstart = test;
//запрет на перетаскивание
document.onselectstart = test;
//запрет на выделение элементов страницы
document.oncontextmenu = test;
//запрет на выведение контекстного меню
function test() {
return false
}
</SCRIPT>
<link rel=stylesheet type="text/css" href="/i/main.css">
<style>
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
@ -955,7 +942,7 @@ foreach ($party as $k => $v) {
background-color: #484848;
color: #000000;
display: block;
font-family: Verdana, Arial;
font-family: Verdana, Arial, serif;
font-size: 8pt;
font-weight: bold;
padding: 2px 12px 2px 8px;
@ -1332,36 +1319,7 @@ foreach ($party as $k => $v) {
el2.style.top = posy + 33 + "px";
el2.style.visibility = "visible";
}
var delay = 30, TimerOn = -1, tkHP, maxHP, speed = 300, stLen = 185, redHP = 0.33, yellowHP = 0.66;
function setHP(a, b, c) {
tkHP = a;
maxHP = b;
TimerOn >= 0 && (clearTimeout(TimerOn), TimerOn = -1);
speed = c;
setHPlocal()
}
function setHPlocal() {
tkHP > maxHP && (tkHP = maxHP);
var a = Math.round(tkHP) + "/" + maxHP, a = stLen - (a.length + 2) * 7,
b = Math.round((a - 1) / maxHP * tkHP);
a -= b;
HP = document.getElementById("hp_value");
HP1 = document.getElementById("HP1");
HP2 = document.getElementById("HP2");
if (HP) HP1.width = b, HP2.width = a, HP1.src = tkHP / maxHP < redHP ? "i/1red.gif" : tkHP / maxHP < yellowHP ? "i/1yellow.gif" : "i/1green.gif",
HP.innerHTML = Math.round(tkHP) + "/" + maxHP;
tkHP += maxHP / 60 / 20 * (speed / 100);
TimerOn = tkHP < maxHP ? setTimeout("setHPlocal()", delay * 100) : -1
}
setHP(<?=$user['hp'];?>, <?=$user['maxhp'];?>, 100);
</script>
</head>
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor="#d7d7d7"
style=" background-image: url(/i/bagr.gif); width=100%; background-repeat:repeat;background-position:top">
<div id=hint3 class=ahint></div>
<div style="z-index: 100; background-color: #E4F2DF; border-style: solid; border-width: 2px; border-color: #77c3fc; position: absolute; left: 0; top: 0; visibility: hidden; cursor:pointer;"
id="oMenu"></div>
@ -1372,10 +1330,11 @@ foreach ($party as $k => $v) {
if ($user['hp'] <= 0) {
makedeath();
}
$botNames = CaveBots::$botnames;
$botIds = CaveBots::$bots;
function drawmap($map1, $players, $x, $y, $direction)
{
global $base, $user, CaveBots::$botnames, $imgdata;
global $base, $user, $botNames, $imgdata;
$startx = max($x * 2 - 8, 0);
$starty = max($y * 2 - 8, 0);
@ -1473,7 +1432,7 @@ function drawmap($map1, $players, $x, $y, $direction)
function drawbot($cell, $x, $y)
{
global CaveBots::$botnames, $imgdata, CaveBots::$bots, $dialogs, $user, $floor;
global $botNames, $imgdata, $botIds, $dialogs, $user, $floor;
$data = explode("/", $cell);
$i = 1;
$bc = (count($data) - 1) / 2;
@ -1517,9 +1476,9 @@ function drawmap($map1, $players, $x, $y, $direction)
$ret .= drawobject2($aMap[$yy][$xx], $x, $y);
}
$rrm = $user['room'];
$rrm = $user->room;
if (isset($dialogs[CaveBots::$bots[$data[1]]]) && (CaveBots::$bots[$data[1]] == 11147 && $user['room'] == 74)) {
if (isset($dialogs[CaveBots::$bots[$data[1]]]) && (CaveBots::$bots[$data[1]] == 11147 && $user->room == 74)) {
$ret .= "<img title=\"$botname" . ($cnt > 1 ? " ($cnt)" : "") . "\" " . ($y == 1 && $x == 3 ? "onclick=\"speakattackmenu(event);\"" : "") . " width=\"" . $imgdata[$x][$y]["wd"] . "\" height=\"" . $imgdata[$x][$y]["ht"] . "\" src=\"/i/dungeon/mobs/$rrm/$bot.gif\" style=\"position: absolute; left: " . $imgdata[$x][$y]["x"][$bn] . "px; top: " . $imgdata[$x][$y]["y"] . "px;" . ($x == 3 && $y == 1 ? "cursor: pointer;" : "") . ($x == 3 ? "z-index: " . (99 - ($y * 5)) . ";" : "") . "\" />";
} else {
$ret .= "<img title=\"$botname" . ($cnt > 1 ? " ($cnt)" : "") . "\" " . ($y == 1 && $x == 3 ? " onclick=\"document.location.href='cave.php?attack=1';\"" : "") . " width=\"" . $imgdata[$x][$y]["wd"] . "\" height=\"" . $imgdata[$x][$y]["ht"] . "\" src=\"/i/dungeon/mobs/$rrm/$bot.gif\" style=\"position: absolute; left: " . $imgdata[$x][$y]["x"][$bn] . "px; top: " . $imgdata[$x][$y]["y"] . "px;" . ($x == 3 && $y == 1 ? "cursor: pointer;" : "") . ($x == 3 ? "z-index: " . (99 - ($y * 5)) . ";" : "") . "\" />";
@ -1544,7 +1503,7 @@ function drawmap($map1, $players, $x, $y, $direction)
function drawuser($cell, $x, $y)
{
global CaveBots::$botnames, $imgdata, $party;
global $botNames, $imgdata, $party;
$data = explode("/", $cell);
$i = 1;
$bc = (count($data) - 1);
@ -1609,7 +1568,7 @@ function drawmap($map1, $players, $x, $y, $direction)
$left = $imgdata[$x][$y]["x"][1];
$top = $imgdata[$x][$y]["y"] + $ht;
}
$rrm = $user['room'];
$rrm = $user->room;
if (!isset($imgmap[$obj])) {
$ret .= "
@ -1654,7 +1613,7 @@ function drawmap($map1, $players, $x, $y, $direction)
$left = $imgdata[$x][$y]["x"][1];
$top = $imgdata[$x][$y]["y"] + $ht;
}
$rrm = $user['room'];
$rrm = $user->room;
if (!isset($imgmap[$obj])) {
$ret .= "
" . ($y == 1 && $x == 3 ? "<a href=\"cave.php?useitem=1\">" : "") . "
@ -1815,7 +1774,7 @@ function drawmap($map1, $players, $x, $y, $direction)
}
$objInWall = explode('/', $map[3][$wall]);
if ($objInWall[1] == "o") {
if ($user['room'] == 83 && !(!$direction && (($x == 13 && $y == 4) || ($x == 12 && $y == 4)))) { // исключение 2-ух клеток в комнате 82
if ($user->room == 83 && !(!$direction && (($x == 13 && $y == 4) || ($x == 12 && $y == 4)))) { // исключение 2-ух клеток в комнате 82
$ret .= drawobject('//' . $objInWall[2], 3, $i);
}
}
@ -2038,10 +1997,10 @@ progress_update();
<td width=540>
<div style="text-align:right;padding-right:30px">
<font style='font-size:14px; color:#8f0000'><b><?
$dMap = unserialize(mysql_result(mysql_query("SELECT `map` FROM `cavemaps` WHERE `floor` = $floor AND `room` = " . ($user['room'] - 1)), 0, 0));
$dMap = unserialize(mysql_result(mysql_query("SELECT `map` FROM `cavemaps` WHERE `floor` = $floor AND `room` = " . ($user->room - 1)), 0, 0));
$cPlace = $dMap[$y * 2][$x * 2];
$tmp = explode("/", $cPlace);
if ($user['room'] == 621) {
if ($user->room == 621) {
if ($floor == 1) {
echo 'Проклятый Рудник, 1 этаж';
} elseif ($floor == 2) {

59
ch.php

File diff suppressed because one or more lines are too long

View File

@ -11,13 +11,13 @@ if (empty($_SESSION['uid'])) {
exit;
}
require_once "config.php";
//include_once "functions.php";
$msg = $_POST['msg'] ?? null;
$uid = $_SESSION['uid'];
$uid = $_SESSION['uid'] ?? null;
if ($msg) {
try { db::c()->query('INSERT INTO `chat` (`user_id`, `msg`) VALUES (?i, "?s")', $uid, $msg); }
catch (\Krugozor\Database\Mysql\Exception $e) {
try {
db::c()->query('INSERT INTO `chat` (`user_id`, `msg`) VALUES (?i, "?s")', $uid, $msg);
} catch (\Krugozor\Database\Mysql\Exception $e) {
echo "<div style='background-color: #ffaaaa;'>Ошибка: " . $e->getMessage() . "<br> В файле: " . $e->getFile() . " (" . $e->getLine() . ")</div>";
}
}
@ -50,24 +50,33 @@ function show_messages()
show_messages();
Template::header('chat');
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/main.css">
<style>
form { padding: 3px; position: fixed; bottom: 0; width: 100%; }
form input { border: 0; padding: 10px; width: 80%; margin-right: .5%; }
form input[type="submit"] { width: 15%; border: none; padding: 10px; }
</style>
</head>
<body>
<style>
form {
padding: 3px;
position: fixed;
bottom: 0;
width: 100%;
}
form input {
border: 0;
padding: 10px;
width: 80%;
margin-right: .5%;
}
form input[type="submit"] {
width: 15%;
border: none;
padding: 10px;
}
</style>
<div>
<?php ?>
<?php ?>
</div>
<form action="chat.php" method="post">
<input id="msg" name="msg" size="100" placeholder="Введите сообщение...">
<input type="submit" value="Отправить">
</form>
</body>
</form>

View File

@ -33,13 +33,13 @@ if($_GET['id'] == 1) {
} elseif($_GET['id'] == 6) {
$user = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `room` FROM `users` WHERE `id` = "'.(int)$_GET['user'].'" LIMIT 1'));
if(isset($user['id'])) {
addch('<font color=red>Внимание!</font> Ваш бой не может начаться по причине <b>Группа не набрана</b>', $user['login'], $user['room']);
addch('<font color=red>Внимание!</font> Ваш бой не может начаться по причине <b>Группа не набрана</b>', $user['login'], $user->room);
}
} elseif($_GET['id'] == 7) {
$user = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `room` FROM `users` WHERE `id` = "'.(int)$_GET['user'].'" LIMIT 1'));
if(isset($user['id'])) {
addch('<font color=red>Внимание!</font> Ваш бой начался.', $user['login'], $user['room']);
addch('<font color=red>Внимание!</font> Ваш бой начался.', $user['login'], $user->room);
}
} else {
die();
exit;
}

View File

@ -3,10 +3,11 @@
* Центральная площадь
*/
session_start();
if ($_SESSION['uid'] == null) {
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
require_once "functions.php";
$user = $user ?? [];
$tm = time();
@ -72,11 +73,11 @@ switch ($location[0]) {
move(2702, 'city.php');
break;
case 'got':
if ($user['room'] == 20) {
if ($user->room == 20) {
switch ($location[1]) {
case 'level1':
header('location: main.php?goto=arena');
die();
exit;
break;
case 'level7':
header('location: city.php?strah');
@ -106,7 +107,7 @@ switch ($location[0]) {
move(25, 'comission.php');
break;
}
} elseif ($user['room'] == 21) {
} elseif ($user->room == 21) {
switch ($location[1]) {
case 'level4':
header('location: city.php?cp');
@ -130,7 +131,7 @@ switch ($location[0]) {
move(650, 'ul_clans.php');
break;
}
} elseif ($user['room'] == 2111) {
} elseif ($user->room == 2111) {
switch ($location[1]) {
case 'level1':
header('location: city.php?strah');
@ -148,7 +149,7 @@ switch ($location[0]) {
move(666, 'jail.php');
break;
}
} elseif ($user['room'] == 2601) {
} elseif ($user->room == 2601) {
switch ($location[1]) {
case 'level4':
header('location: city.php?bps');
@ -166,7 +167,7 @@ switch ($location[0]) {
move(404, 'vxod.php');
break;
}
} elseif ($user['room'] == 2701) {
} elseif ($user->room == 2701) {
switch ($location[1]) {
case 'level1':
header('location: city.php?zaliv');
@ -175,7 +176,7 @@ switch ($location[0]) {
move(402, 'lab_chaos_enter.php');
break;
}
} elseif ($user['room'] == 2702) {
} elseif ($user->room == 2702) {
switch ($location[1]) {
case 'level10':
header('location: city.php?cp');
@ -184,7 +185,7 @@ switch ($location[0]) {
move(61, 'akadem.php');
break;
}
} elseif ($user['room'] == 2655) {
} elseif ($user->room == 2655) {
switch ($location[1]) {
case 'level10':
header('location: city.php?zamk');
@ -193,7 +194,7 @@ switch ($location[0]) {
move(603, 'aren_of_angels.php');
break;
}
} elseif ($user['room'] == 26) {
} elseif ($user->room == 26) {
switch ($location[1]) {
case 'level4':
header('location: city.php?cp');
@ -255,12 +256,8 @@ function bgset($img)
}
$online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time() - 60));
Template::header('city');
?>
<!doctype html>
<html lang="ru">
<HEAD>
<link rel=stylesheet href="css/main.css">
<meta charset="utf-8">
<style>
img.building:hover {
filter: drop-shadow(2px 2px 2px white) sepia(15%);
@ -278,9 +275,6 @@ $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time
document.onmousedown = Down;
</script>
<title></title>
</HEAD>
<body>
<table class="allzeroes">
<TR>
<TD align=center></TD>
@ -289,7 +283,7 @@ $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time
<TR>
<TD align=center colspan=2>
<?php
if ($user['room'] == 20) {
if ($user->room == 20) {
bgset('cap_cp');
buildset(1, "cap_club", 30, 235, "Бойцовский Клуб");
buildset(2, "cap_shop", 202, 171, "Магазин");
@ -304,7 +298,7 @@ $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time
buildset(9, "cap_tree2", 260, 530, "Новогодняя елка");
buildset(14, "cap_sneg_3", 210, 390, "Снеговик");
echo "</div>";
} elseif ($user['room'] == 21) {
} elseif ($user->room == 21) {
bgset('cap_strash');
buildset(5, "cap_bank", 180, 485, "Банк");
buildset(14, "cap_registratura", 170, 113, "Регистратура кланов");
@ -314,14 +308,14 @@ $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time
buildset(13, "cap_flowershop", 220, 613, "Цветочный магазин");
buildset(4, "cap_arr_left", 258, 21, "Центральная площадь", 1);
echo "</div>";
} elseif ($user['room'] == 26) {
} elseif ($user->room == 26) {
bgset('cap_park');
buildset(6, "cap_gate", 170, 340, "Городские ворота", 1);
buildset(660, "cap_vokzal", 163, 43, "Общежитие");
buildset(3, "cap_arr_left", 259, 27, "Замковая площадь", 1);
buildset(4, "cap_arr_right", 259, 715, "Центральная площадь", 1);
echo "</div>";
} elseif ($user['room'] == 2601) {
} elseif ($user->room == 2601) {
bgset('cap_zamk');
buildset(1052, "cap_lavka", 240, 425, "Храмовая лавка");
buildset(10, "ava_post", 240, 300, "Сувенирный магазинчик", 1);
@ -330,12 +324,12 @@ $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time
buildset(55, "cap_arr_left", 258, 21, "Арена Богов", 1);
buildset(4, "cap_arr_right", 260, 710, "Большая парковая улица", 1);
echo "</div>";
} elseif ($user['room'] == 2655) {
} elseif ($user->room == 2655) {
bgset('ar_e_n');
buildset(2055, "cap_altr_g", 230, 340, "Арена Ангелов");
buildset(10, "arr_right_png", 260, 710, "Замковая площадь", 1);
echo "</div>";
} elseif ($user['room'] == 2111) {
} elseif ($user->room == 2111) {
bgset('rist_bg');
buildset(1, "cap_arr_uleft", 240, 30, "Страшилкина Улица", 1);
buildset(2, "cap_arr_right", 245, 708, "Секретный Лабиринт", 1);
@ -345,12 +339,12 @@ $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time
buildset(203, "cap_rist_monstr", 145, 570, "Вход в Груповые сражения");
buildset(21, "angelscastle", 131, 628, "Замок Мэра Города");
echo "</div>";
} elseif ($user['room'] == 2701) {
} elseif ($user->room == 2701) {
bgset('arena_bg1');
buildset(1, "cap_3strelka", 260, 30, "Берег Залива");
buildset(2, "cap_shar_dark", 234, 356, "Лабиринт Хаоса");
echo "</div>";
} elseif ($user['room'] == 2702) {
} elseif ($user->room == 2702) {
bgset('cap_torg');
buildset(6, "cap_arenda", 175, 70, "Академия");
buildset(16, "cap_t_build42", 120, 300, "Аукцион");
@ -362,6 +356,4 @@ $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time
?>
</td>
</tr>
</table>
</body>
</html>
</table>

View File

@ -3,10 +3,11 @@ ob_start("ob_gzhandler");
session_start();
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
include_once 'functions.php';
if (!$user->clan) {
die(err('Вы не состоите в клане!'));
exit(err('Вы не состоите в клане!'));
}
try {
$clanRow = db::c()->query('SELECT * FROM `clans` WHERE `id` = ?i', $user->clan)->fetch_assoc();
@ -99,15 +100,8 @@ if ($login && $action == 'edit_status') {
}
$clan_memberlist = db::c()->query('SELECT `id`, `login`, `status`, `level`, `room`, `align`, (select `id` from `online` WHERE `date` >= ?i AND `id` = users.`id`) AS `online` FROM `users` WHERE `klan` = ?i ORDER BY `online` DESC , `login` ASC', (time() - 60), $clanRow['id']);
Template::header('clan');
?>
<!doctype html>
<html>
<head>
<link rel=stylesheet href="css/main.css">
<meta charset="utf-8">
</head>
<body>
<div>
<button onclick="location.href='main.php'">Вернуться</button>
<?php if (!empty($status)) {err($status);} ?>
@ -116,7 +110,7 @@ $clan_memberlist = db::c()->query('SELECT `id`, `login`, `status`, `level`, `roo
<tr>
<td>
<p style="width: 50%; vertical-align: top;" rowspan=2>
<h3><img src="./i/clan/<?= $clanRow['short'] ?>.gif"><?= $clanRow['name'] ?></h3>
<h3><img src="./i/clan/<?= $clanRow['short'] ?>.png"><?= $clanRow['name'] ?></h3>
Количество рейтинговых очков клана: <span
style="color: #428f21; font-size: larger;"><?= $clanRow['rating'] ?></span><br>
@ -236,6 +230,4 @@ $clan_memberlist = db::c()->query('SELECT `id`, `login`, `status`, `level`, `roo
function use(option) {
document.getElementById(option).innerHTML = "<form method='post'><input placeholder='Имя персонажа' name='login'><button name='action' value='" + option + "' type='submit'>Ок</button><button>×</button></form>";
}
</script>
</body>
</html>
</script>

View File

@ -1,329 +1,329 @@
<?php
session_start();
if (!($_SESSION['uid'] >0)) header("Location: index.php");
include "config.php";
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = ".$user['id']." AND (type=13 OR type=12 OR type=14) limit 1;"));
$klan = mysql_fetch_array(mysql_query("SELECT * FROM `clans` WHERE `id` = '{$user['klan']}' LIMIT 1;"));
include "functions.php";
if ($user['room'] != 45) { header("Location: main.php"); die(); }
if ($user['battle'] != 0) { header('location: fbattle.php'); die(); }
$cc_date=mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE `var`='cc_time' LIMIT 1;"));
$ccd=$cc_date['value'];
if($_POST['admin_start'])
{
$tm=time();
mysql_query("UPDATE `variables` SET `value`='{$tm}' WHERE `var`='cc_time';");
die("<script>location.href='clan_castle.php';</script>");
}
if($_POST['admin_start1'])
{
$tm=time()-900;
mysql_query("UPDATE `variables` SET `value`='{$tm}' WHERE `var`='cc_time';");
die("<script>location.href='clan_castle.php';</script>");
}
if($_POST['add_zay'])
{
mysql_query("INSERT INTO `clan_castle` VALUES ('{$user['id']}','{$user['klan']}');");
die("<script>location.href='clan_castle.php';</script>");
}
?>
<HTML><HEAD>
<!-- JS -->
<script>
function refreshPeriodic()
{
location.href='clan_castle.php';
timerID=setTimeout("refreshPeriodic()",30000);
}
timerID=setTimeout("refreshPeriodic()",30000);
</script>
<link rel=stylesheet type="text/css" href="css/main.css">
<meta content="text/html; charset=utf-8" http-equiv=Content-type>
<META Http-Equiv=Cache-Control Content=no-cache>
<meta http-equiv=PRAGMA content=NO-CACHE>
<META Http-Equiv=Expires Content=0>
</HEAD>
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor=#d4d4d4>
<TABLE border=0 width=600 cellspacing="0" cellpadding="0" align=left>
<tr><td><h3>Замок Мэра</td></tr>
<tr><td><FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="bps"></FORM></td></tr>
<tr><td>Добро пожаловать в Замок доброго и справедливого Мэра!
Если Вы заинтерисованы в обладании правами на Замок, либо считаете что обладаете достаточными способностями для исполнения
обязанностей Мэра, приглашаем Вас и Ваших единомышлеников поселиться в Замке! <br/> <br/>
Внимание! Администрация не несет ответственности за возможные конфликты на основе спора о правах обладания Замком,
целость и сохранность Ваших личных вещей, здоровье и жизни посетителей!<br/>
<?php
$own=mysql_fetch_array(mysql_query("SELECT `value` FROM `variables` WHERE `var` = 'castle_owner' LIMIT 1;"));
if($own['value']>0) $tmp_k=mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$own['value']}' LIMIT 1;"));
echo('<br />Над Замком развевается флаг ');
if($tmp_k['name'])
echo('<strong>клана <img title="'.$tmp_k['name'].'" src="i/clan/'.$tmp_k['name'].'.gif">'.$tmp_k['name'].'</strong><br />');
else
echo('<strong>сил Хаоса</strong><br />');
if($user['align']==2.99) echo('<FORM action="clan_castle.php" method=POST><INPUT TYPE="submit" value="Админ: запустить" name="admin_start"><br></FORM>');
if($user['align']==2.99) echo('<FORM action="clan_castle.php" method=POST><INPUT TYPE="submit" value="Админ: старт боя" name="admin_start1"><br></FORM>');
if($ccd>=time())
{
echo("Следующая битва: ".(date("j.m",$ccd))." в ".(date("H:i",$ccd)));
session_start();
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
elseif($ccd<time() && ($ccd+900)>=time())
{
$zays=array();
echo("Заявили права на Замок Мэра:");
echo('<TABLE border=0 width=100% cellspacing="0" cellpadding="0" align=left>');
$all_c=mysql_query("SELECT * FROM `clan_castle`;");
while ($a_zay=mysql_fetch_array($all_c))
{
$zays[]=$a_zay['clan'];
$tmp_k=mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$a_zay['clan']}' LIMIT 1;"));
echo '<tr><td><strong>Клан <img title="'.$tmp_k['name'].'" src="i/clan/'.$tmp_k['name'].'.gif">'.$tmp_k['name'].'</strong></td></tr>';
}
if(empty($zays))
echo '<tr><td><strong>Ждем смелых ...</strong></td></tr>';
echo('</TABLE>');
echo("<br/>Прием заявок до: <strong>".(date("H:i",$ccd+900))."</strong>");
$own=mysql_fetch_array(mysql_query("SELECT `value` FROM `variables` WHERE `var` = 'castle_owner' LIMIT 1;"));
if ($klan['glava']==$user['id'] && !in_array($user['klan'],$zays) && $user['klan']!=$own['value'])
{
echo("<br />Прием заявок от глав кланов:");
echo '<tr><td><FORM action="clan_castle.php" method=POST><INPUT TYPE="submit" value="Заявиться" name="add_zay"></FORM></td></tr>';
}
}
elseif(($ccd+900)<time() && ($ccd+90+900)>=time())
{
$zays=array();
$all_zay=mysql_query("SELECT * FROM `clan_castle`;");
while ($a_zay=mysql_fetch_array($all_zay))
{
$cur_c=mysql_num_rows(mysql_query("SELECT * FROM `users` WHERE `klan`='{$a_zay['clan']}' AND `room`='45';"));
for($cc=0;$cc<$cur_c;$cc++)
$zays[]=$a_zay['clan'];
}
$own=mysql_fetch_array(mysql_query("SELECT `value` FROM `variables` WHERE `var` = 'castle_owner' LIMIT 1;"));
shuffle($zays);
$lucky=$zays[array_rand($zays)];
// if($lucky>0 && $lucky!=$own['vlaue']);
mysql_query("UPDATE `variables` SET `value`='{$lucky}' WHERE `var`='castle_att';");
$tmp_k=mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$lucky}' LIMIT 1;"));
if($own['value']>0)
$tmp_o=mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$own['value']}' LIMIT 1;"));
if($tmp_k) echo('Внимание!<img title="'.$tmp_k['name'].'" src="i/clan/'.$tmp_k['name'].'.gif"><strong>'.$tmp_k['name'].'</strong> собираются штурмовать замок');
if($tmp_k && $own['value']>0) echo('<img title="'.$tmp_o['name'].'" src="i/clan/'.$tmp_o['name'].'.gif"><strong>'.$tmp_o['name'].'</strong>!');
if($tmp_k && !$own['value']>0) echo('!');
}
elseif(($ccd+90+900)<=time())
{
$att=mysql_fetch_array(mysql_query("SELECT `value` FROM `variables` WHERE `var` = 'castle_att' LIMIT 1;"));
$own=mysql_fetch_array(mysql_query("SELECT `value` FROM `variables` WHERE `var` = 'castle_owner' LIMIT 1;"));
$at_t=array();
$ow_t=array();
if($att['value']>0)
{
$att_r=mysql_query("SELECT `id` FROM `users` WHERE `klan`='{$att['value']}' AND `room`='45';");
while($a=mysql_fetch_array($att_r))
{
$at_on = mysql_fetch_array(mysql_query("select `id` from `online` WHERE `date` >= ".(time()-60)." AND `id` = '{$a['id']}' LIMIT 1;"));
if($at_on[0])
$at_t[]=$a['id'];
}
}
if($own['value']>0)
{
$def_r=mysql_query("SELECT `id` FROM `users` WHERE `klan`='{$own['value']}' AND `room`='45';");
while($o=mysql_fetch_array($def_r))
{
$df_on = mysql_fetch_array(mysql_query("select `id` from `online` WHERE `date` >= ".(time()-60)." AND `id` = '{$o['id']}' LIMIT 1;"));
if($df_on[0])
$ow_t[]=$o['id'];
}
}
if(empty($at_t))
{
echo("Смелых так и не нашлось...<br/>");
}
elseif(empty($ow_t) && ($own['value']>0))
{
echo("Хозяева слили замок без боя...<br/>");
$cc_own=mysql_fetch_array(mysql_query("SELECT `value` FROM variables WHERE var='castle_owner' LIMIT 1;"));
$cc_k=mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$cc_own['value']}' LIMIT 1;"));
$cc_att=mysql_fetch_array(mysql_query("SELECT `value` FROM variables WHERE var='castle_att' LIMIT 1;"));
$cc_a=mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$cc_att['value']}' LIMIT 1;"));
{AddChatSystem('<font color=red><strong>Клан <img title="'.$cc_a['name'].'" src="i/clan/'.$cc_a['name'].'.gif">'.$cc_a['name'].'</strong> без боя забрал у <strong>клана <img title="'.$cc_k['name'].'" src="i/clan/'.$cc_k['name'].'.gif">'.$cc_k['name'].'</strong> Замок Мэра</font>');}
$c_prev=mysql_fetch_array(mysql_query("SELECT `glava`,`align` FROM `clans` WHERE `id`='{$own['value']}' LIMIT 1;"));
mysql_query("UPDATE `users` SET `align`='{$c_prev['align']}',`abil`='' WHERE `id`='{$c_prev['glava']}';");
mysql_query("UPDATE `variables` SET `value`='{$att['value']}' WHERE `var`='castle_owner';");
mysql_query("UPDATE `variables` SET `value`='0' WHERE `var`='castle_att';");
mysql_query("UPDATE `variables` SET `value`='{$tm}' WHERE `var`='cc_time';");
$c_lead=mysql_fetch_array(mysql_query("SELECT `glava` FROM `clans` WHERE `id`='{$att['value']}' LIMIT 1;"));
$abil=array();
for($i=0;$i<10;$i++) $abil[$i]=9;
mysql_query("UPDATE `users` SET `align`='7.97',`abil`='".serialize($abil)."' WHERE `id`='{$c_lead['glava']}';");
mysql_query("DELETE FROM `clan_castle`");
}
elseif($own['value']==0)
{
//побоище против ботов
//ставим ботов
$bots_raw=array
("2897","2897","2897","2897","2897","2897","2897","2897","2897","2897","4150","4150","4156","4156","4156","4156",
"2895","2895","4158","4158","4158","4158","4158","2900");
$bots=array();
foreach($bots_raw as $bot_id)
if($bot_id>0)
{
$b_pers=mysql_fetch_array(mysql_query("SELECT `login`,`maxhp` FROM users WHERE id='{$bot_id}' LIMIT 1;"));
$bot_hp=$b_pers['maxhp'];
$bot_name=$b_pers['login'];
$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '".$bot_name."%';"));
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`) values ('".$bot_name." ".($nb[0]+1)."','".$bot_id."','','".$bot_hp."');");
$bots[]=mysql_insert_id();
}
//отаке!
$teams = array();
foreach($at_t as $b)
foreach($bots as $gf)
{
$teams[$gf][$b] = array(0,0,time());
$teams[$b][$gf] = array(0,0,time());
}
mysql_query("INSERT INTO `battle`
(
`id`,`coment`,`teams`,`timeout`,`type`,`status`,`t1`,`t2`,`to1`,`to2`,`blood`
)
VALUES
(
NULL,'','".serialize($teams)."','3','1','0','".implode(";",$at_t)."','".implode(";",$bots)."','".time()."','".time()."','0'
)");
$id = mysql_insert_id();
// создаем лог
$rr = "<b>";
foreach( $at_t as $k=>$v ) {
if ($k!=0) { $rr.=", "; $rrc.=", "; }
$rr .= Nick::id($v)->full(1);
$rrc .= Nick::id($v)->short();
addchp ('<font color=red>Внимание!</font> Ваш бой начался!<BR>\'; top.frames[\'main\'].location=\'fbattle.php\'; var z = \' ','{[]}'.Nick::id($v)->short().'{[]}');
}
$rr .= "</b> и <b>"; $rrc .= "</b> и <b>";
foreach( $bots as $k=>$v ) {
if ($k!=0) { $rr.=", "; $rrc.=", ";}
$rr .= Nick::id($v)->full(1);
$rrc .= Nick::id($v)->short();
}
$rr .= "</b>";
addch ("<a href=logs.php?log=".$id." target=_blank>Поединок</a> между <B>".$rrc."</B> начался. ",$user['room']);
mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>');");
addlog($id,"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");
$add_time=time();
// всех в БОЙ!!!
foreach($at_t as $k=>$v) {
mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$v}");
}
foreach($bots as $k=>$v) {
mysql_query("UPDATE `bots` SET `battle` ={$id} WHERE `id`= {$v}");
}
mysql_query("DELETE FROM `clan_castle`");
}
elseif(!empty($at_t) && !empty($ow_t))
{
//побоище
$teams = array();
foreach($at_t as $b)
foreach($ow_t as $gf)
{
$teams[$gf][$b] = array(0,0,time());
$teams[$b][$gf] = array(0,0,time());
}
mysql_query("INSERT INTO `battle`
(
`id`,`coment`,`teams`,`timeout`,`type`,`status`,`t1`,`t2`,`to1`,`to2`,`blood`
)
VALUES
(
NULL,'','".serialize($teams)."','3','1','0','".implode(";",$at_t)."','".implode(";",$ow_t)."','".time()."','".time()."','0'
)");
$id = mysql_insert_id();
// создаем лог
$rr = "<b>";
foreach( $at_t as $k=>$v ) {
if ($k!=0) { $rr.=", "; $rrc.=", "; }
$rr .= Nick::id($v)->full(1);
$rrc .= Nick::id($v)->short();
addchp ('<font color=red>Внимание!</font> Ваш бой начался!<BR>\'; top.frames[\'main\'].location=\'fbattle.php\'; var z = \' ','{[]}'.Nick::id($v)->short().'{[]}');
}
$rr .= "</b> и <b>"; $rrc .= "</b> и <b>";
foreach( $ow_t as $k=>$v ) {
if ($k!=0) { $rr.=", "; $rrc.=", ";}
$rr .= Nick::id($v)->full(1);
$rrc .= Nick::id($v)->short();
addchp ('<font color=red>Внимание!</font> Ваш бой начался!<BR>\'; top.frames[\'main\'].location=\'fbattle.php\'; var z = \' ','{[]}'.Nick::id($v)->short().'{[]}');
}
$rr .= "</b>";
addch ("<a href=logs.php?log=".$id." target=_blank>Поединок</a> между <B>".$rrc."</B> начался. ",$user['room']);
mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>');");
$owntravma = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = " . $user['id'] . " AND (type=13 OR type=12 OR type=14) limit 1;"));
$klan = mysql_fetch_array(mysql_query("SELECT * FROM `clans` WHERE `id` = '{$user['klan']}' LIMIT 1;"));
addlog($id,"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <BR>");
$add_time=time();
// всех в БОЙ!!!
foreach($at_t as $k=>$v) {
mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$v}");
}
foreach($ow_t as $k=>$v) {
mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$v}");
}
mysql_query("DELETE FROM `clan_castle`");
}
$tm=time()+23*60*60;
mysql_query("UPDATE `variables` SET `value`='0' WHERE `var`='castle_att';");
include "functions.php";
if ($user->room != 45) {
header("Location: main.php");
exit;
}
if ($user->battle) {
header('location: fbattle.php');
exit;
}
$cc_date = mysql_fetch_array(mysql_query("SELECT * FROM `variables` WHERE `var`='cc_time' LIMIT 1;"));
$ccd = $cc_date['value'];
if ($_POST['admin_start']) {
$tm = time();
mysql_query("UPDATE `variables` SET `value`='{$tm}' WHERE `var`='cc_time';");
mysql_query("DELETE FROM `clan_castle`");
exit("<script>location.href='clan_castle.php';</script>");
}
if ($_POST['admin_start1']) {
$tm = time() - 900;
mysql_query("UPDATE `variables` SET `value`='{$tm}' WHERE `var`='cc_time';");
exit("<script>location.href='clan_castle.php';</script>");
}
?>
</td></tr>
</table>
<div align=right><img width="260" src="i/zamok/4.jpg" /></div>
</BODY>
</HTML>
if ($_POST['add_zay']) {
mysql_query("INSERT INTO `clan_castle` VALUES ('{$user['id']}','{$user['klan']}');");
exit("<script>location.href='clan_castle.php';</script>");
}
Template::header('Замок Мэра');
?>
<script>
function refreshPeriodic() {
location.href = 'clan_castle.php';
timerID = setTimeout("refreshPeriodic()", 30000);
}
timerID = setTimeout("refreshPeriodic()", 30000);
</script>
<TABLE border=0 width=600 cellspacing="0" cellpadding="0" align=left>
<tr>
<td><h3>Замок Мэра</td>
</tr>
<tr>
<td>
<FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="bps"></FORM>
</td>
</tr>
<tr>
<td>Добро пожаловать в Замок доброго и справедливого Мэра!
Если Вы заинтерисованы в обладании правами на Замок, либо считаете что обладаете достаточными способностями
для исполнения
обязанностей Мэра, приглашаем Вас и Ваших единомышлеников поселиться в Замке! <br/> <br/>
Внимание! Администрация не несет ответственности за возможные конфликты на основе спора о правах обладания
Замком,
целость и сохранность Ваших личных вещей, здоровье и жизни посетителей!<br/>
<?php
$own = mysql_fetch_array(mysql_query("SELECT `value` FROM `variables` WHERE `var` = 'castle_owner'"));
if ($own['value'] > 0) {
$tmp_k = mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$own['value']}'"));
}
echo '<br />Над Замком развевается флаг ';
if ($tmp_k['name']) {
echo '<strong>клана <img title="' . $tmp_k['name'] . '" src="i/clan/' . $tmp_k['name'] . '.png">' . $tmp_k['name'] . '</strong><br />';
} else {
echo '<strong>сил Хаоса</strong><br />';
}
if ($user->admin) {
echo '<FORM action="clan_castle.php" method=POST><INPUT TYPE="submit" value="Админ: запустить" name="admin_start"><br></FORM>';
echo '<FORM action="clan_castle.php" method=POST><INPUT TYPE="submit" value="Админ: старт боя" name="admin_start1"><br></FORM>';
}
if ($ccd >= time()) {
echo "Следующая битва: " . (date("j.m", $ccd)) . " в " . (date("H:i", $ccd));
} elseif ($ccd < time() && ($ccd + 900) >= time()) {
$zays = [];
echo "Заявили права на Замок Мэра:";
echo '<TABLE border=0 width=100% cellspacing="0" cellpadding="0" align=left>';
$all_c = mysql_query("SELECT * FROM `clan_castle`;");
while ($a_zay = mysql_fetch_array($all_c)) {
$zays[] = $a_zay['clan'];
$tmp_k = mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$a_zay['clan']}' LIMIT 1;"));
echo '<tr><td><strong>Клан <img title="' . $tmp_k['name'] . '" src="i/clan/' . $tmp_k['name'] . '.png">' . $tmp_k['name'] . '</strong></td></tr>';
}
if (empty($zays)) {
echo '<tr><td><strong>Ждем смелых ...</strong></td></tr>';
}
echo '</TABLE>';
echo "<br/>Прием заявок до: <strong>" . (date("H:i", $ccd + 900)) . "</strong>";
$own = mysql_fetch_array(mysql_query("SELECT `value` FROM `variables` WHERE `var` = 'castle_owner' LIMIT 1;"));
if ($klan['glava'] == $user['id'] && !in_array($user['klan'], $zays) && $user['klan'] != $own['value']) {
echo "<br />Прием заявок от глав кланов:";
echo '<tr><td><FORM action="clan_castle.php" method=POST><INPUT TYPE="submit" value="Заявиться" name="add_zay"></FORM></td></tr>';
}
} elseif (($ccd + 900) < time() && ($ccd + 90 + 900) >= time()) {
$zays = [];
$all_zay = mysql_query("SELECT * FROM `clan_castle`;");
while ($a_zay = mysql_fetch_array($all_zay)) {
$cur_c = mysql_num_rows(mysql_query("SELECT * FROM `users` WHERE `klan`='{$a_zay['clan']}' AND `room`='45';"));
for ($cc = 0; $cc < $cur_c; $cc++) {
$zays[] = $a_zay['clan'];
}
}
$own = mysql_fetch_array(mysql_query("SELECT `value` FROM `variables` WHERE `var` = 'castle_owner' LIMIT 1;"));
shuffle($zays);
$lucky = $zays[array_rand($zays)];
mysql_query("UPDATE `variables` SET `value`='{$lucky}' WHERE `var`='castle_att';");
$tmp_k = mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$lucky}' LIMIT 1;"));
if ($own['value'] > 0) {
$tmp_o = mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$own['value']}' LIMIT 1;"));
}
if ($tmp_k) {
echo 'Внимание!<img title="' . $tmp_k['name'] . '" src="i/clan/' . $tmp_k['name'] . '.png"><strong>' . $tmp_k['name'] . '</strong> собираются штурмовать замок';
}
if ($tmp_k && $own['value'] > 0) {
echo '<img title="' . $tmp_o['name'] . '" src="i/clan/' . $tmp_o['name'] . '.png"><strong>' . $tmp_o['name'] . '</strong>!';
}
if ($tmp_k && !$own['value'] > 0) {
echo '!';
}
} elseif (($ccd + 90 + 900) <= time()) {
$att = mysql_fetch_array(mysql_query("SELECT `value` FROM `variables` WHERE `var` = 'castle_att' LIMIT 1;"));
$own = mysql_fetch_array(mysql_query("SELECT `value` FROM `variables` WHERE `var` = 'castle_owner' LIMIT 1;"));
$at_t = [];
$ow_t = [];
if ($att['value'] > 0) {
$att_r = mysql_query("SELECT `id` FROM `users` WHERE `klan`='{$att['value']}' AND `room`='45';");
while ($a = mysql_fetch_array($att_r)) {
$at_on = mysql_fetch_array(mysql_query("select `id` from `online` WHERE `date` >= " . (time() - 60) . " AND `id` = '{$a['id']}' LIMIT 1;"));
if ($at_on[0]) {
$at_t[] = $a['id'];
}
}
}
if ($own['value'] > 0) {
$def_r = mysql_query("SELECT `id` FROM `users` WHERE `klan`='{$own['value']}' AND `room`='45';");
while ($o = mysql_fetch_array($def_r)) {
$df_on = mysql_fetch_array(mysql_query("select `id` from `online` WHERE `date` >= " . (time() - 60) . " AND `id` = '{$o['id']}' LIMIT 1;"));
if ($df_on[0]) {
$ow_t[] = $o['id'];
}
}
}
if (empty($at_t)) {
echo "Смелых так и не нашлось...<br/>";
} elseif (empty($ow_t) && ($own['value'] > 0)) {
echo "Хозяева слили замок без боя...<br/>";
$cc_own = mysql_fetch_array(mysql_query("SELECT `value` FROM variables WHERE var='castle_owner' LIMIT 1;"));
$cc_k = mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$cc_own['value']}' LIMIT 1;"));
$cc_att = mysql_fetch_array(mysql_query("SELECT `value` FROM variables WHERE var='castle_att' LIMIT 1;"));
$cc_a = mysql_fetch_array(mysql_query("SELECT `name` FROM `clans` WHERE `id` = '{$cc_att['value']}' LIMIT 1;"));
AddChatSystem('<font color=red><strong>Клан <img title="' . $cc_a['name'] . '" src="i/clan/' . $cc_a['name'] . '.png">' . $cc_a['name'] . '</strong> без боя забрал у <strong>клана <img title="' . $cc_k['name'] . '" src="i/clan/' . $cc_k['name'] . '.gif">' . $cc_k['name'] . '</strong> Замок Мэра</font>');
$c_prev = mysql_fetch_array(mysql_query("SELECT `glava`,`align` FROM `clans` WHERE `id`='{$own['value']}' LIMIT 1;"));
mysql_query("UPDATE `users` SET `align`='{$c_prev['align']}',`abil`='' WHERE `id`='{$c_prev['glava']}';");
mysql_query("UPDATE `variables` SET `value`='{$att['value']}' WHERE `var`='castle_owner';");
mysql_query("UPDATE `variables` SET `value`='0' WHERE `var`='castle_att';");
mysql_query("UPDATE `variables` SET `value`='{$tm}' WHERE `var`='cc_time';");
$c_lead = mysql_fetch_array(mysql_query("SELECT `glava` FROM `clans` WHERE `id`='{$att['value']}' LIMIT 1;"));
$abil = [];
for ($i = 0; $i < 10; $i++) {
$abil[$i] = 9;
}
mysql_query("UPDATE `users` SET `align`='7.97',`abil`='" . serialize($abil) . "' WHERE `id`='{$c_lead['glava']}';");
mysql_query("DELETE FROM `clan_castle`");
} elseif ($own['value'] == 0) {
//побоище против ботов
//ставим ботов
$bots_raw = ["2897", "2897", "2897", "2897", "2897", "2897", "2897", "2897", "2897", "2897", "4150", "4150", "4156", "4156", "4156", "4156",
"2895", "2895", "4158", "4158", "4158", "4158", "4158", "2900"];
$bots = [];
foreach ($bots_raw as $bot_id) {
if ($bot_id > 0) {
$b_pers = mysql_fetch_array(mysql_query("SELECT `login`,`maxhp` FROM users WHERE id='{$bot_id}' LIMIT 1;"));
$bot_hp = $b_pers['maxhp'];
$bot_name = $b_pers['login'];
$nb = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `bots` WHERE `name` LIKE '" . $bot_name . "%';"));
mysql_query("INSERT INTO `bots` (`name`,`prototype`,`battle`,`hp`) values ('" . $bot_name . " " . ($nb[0] + 1) . "','" . $bot_id . "','','" . $bot_hp . "');");
$bots[] = mysql_insert_id();
}
}
//отаке!
$teams = [];
foreach ($at_t as $b) {
foreach ($bots as $gf) {
$teams[$gf][$b] = [0, 0, time()];
$teams[$b][$gf] = [0, 0, time()];
}
}
mysql_query("INSERT INTO `battle`
(
`id`,`coment`,`teams`,`timeout`,`type`,`status`,`t1`,`t2`,`to1`,`to2`,`blood`
)
VALUES
(
NULL,'','" . serialize($teams) . "','3','1','0','" . implode(";", $at_t) . "','" . implode(";", $bots) . "','" . time() . "','" . time() . "','0'
)");
$id = mysql_insert_id();
// создаем лог
$rr = "<b>";
foreach ($at_t as $k => $v) {
if ($k != 0) {
$rr .= ", ";
$rrc .= ", ";
}
$rr .= Nick::id($v)->full(1);
$rrc .= Nick::id($v)->short();
addchp('<font color=red>Внимание!</font> Ваш бой начался!<BR>\'; top.frames[\'main\'].location=\'fbattle.php\'; var z = \' ', '{[]}' . Nick::id($v)->short() . '{[]}');
}
$rr .= "</b> и <b>";
$rrc .= "</b> и <b>";
foreach ($bots as $k => $v) {
if ($k != 0) {
$rr .= ", ";
$rrc .= ", ";
}
$rr .= Nick::id($v)->full(1);
$rrc .= Nick::id($v)->short();
}
$rr .= "</b>";
addch("<a href=logs.php?log=" . $id . " target=_blank>Поединок</a> между <B>" . $rrc . "</B> начался. ", $user->room);
mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " бросили вызов друг другу. <BR>');");
addlog($id, "Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " бросили вызов друг другу. <BR>");
$add_time = time();
// всех в БОЙ!!!
foreach ($at_t as $k => $v) {
mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$v}");
}
foreach ($bots as $k => $v) {
mysql_query("UPDATE `bots` SET `battle` ={$id} WHERE `id`= {$v}");
}
mysql_query("DELETE FROM `clan_castle`");
} elseif (!empty($at_t) && !empty($ow_t)) {
//побоище
$teams = [];
foreach ($at_t as $b) {
foreach ($ow_t as $gf) {
$teams[$gf][$b] = [0, 0, time()];
$teams[$b][$gf] = [0, 0, time()];
}
}
mysql_query("INSERT INTO `battle`
(
`id`,`coment`,`teams`,`timeout`,`type`,`status`,`t1`,`t2`,`to1`,`to2`,`blood`
)
VALUES
(
NULL,'','" . serialize($teams) . "','3','1','0','" . implode(";", $at_t) . "','" . implode(";", $ow_t) . "','" . time() . "','" . time() . "','0'
)");
$id = mysql_insert_id();
// создаем лог
$rr = "<b>";
foreach ($at_t as $k => $v) {
if ($k != 0) {
$rr .= ", ";
$rrc .= ", ";
}
$rr .= Nick::id($v)->full(1);
$rrc .= Nick::id($v)->short();
addchp('<font color=red>Внимание!</font> Ваш бой начался!<BR>\'; top.frames[\'main\'].location=\'fbattle.php\'; var z = \' ', '{[]}' . Nick::id($v)->short() . '{[]}');
}
$rr .= "</b> и <b>";
$rrc .= "</b> и <b>";
foreach ($ow_t as $k => $v) {
if ($k != 0) {
$rr .= ", ";
$rrc .= ", ";
}
$rr .= Nick::id($v)->full(1);
$rrc .= Nick::id($v)->short();
addchp('<font color=red>Внимание!</font> Ваш бой начался!<BR>\'; top.frames[\'main\'].location=\'fbattle.php\'; var z = \' ', '{[]}' . Nick::id($v)->short() . '{[]}');
}
$rr .= "</b>";
addch("<a href=logs.php?log=" . $id . " target=_blank>Поединок</a> между <B>" . $rrc . "</B> начался. ", $user->room);
mysql_query("INSERT INTO `logs` (`id`,`log`) VALUES('{$id}','Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " бросили вызов друг другу. <BR>');");
addlog($id, "Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " бросили вызов друг другу. <BR>");
$add_time = time();
// всех в БОЙ!!!
foreach ($at_t as $k => $v) {
mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$v}");
}
foreach ($ow_t as $k => $v) {
mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$v}");
}
mysql_query("DELETE FROM `clan_castle`");
}
$tm = time() + 23 * 60 * 60;
mysql_query("UPDATE `variables` SET `value`='0' WHERE `var`='castle_att';");
mysql_query("UPDATE `variables` SET `value`='{$tm}' WHERE `var`='cc_time';");
mysql_query("DELETE FROM `clan_castle`");
}
?>
</td>
</tr>
</table>
<div align=right><img width="260" src="i/castle.jpg"></div>

View File

@ -47,20 +47,13 @@ if ($klanName && $klanAbbr && $klanDescr) {
err($errorMessage);
}
}
Template::header('Регистратура кланов');
?>
<!doctype html>
<html lang="ru">
<head>
<link rel=stylesheet href="css/main.css">
<meta charset="utf-8">
<script>
function leave() {
top.frames['main'].location = 'city.php?strah'
}
</script>
<title>Регистратура кланов</title>
</head>
<body>
<script>
function leave() {
top.frames['main'].location = 'city.php?strah'
}
</script>
<h1>Регистратура кланов</h1>
<a href=# onclick=leave()> ← выйти из регистратуры</a>
<?php
@ -96,6 +89,4 @@ if ($user->admin) {
placeholder="Информация о клане для энциклопедии"><?= nl2br($klanDescr) ?></textarea><BR>
<input type="submit" value="Подать заявку">
</fieldset>
</form>
</body>
</html>
</form>

View File

@ -1,18 +1,10 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<?php
/**
* Copyright (c) 2018.
* Author: Igor Barkov <lopar.4ever@gmail.com>
* Project name: Battles-Game
*/
Template::header('Список кланов');
include_once "config.php";
$claninf = urldecode(filter_input(INPUT_SERVER,'QUERY_STRING'));
@ -20,16 +12,13 @@ if ($claninf AND ($query = db::c()->query('SELECT * FROM `clans` WHERE `name` =
echo "<h1>{$query['name']}</h1><p>{$query['descr']}</p>";
$clanlist = db::c()->query('SELECT `login`,`status` FROM `users` WHERE `klan` = ?i',$query['id']);
while ($member = $clanlist->fetch_assoc()) {
echo "<img src=i/align_",$query['align'],".gif> <img src=i/clan/",$query['short'],".gif> ",$member['login']," - ",$member['status'],"<br>";
echo "<img src=i/align_",$query['align'],".png> <img src=i/clan/",$query['short'],".png> ",$member['login']," - ",$member['status'],"<br>";
}
} else {
echo "<h1>Список кланов</h1>";
$query = db::c()->query('SELECT `align`,`name`,`short` FROM `clans` ORDER BY `name` ASC');
while ($clanrow = $query->fetch_assoc()) {
$frm = "<img src='i/align_%s.gif'> <img src='i/clan/%s.gif'> <a href='?%s'>%s</a><br>";
$frm = "<img src='i/align_%s.png'> <img src='i/clan/%s.png'> <a href='?%s'>%s</a><br>";
echo sprintf($frm,$clanrow['align'],$clanrow['short'],$clanrow['name'],$clanrow['name']);
}
}
?>
</body>
</html>
}

View File

@ -31,7 +31,7 @@ class Nick extends User
private function getClan()
{
if (isset($this->clan)) {
return sprintf('<img src="i/clan/%s.gif">', $this->clan);
return sprintf('<img src="i/clan/%s.png">', $this->clan);
} else {
return '';
}

View File

@ -10,14 +10,26 @@ class Template
{
}
public static function header($title = null)
/**
* @param string|null $title
* @param int|null $return
*
* @return false|string
*/
public static function header(string $title = null, int $return = null)
{
return <<<HTML_HEADER
$head = <<<HTML_HEADER
<!doctype html>
<html lang="ru">
<meta charset="utf-8">
<link href="/css/main.css" rel="stylesheet">
<link href="/css/btn.css" rel=stylesheet >
<title>$title</title>
HTML_HEADER;
if (!$return) {
echo $head;
return false;
}
return $head;
}
}

View File

@ -12,14 +12,14 @@ class Tournament
global $user;
$chek = mysql_fetch_row(mysql_query("select id from turnament where id=" . $id . " and old=0"));
if ($chek[0] == '') {
die("Жаль, очень жаль....");
exit("Жаль, очень жаль....");
}
if (mysql_query("insert into turnamuser (idturnam,iduser,level) values(" . $id . "," . $user['id'] . "," . $user['level'] . ")")) {
mysql_query("update turnament set kolvo=kolvo+1 where id=" . $id);
echo "Регистрация пройдена!";
} else {
die("Вы уже зарегистрированы.");
exit("Вы уже зарегистрированы.");
}
}
@ -158,7 +158,7 @@ class Tournament
mysql_query("UPDATE `users` SET `battle` = {$id} WHERE `id` = " . $user1 . " OR `id` = " . $user2);
// создаем лог
$rr = "<b>" . Nick::id($user['id'])->full(1) . "</b> и <b>" . Nick::id($jert['id'])->full(1) . "</b>";
addch("<a href=logs.php?log=" . $id . " target=_blank>Бой</a> между <B><b>" . Nick::id($user['id'])->short() . "</b> и <b>" . Nick::id($jert['id'])->short() . "</b> начался. ", $user['room']);
addch("<a href=logs.php?log=" . $id . " target=_blank>Бой</a> между <B><b>" . Nick::id($user['id'])->short() . "</b> и <b>" . Nick::id($jert['id'])->short() . "</b> начался. ", $user->room);
addlog($id, "Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " решили выяснить кто из них сильнее. <i>(турнир)</i><BR>");
return $id;
}

View File

@ -237,7 +237,7 @@ class fbattle
// ставим статус битвы на "нет битвы"
$this->status = 0;
//header ("Location:main.php");
//die();
//exit;
//$this->return = 5;
//return $this->return;
}
@ -414,7 +414,7 @@ class fbattle
// обновить битку
$this->update_battle();
header("Location: " . $_SERVER['PHP_SELF'] . "");
die();
exit;
}
} else {
return false;
@ -1701,7 +1701,7 @@ class fbattle
}
if (in_array($user['room'], Config::$caverooms)) {
if (in_array($user->room, Config::$caverooms)) {
$location = mysql_fetch_array(mysql_query("SELECT `x`, `y`, `dir` FROM `caveparties` WHERE `user` = '" . $this->user['id'] . "' LIMIT 1"));
if ($location['dir'] == 0) {
@ -1790,13 +1790,13 @@ class fbattle
// выносим хп-ку и выходим из боя
mysql_query('UPDATE `battle` SET `t1hist` = \'' . implode(", ", $nks1hist) . '\', `t2hist` = \'' . implode(", ", $nks2hist) . '\' WHERE `id` = ' . $this->battle_data['id'] . ' ;');
addch("<a href=logs.php?log=" . $this->battle_data['id'] . " target=_blank>Поединок</a> между <B>" . $rr . "</B> закончен. ", $user['room']);
addch("<a href=logs.php?log=" . $this->battle_data['id'] . " target=_blank>Поединок</a> между <B>" . $rr . "</B> закончен. ", $user->room);
mysql_query('UPDATE `battle` SET `exp` = \'' . serialize($this->exp) . '\' WHERE `id` = ' . $this->battle_data['id'] . ' ;');
mysql_query("DELETE FROM `bots` WHERE `battle` = {$this->user['battle']};");
mysql_query("UPDATE users SET `battle` =0, `fullhptime` = " . time() . " WHERE `battle` = {$this->user['battle']}");
echo mysql_error();
unset($this->battle);
//header("Location: fbattle.php"); die();
//header("Location: fbattle.php"); exit;
return true;
// =================================================================
}

View File

@ -1,8 +1,8 @@
<?php
if (in_array($user['room'], Config::$caverooms)) {
if (in_array($user->room, Config::$caverooms)) {
$cavedata = Config::$cavedata ?? [];
$floor = mysql_fetch_row(mysql_query("SELECT `floor` FROM `caveparties` WHERE `user` = '$user[id]' LIMIT 1"));
if (!isset($cavedata[$user['room']]['x' . $floor])) {
if (!isset($cavedata[$user->room]['x' . $floor])) {
$floor = 1;
}
}
@ -11,12 +11,12 @@ $lomka1 = $lomka;
foreach ($lomka1 as $k => $v) {
if ($v < _BOTSEPARATOR_) {
if (in_array($user['room'], Config::$caverooms)) {
mysql_query("UPDATE `caveparties` SET `floor` = $floor, `x` = '" . $cavedata[$user['room']]['x' . $floor] . "', `y` = '" . $cavedata[$user['room']]['y' . $floor] . "', `dir` = '" . $cavedata[$user['room']]['dir' . $floor] . "', `loses` = (`loses`+1) WHERE `user` = '$v' LIMIT 1");
if (in_array($user->room, Config::$caverooms)) {
mysql_query("UPDATE `caveparties` SET `floor` = $floor, `x` = '" . $cavedata[$user->room]['x' . $floor] . "', `y` = '" . $cavedata[$user->room]['y' . $floor] . "', `dir` = '" . $cavedata[$user->room]['dir' . $floor] . "', `loses` = (`loses`+1) WHERE `user` = '$v' LIMIT 1");
}
if ($user['laba'] > 0) {
mysql_query('UPDATE `users` SET `x` = `xf`, `y` = `yr` WHERE `id` = "' . $v . '" LIMIT 1');
die('Suka');
exit('Suka');
}
}
}

View File

@ -21,7 +21,7 @@ function cavesys($text)
}
}
if (in_array($user['room'], Config::$caverooms)) {
if (in_array($user->room, Config::$caverooms)) {
include("CaveItems.php");
mysql_query('LOCK TABLES `cavebots` WRITE, `caveitems` WRITE, `shop` WRITE, `caveparties` WRITE');
$location = mysql_fetch_array(mysql_query("SELECT `x`, `y`, `dir`, `floor` FROM `caveparties` WHERE `user` = '$user[id]' LIMIT 1"));
@ -55,7 +55,7 @@ if (in_array($user['room'], Config::$caverooms)) {
$bot = $rec['bot'];
$cnt = $rec['cnt'];
if (@$caveitems[$bot]) {
if ($user['room'] == 621) {
if ($user->room == 621) {
$i = mt_rand(0, (count($caveitems[$bot]) - 1));
$item = $caveitems[$bot][$i];
if (getchance($item['chance'])) {

View File

@ -391,7 +391,7 @@ TASK;
return $r;
}
public function endq($id, $tp, $user)
public function endq($id, $tp, $user):void
{
$pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `delete` = "0" AND `min_lvl` <= "' . $user['level'] . '" AND `max_lvl` >= "' . $user['level'] . '" AND `id` = "' . mysql_real_escape_string($id) . '" LIMIT 1'));
$qlst = mysql_fetch_array(mysql_query('SELECT `id` FROM `actions` WHERE `uid` = "' . $user['id'] . '" AND `vars` = "start_quest' . $pl['id'] . '" AND `vals` = "go" LIMIT 1'));
@ -569,7 +569,7 @@ TASK;
mysql_query('UPDATE `users` SET `money` = "' . $user['money'] . '", `exp` = "' . $user['exp'] . '", `doblest` = "' . $user['doblest'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
$this->error = 'Вы успешно сдали задание!';
$text = '<font style="color: Red;">Внимание!</font> За успешно выполненное задание Вы получили : ' . $c;
$this->msg($text, '{[]}' . $user['login'] . '{[]}', $user['room']);
$this->msg($text, '{[]}' . $user['login'] . '{[]}', $user->room);
} else {
$this->error = 'Не все условия задания были выполнены ...';
}

View File

@ -29,7 +29,9 @@ $byingItemId = (int)filter_input(INPUT_GET, 'set', FILTER_VALIDATE_INT, ['option
if ($putItemId) {
$dress = db::c()->query('SELECT `name`,`duration`,`maxdur`,`cost` FROM `inventory` WHERE `dressed` = 0 AND `id` = ?i AND `owner` = ?i', $putItemId, $_SESSION['uid'])->fetch_assoc();
if (empty($putItemCost)) $putItemCost = $dress['cost'];
if (empty($putItemCost)) {
$putItemCost = $dress['cost'];
}
$commission = ceil($putItemCost / 10); # 10% от суммы с округлением вверх.
if ($user['money'] > $commission) {
@ -39,8 +41,12 @@ if ($putItemId) {
db::c()->query('UPDATE `inventory` SET `setsale` = ?i WHERE `id` = ?i', $putItemCost, $putItemId);
db::c()->query('UPDATE `users` SET `money` = `money` - ?i WHERE `id` = ?i', $commission, $_SESSION['uid']);
$status = "Вы сдали в магазин «{$dress['name']}» за {$putItemCost} кр. Вычтено за услуги магазина: {$commission} кр.";
} else $status = "Предмет не найден в инвентаре!";
} else $status = "У вас не хватает " . $commission - $user['money'] . " кр. чтобы оплатить комиссию!";
} else {
$status = "Предмет не найден в инвентаре!";
}
} else {
$status = "У вас не хватает " . $commission - $user['money'] . " кр. чтобы оплатить комиссию!";
}
}
if ($returningItemId) {
@ -50,7 +56,9 @@ if ($returningItemId) {
addToDelo($deloText);
db::c()->query('UPDATE `inventory` SET `setsale` = 0 WHERE `id` = ?i', $returningItemId);
$status = "Вы забрали из магазина ваш «{$dress['name']}».";
} else $status = "Предмет не найден на полках магазина!";
} else {
$status = "Предмет не найден на полках магазина!";
}
}
if ($byingItemId) {
@ -68,9 +76,13 @@ if ($byingItemId) {
$deloText = "{$seller['login']} продал на рынке товар: «{$dress['name']}» id:({$byingItemId}) [{$dress['duration']}/{$dress['maxdur']}] персонажу {$user['login']} за {$dress['setsale']} кр.";
addToDelo($deloText, $dress['owner']);
$user['money'] = $user['money'] - $dress['setsale'];
telegraph($dress['owner'],"Предмет «{$dress['name']}» продан на рынке за {$dress['setsale']} кр.");
} else $status = "Недостаточно средств!";
} else $status = "Предмет не найден на полках магазина!";
telegraph($dress['owner'], "Предмет «{$dress['name']}» продан на рынке за {$dress['setsale']} кр.");
} else {
$status = "Недостаточно средств!";
}
} else {
$status = "Предмет не найден на полках магазина!";
}
}
$classPrintControlName = "marketbuy";
@ -132,15 +144,9 @@ while ($row = $data->fetch_assoc()) {
$iteminfo[] = new ShopItem($row);
}
Template::header('Рынок');
?>
<HTML>
<HEAD>
<link rel=stylesheet href="css/main.css">
<script src="js/main.js"></script>
<meta charset="utf-8">
<title>Рынок</title>
</HEAD>
<body>
<script src="js/main.js"></script>
<h1>Рынок</h1>
<a href=# onclick=hrefToFrame('city.php?cp')> ← выйти на Центральную площадь</a>
<div><?php if (!empty($status)) err($status); ?></div>
@ -198,6 +204,4 @@ while ($row = $data->fetch_assoc()) {
</div>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
</TABLE>

View File

@ -52,16 +52,20 @@ function getlist($razdel = 1, $level = null, $id = null)
function delzayavka($id, $zay, $r)
{
$z = getlist($r, null, $zay);
if ($z[$zay]['level'] > 3) return 'Ай-ай-ай!';
if ($z[$zay]['level'] > 3) {
return 'Ай-ай-ай!';
}
if (db::c()->query('DELETE FROM `zayavka` WHERE `id` = ?i AND (`team1` LIKE "?S" OR `team2` LIKE "?S")', $zay, $id.';%', $id.';%')) {
if (count($z[$zay]['team1']) > 0)
foreach ($z[$zay]['team1'] as $k => $v)
if (count($z[$zay]['team1']) > 0) {
foreach ($z[$zay]['team1'] as $k => $v) {
db::c()->query('UPDATE `users` SET `zayavka` = 0 WHERE `id` = ?i', $v);
if (count($z[$zay]['team2']) > 0)
foreach ($z[$zay]['team2'] as $k => $v)
}
}
if (count($z[$zay]['team2']) > 0) {
foreach ($z[$zay]['team2'] as $k => $v) {
db::c()->query('UPDATE `users` SET `zayavka` = 0 WHERE `id` = ?i', $v);
}
}
}
return true;
}
@ -166,16 +170,10 @@ function startbattle($id, $zay, $r)
file_get_contents(GAMEDOMAIN . '/chats.php?id=6&user=' . $v);
}
mysql_query("DELETE FROM `zayavka` WHERE `id` = '" . $zay . "' LIMIT 1");
die();
exit;
}
$arr = [3, 4, 5, 7, 10];
if (in_array($z['timeout'], $arr)) {
} else {
$z['timeout'] = 3;
}
$z['timeout'] = 3;
if ($z['type'] == 1 || $z['type'] == 4) {
$rs = ', `fiz`';
@ -267,51 +265,10 @@ if (date("H-i") == "03-00") {
mysql_query("OPTIMIZE `battle`, `delo`");
}
// Снятие VIP. Раз в день, полночь.
if (date("H-i") == "00-00") {
$q = db::c()->query('SELECT `id`,`vip`,`vip_time` FROM `users` WHERE `vip` > 0 AND `vip_time` > 0');
while ($unvip = $q->fetch_assoc()) {
if ($unvip['vip'] > 0 AND $unvip['vip_time'] <= time()) {
db::c()->query('UPDATE `users` SET `vip` = 0, `vip_time` = 0 WHERE `id` = ?i', $unvip['id']);
db::c()->query('UPDATE `abils_vip` SET `sokr` = 0, `zash` = 0, `invisible` = 0, `attack` = 0, `bloodattack` = 0, `sleep30` = 0, `travmoff` = 0, `unsleep` = 0, `pers_attack` = 0 WHERE `uid` = ?i', $unvip['id']);
}
}
}
// Обновление вип-способностей.
$sp = db::c()->query('SELECT `id`,`vip` FROM `users` WHERE `vip` > 0 AND `vip_time` > ?i', time());
while ($pl = $sp->fetch_assoc()) {
$abils = db::c()->query('SELECT `attack`, `bloodattack`, `travmoff` FROM `abils_vip` WHERE `uid` = ?i', $pl['id'])->fetch_assoc();
if ($pl['vip'] == 1) $abils['travmoff'] = 0;
else $abils['travmoff'] += 1;
$abils['attack'] += 1;
$abils['bloodattack'] += 1;
if ($abils['attack'] > 10) $abils['attack'] = 10;
if ($abils['bloodattack'] > 10) $abils['bloodattack'] = 10;
if ($abils['travmoff'] > 10) $abils['travmoff'] = 10;
db::c()->query('UPDATE `abils_vip` SET `sokr` = 1, `zash` = 1, `attack` = ?i, `bloodattack` = ?i, `travmoff` = ?i WHERE `uid` = ?i', $abils['attack'], $abils['bloodattack'], $abils['travmoff'], $pl['id']);
}
mysql_query('UPDATE `actions` SET `vals` = "end" WHERE `vars` LIKE "start_quest%" AND `vals` = "go" AND `val` <= "' . time() . '"');
// Раз в день. 6 утра.
if (date("H-i") == "06-00") {
// Первое число каждого месяца.
if (date("d") == "01") {
mysql_query("UPDATE `variables` SET `value` = '{$tm}' WHERE `var` = 'ref_month' LIMIT 1");
mysql_query("UPDATE `variables` SET `value` = '0' WHERE `var` = 'ref_m_id' LIMIT 1");
}
// Каждый седьмой день недели.
if (date("N") == "7") {
mysql_query("UPDATE `variables` SET `value` = '{$tm}' WHERE `var` = 'ref_week' LIMIT 1");
mysql_query("UPDATE `variables` SET `value` = '0' WHERE `var` = 'ref_w_id' LIMIT 1");
}
}
$st_ar = mysql_fetch_array(mysql_query('SELECT `value` FROM `variables` WHERE `var` = "arena_of_gods" LIMIT 1'));
if ($st_ar['value'] <= time()) {
@ -354,36 +311,31 @@ while ($ku = mysql_fetch_array($komp_users)) {
db::c()->query('UPDATE `users` SET `hp` = 0 WHERE `hp` < 0');
db::c()->query('UPDATE `users` SET `mana` = 0 WHERE `mana` < 0');
$its = mysql_query("SELECT `id`, `owner`, `name` FROM `inventory` WHERE AND ((`maxdur` <= `duration`) OR (`dategoden` > 0 AND `dategoden` <= '" . time() . "'))");
while ($it = mysql_fetch_array($its)) {
mysql_query("DELETE FROM `inventory` WHERE `id` = '" . $it['id'] . "' LIMIT 1;");
mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '" . $it['owner'] . "' '\"" . $it['name'] . "\" разрушился id:(cap" . $it['id'] . ").', 1, '" . time() . "')");
}
$effs = mysql_query("SELECT * FROM `effects` WHERE `time` <= " . time() . " AND `sleep` = 0");
mysql_query("DELETE FROM `effects` WHERE `time` <= " . time() . " AND `sleep` = 0");
while ($eff = mysql_fetch_array($effs)) {
switch ($eff['type']) {
case 11:
mysql_query("UPDATE `users` SET `sila` = `sila`+'" . $eff['sila'] . "', `lovk` = `lovk`+'" . $eff['lovk'] . "', `inta` = `inta`+'" . $eff['inta'] . "' WHERE `id` = '" . $eff['owner'] . "' LIMIT 1");
mysql_query("UPDATE `users` SET `sila` = `sila`+'" . $eff['sila'] . "', `lovk` = `lovk`+'" . $eff['lovk'] . "', `inta` = `inta`+'" . $eff['inta'] . "' WHERE `id` = '" . $eff['owner'] . "' ");
break;
case 12:
mysql_query("UPDATE `users` SET `sila` = `sila`+'" . $eff['sila'] . "', `lovk` = `lovk`+'" . $eff['lovk'] . "', `inta` = `inta`+'" . $eff['inta'] . "' WHERE `id` = '" . $eff['owner'] . "' LIMIT 1");
mysql_query("UPDATE `users` SET `sila` = `sila`+'" . $eff['sila'] . "', `lovk` = `lovk`+'" . $eff['lovk'] . "', `inta` = `inta`+'" . $eff['inta'] . "' WHERE `id` = '" . $eff['owner'] . "' ");
break;
case 13:
mysql_query("UPDATE `users` SET `sila` = `sila`+'" . $eff['sila'] . "', `lovk` = `lovk`+'" . $eff['lovk'] . "', `inta` = `inta`+'" . $eff['inta'] . "' WHERE `id` = '" . $eff['owner'] . "' LIMIT 1");
mysql_query("UPDATE `users` SET `sila` = `sila`+'" . $eff['sila'] . "', `lovk` = `lovk`+'" . $eff['lovk'] . "', `inta` = `inta`+'" . $eff['inta'] . "' WHERE `id` = '" . $eff['owner'] . "' ");
break;
case 14:
mysql_query("UPDATE `users` SET `sila` = `sila`+'" . $eff['sila'] . "', `lovk` = `lovk`+'" . $eff['lovk'] . "', `inta` = `inta`+'" . $eff['inta'] . "' WHERE `id` = '" . $eff['owner'] . "' LIMIT 1");
mysql_query("UPDATE `users` SET `sila` = `sila`+'" . $eff['sila'] . "', `lovk` = `lovk`+'" . $eff['lovk'] . "', `inta` = `inta`+'" . $eff['inta'] . "' WHERE `id` = '" . $eff['owner'] . "' ");
break;
case 21:
mysql_query("UPDATE `users` SET `sila` = `sila`-'" . $eff['sila'] . "', `lovk` = `lovk`-'" . $eff['lovk'] . "', `inta` = `inta`-'" . $eff['inta'] . "', `vinos` = `vinos`-'" . $eff['vinos'] . "' WHERE `id` = '" . $eff['owner'] . "' LIMIT 1");
mysql_query("UPDATE `users` SET `sila` = `sila`-'" . $eff['sila'] . "', `lovk` = `lovk`-'" . $eff['lovk'] . "', `inta` = `inta`-'" . $eff['inta'] . "', `vinos` = `vinos`-'" . $eff['vinos'] . "' WHERE `id` = '" . $eff['owner'] . "' ");
break;
case 4:
mysql_query("UPDATE `users` SET `align` = '0' WHERE `id` = '" . $eff['owner'] . "' LIMIT 1");
mysql_query("UPDATE `users` SET `align` = '0' WHERE `id` = '" . $eff['owner'] . "'");
break;
case 7:
mysql_query("UPDATE `users` SET `maxhp` = (`maxhp`-200), `hp` = `maxhp` WHERE `id` = '" . $eff['owner'] . "' LIMIT 1");
mysql_query("UPDATE `users` SET `maxhp` = (`maxhp`-200), `hp` = `maxhp` WHERE `id` = '" . $eff['owner'] . "'");
break;
case 1022:
mysql_query("UPDATE `users` SET `invis` = 0 WHERE `id` = '" . $eff['owner'] . "' LIMIT 1");

View File

@ -432,7 +432,7 @@ class fbattle
addActions(time(), 'win_fiz', 0, $this->user['id']);
}
if (in_array($user['room'], Config::$caverooms)) {
if (in_array($user->room, Config::$caverooms)) {
$location = mysql_fetch_array(mysql_query("SELECT `x`, `y`, `dir` FROM `caveparties` WHERE `user` = '" . $this->user['id'] . "' LIMIT 1"));
if ($location['dir'] == 0) {
$y = $location['y'] * 2;
@ -462,7 +462,7 @@ class fbattle
$winers .= implode("</B>, <B>", $this->t2);
$lomka = $this->t1;
} else {
if (in_array($user['room'], Config::$caverooms)) {
if (in_array($user->room, Config::$caverooms)) {
$location = mysql_fetch_array(mysql_query("SELECT `x`, `y`, `dir` FROM `caveparties` WHERE `user` = '" . $this->user['id'] . "' LIMIT 1"));
if ($location['dir'] == 0) {
$y = $location['y'] * 2;
@ -866,7 +866,7 @@ class fbattle
$this->FastDeath();
$this->UpdateBattle();
#header('Location: fbattle.php');
die();
exit;
}
} else {
return false;
@ -1062,7 +1062,7 @@ class fbattle
}
$this->UpdateBattle();
header("Location: " . $_SERVER['PHP_SELF'] . "");
die();
exit;
}
} else {
return false;

View File

@ -1,27 +0,0 @@
<?php
require_once "../config.php";
// Осталось понять что делает, зачем написан и какой интервал запуска.
// 4 hours: time() + 14400;
$q = db::c()->query('SELECT `value` FROM `variables` WHERE `var` = "?s"', 'pole_random')->fetch_assoc();
for ($i = 0; $i < 41; $i++) {
$rand = mt_rand(1, 9);
if ($rand == 1) $h = 100;
elseif ($rand == 2) $h = 80;
elseif ($rand == 3) $h = 70;
elseif ($rand == 4) $h = 60;
elseif ($rand == 5) $h = 50;
elseif ($rand == 6) $h = 40;
elseif ($rand == 7 || $rand == 8 || $rand == 9) $h = 0;
$h += $h * mt_rand(1, 11) / 10;
$rekr = 0.1 + mt_rand(1, 13) / 100;
db::c()->query('UPDATE `pole` SET `type` = ?i, `heals` = ?i, `ekr` = ?i WHERE `id` = ?i', $rand, $h, $rekr, $i);
}
if (empty($q['value']))
db::c()->query('UPDATE `variables` SET `value` = ?i WHERE `var` = "?s"', (time() + 14400), 'pole_random');
elseif ($q['value'] < time())
db::c()->query('UPDATE `variables` SET `value` = `value` + 14400 WHERE `var` = "?s"', 'pole_random');

File diff suppressed because one or more lines are too long

View File

@ -1,42 +0,0 @@
body {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
}
select, textarea, input {
border: solid 1pt #B0B0B0;
font-family: MS Sans Serif;
font-size: 8px;
color: #191970;
MARGIN-BOTTOM: 2px;
MARGIN-TOP: 1px;
}
.text_msg {
border: 1px solid #CCCCCC;
font-size: 11px;
color: #000000;
font-family: Verdana, Arial, Helvetica, Tahoma, sans-serif;
}
.chatBtn1_1,
.chatBtn1_2,
.chatBtn2_1,
.chatBtn2_2,
.chatBtn4_1,
.chatBtn4_2,
.chatBtn5_1,
.chatBtn5_2,
.chatBtn5_3,
.chatBtn6_1,
.chatBtn6_2,
.chatBtn7_1,
.chatBtn7_2,
.chatBtn7_3 {
width: 30px;
height: 30px;
cursor: pointer;
}

File diff suppressed because one or more lines are too long

View File

@ -1,207 +0,0 @@
body {
margin: 0;
height: 100%;
width: 100%;
background-color: #dedede;
font-size:10px;
color: #000000;
}
.main_text {
font-weight: bold;
font-size: 10px;
text-decoration: none;
color:#f0f0f0;
cursor:hand;
}
.menutop, a.menutop:visited, a.menutop:active {
font-weight: bold;
font-size: 10px;
text-decoration: none;
color: #3B3936;
}
a.menutop:hover {
color: #76726b;
}
.name {
font-weight: bold;
font-size: 12px;
}
.parametr_title {
font-weight: bold;
font-size: 11px;
color: #777773;
}
.prname {
padding-left: 4px;
font-size: 11px;
font-family: Arial, Helvetica, sans-serif;
}
.prvalue {
font-size: 11px;
font-family: Arial, Helvetica, sans-serif;
}
.btn {
border: 1px double #9a9996;
background-image: url(i/move/beg_butt.gif);
font-size: 7.5pt;
color: #dfdfdf;
background-color:#504F4C;
}
.mainmenu {
color: #23292C;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: none;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #969697;
border-right-color: #969697;
border-bottom-color: #000000;
border-left-color: #969697;
background-color: #BABABB;
cursor:hand;
}
.maptext {
font-weight: bold;
font-size: 12px;
color: #000000;
font-family: Arial, Helvetica, sans-serif;
}
.posit {
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #FFFFFF;
border-right-color: #666666;
border-bottom-color: #666666;
border-left-color: #FFFFFF;
padding: 2px;
}
td {
font-size: 10pt;
font-family: Verdana, Arial, Helvetica, Tahoma, sans-serif;
}

View File

@ -1,57 +0,0 @@
DIV.Dungeon{
width: 372px;
height: 260px;
padding: 10px;
position: relative;
overflow: hidden;
background: black;
}
.Dungeon BUTTON {
border: 0 solid;
background: transparent;
padding: 0;
margin: 0;
position: absolute;
filter: Alpha(opacity=100),Chroma( Color=#c1cacf );
}
.Dungeon DIV {
width: 352px;
height: 240px;
overflow: hidden;
position: relative;
}
DIV.Life{position:absolute;background:#008000;height:2px;}
DIV.Life2{position:absolute;background:#00FF00;height:2px;}
.Dungeon .Floor0{ background: url( ../i/sprites/cs/bg0.gif ) black }
.Dungeon .Floor1{ background: url( ../i/sprites/cs/bg1.gif ) black }
.Dungeon .LeftSide4_1 { background: url( ../i/sprites/cs/Left/4_1.gif ) no-repeat; }
.Dungeon .RightSide4_1 { background: url( ../i/sprites/cs/Right/4_1.gif ) no-repeat; }
.Dungeon .LeftSide4_0 { background: url( ../i/sprites/cs/Left/4_0.gif ) no-repeat; }
.Dungeon .RightSide4_0 { background: url( ../i/sprites/cs/Right/4_0.gif ) no-repeat; }
.Dungeon .LeftFront3_2 { background: url( ../i/sprites/cs/Left/Front/4_2.gif ) no-repeat; }
.Dungeon .RightFront3_2 { background: url( ../i/sprites/cs/Right/Front/4_2.gif ) no-repeat; }
.Dungeon .LeftFront3_1 { background: url( ../i/sprites/cs/Left/Front/4_1.gif ) no-repeat; }
.Dungeon .RightFront3_1 { background: url( ../i/sprites/cs/Right/Front/4_1.gif ) no-repeat; }
.Dungeon .LeftFront3_0 { background: url( ../i/sprites/cs/Left/Front/4_0.gif ) no-repeat; }
.Dungeon .LeftSide3_1 { background: url( ../i/sprites/cs/Left/3_1.gif ) no-repeat; }
.Dungeon .RightSide3_1 { background: url( ../i/sprites/cs/Right/3_1.gif ) no-repeat; }
.Dungeon .LeftSide3_0 { background: url( ../i/sprites/cs/Left/3_0.gif ) no-repeat; }
.Dungeon .RightSide3_0 { background: url( ../i/sprites/cs/Right/3_0.gif ) no-repeat; }
.Dungeon .LeftFront2_1 { background: url( ../i/sprites/cs/Left/Front/3_1.gif ) no-repeat; }
.Dungeon .RightFront2_1 { background: url( ../i/sprites/cs/Right/Front/3_1.gif ) no-repeat; }
.Dungeon .LeftFront2_0 { background: url( ../i/sprites/cs/Left/Front/3_0.gif ) no-repeat; }
.Dungeon .LeftSide2_0 { background: url( ../i/sprites/cs/Left/2_0.gif ) no-repeat; }
.Dungeon .RightSide2_0 { background: url( ../i/sprites/cs/Right/2_0.gif ) no-repeat; }
.Dungeon .LeftFront1_1 { background: url( ../i/sprites/cs/Left/Front/2_1.gif ) no-repeat; }
.Dungeon .RightFront1_1 { background: url( ../i/sprites/cs/Right/Front/2_1.gif ) no-repeat; }
.Dungeon .LeftFront1_0 { background: url( ../i/sprites/cs/Left/Front/2_0.gif ) no-repeat; }
.Dungeon .LeftSide1_0 { background: url( ../i/sprites/cs/Left/1_0.gif ) no-repeat; }
.Dungeon .RightSide1_0 { background: url( ../i/sprites/cs/Right/1_0.gif ) no-repeat; }
.Dungeon .LeftFront0_1 { background: url( ../i/sprites/cs/Left/Front/1_1.gif ) no-repeat; }
.Dungeon .RightFront0_1 { background: url( ../i/sprites/cs/Right/Front/1_1.gif ) no-repeat; }
.Dungeon .LeftFront0_0 { background: url( ../i/sprites/cs/Left/Front/1_0.gif ) no-repeat; }
.Dungeon .LeftSide0_0 { background: url( ../i/sprites/cs/Left/0_0.gif ) no-repeat; }
.Dungeon .RightSide0_0 { background: url( ../i/sprites/cs/Right/0_0.gif ) no-repeat; }

View File

@ -1,57 +0,0 @@
DIV.Dungeon{
width: 372px;
height: 260px;
padding: 10px;
position: relative;
overflow: hidden;
background: black;
}
.Dungeon BUTTON {
border: 0 solid;
background: transparent;
padding: 0;
margin: 0;
position: absolute;
filter: Alpha(opacity=100),Chroma( Color=#c1cacf );
}
.Dungeon DIV {
width: 352px;
height: 240px;
overflow: hidden;
position: relative;
}
DIV.Life{position:absolute;background:#008000;height:2px;}
DIV.Life2{position:absolute;background:#00FF00;height:2px;}
.Dungeon .Floor0{ background: url( ../i/sprites/noob/bg0.gif ) black }
.Dungeon .Floor1{ background: url( ../i/sprites/noob/bg1.gif ) black }
.Dungeon .LeftSide4_1 { background: url( ../i/sprites/noob/Left/4_1.gif ) no-repeat; }
.Dungeon .RightSide4_1 { background: url( ../i/sprites/noob/Right/4_1.gif ) no-repeat; }
.Dungeon .LeftSide4_0 { background: url( ../i/sprites/noob/Left/4_0.gif ) no-repeat; }
.Dungeon .RightSide4_0 { background: url( ../i/sprites/noob/Right/4_0.gif ) no-repeat; }
.Dungeon .LeftFront3_2 { background: url( ../i/sprites/noob/Left/Front/4_2.gif ) no-repeat; }
.Dungeon .RightFront3_2 { background: url( ../i/sprites/noob/Right/Front/4_2.gif ) no-repeat; }
.Dungeon .LeftFront3_1 { background: url( ../i/sprites/noob/Left/Front/4_1.gif ) no-repeat; }
.Dungeon .RightFront3_1 { background: url( ../i/sprites/noob/Right/Front/4_1.gif ) no-repeat; }
.Dungeon .LeftFront3_0 { background: url( ../i/sprites/noob/Left/Front/4_0.gif ) no-repeat; }
.Dungeon .LeftSide3_1 { background: url( ../i/sprites/noob/Left/3_1.gif ) no-repeat; }
.Dungeon .RightSide3_1 { background: url( ../i/sprites/noob/Right/3_1.gif ) no-repeat; }
.Dungeon .LeftSide3_0 { background: url( ../i/sprites/noob/Left/3_0.gif ) no-repeat; }
.Dungeon .RightSide3_0 { background: url( ../i/sprites/noob/Right/3_0.gif ) no-repeat; }
.Dungeon .LeftFront2_1 { background: url( ../i/sprites/noob/Left/Front/3_1.gif ) no-repeat; }
.Dungeon .RightFront2_1 { background: url( ../i/sprites/noob/Right/Front/3_1.gif ) no-repeat; }
.Dungeon .LeftFront2_0 { background: url( ../i/sprites/noob/Left/Front/3_0.gif ) no-repeat; }
.Dungeon .LeftSide2_0 { background: url( ../i/sprites/noob/Left/2_0.gif ) no-repeat; }
.Dungeon .RightSide2_0 { background: url( ../i/sprites/noob/Right/2_0.gif ) no-repeat; }
.Dungeon .LeftFront1_1 { background: url( ../i/sprites/noob/Left/Front/2_1.gif ) no-repeat; }
.Dungeon .RightFront1_1 { background: url( ../i/sprites/noob/Right/Front/2_1.gif ) no-repeat; }
.Dungeon .LeftFront1_0 { background: url( ../i/sprites/noob/Left/Front/2_0.gif ) no-repeat; }
.Dungeon .LeftSide1_0 { background: url( ../i/sprites/noob/Left/1_0.gif ) no-repeat; }
.Dungeon .RightSide1_0 { background: url( ../i/sprites/noob/Right/1_0.gif ) no-repeat; }
.Dungeon .LeftFront0_1 { background: url( ../i/sprites/noob/Left/Front/1_1.gif ) no-repeat; }
.Dungeon .RightFront0_1 { background: url( ../i/sprites/noob/Right/Front/1_1.gif ) no-repeat; }
.Dungeon .LeftFront0_0 { background: url( ../i/sprites/noob/Left/Front/1_0.gif ) no-repeat; }
.Dungeon .LeftSide0_0 { background: url( ../i/sprites/noob/Left/0_0.gif ) no-repeat; }
.Dungeon .RightSide0_0 { background: url( ../i/sprites/noob/Right/0_0.gif ) no-repeat; }

View File

@ -1,62 +0,0 @@
DIV.Dungeon{
width: 372px;
height: 260px;
padding: 10px;
position: relative;
overflow: hidden;
background: black;
}
.Dungeon BUTTON {
border: 0 solid;
background: transparent;
padding: 0;
margin: 0;
position: absolute;
filter: Alpha(opacity=100),Chroma( Color=#c1cacf );
}
.Dungeon DIV {
width: 352px;
height: 240px;
overflow: hidden;
position: relative;
}
.Dungeon IMG {
width: 352px;
height: 240px;
position: relative;
}
DIV.Life{position:absolute;background:#008000;height:2px;}
DIV.Life2{position:absolute;background:#00FF00;height:2px;}
.Dungeon .Floor0{ background: url( http://img.combats.ru/i/sprites/gy0/bg0.gif ) black }
.Dungeon .Floor1{ background: url( http://img.combats.ru/i/sprites/gy0/bg1.gif ) black }
.Dungeon .LeftSide4_1 { background: url( http://img.combats.ru/i/sprites/gy0/Left/4_1.gif ) }
.Dungeon .RightSide4_1 { background: url( http://img.combats.ru/i/sprites/gy0/Right/4_1.gif ) }
.Dungeon .LeftSide4_0 { background: url( http://img.combats.ru/i/sprites/gy0/Left/4_0.gif ) }
.Dungeon .RightSide4_0 { background: url( http://img.combats.ru/i/sprites/gy0/Right/4_0.gif ) }
.Dungeon .LeftFront3_2 { background: url( http://img.combats.ru/i/sprites/gy0/Left/Front/4_2.gif ) }
.Dungeon .RightFront3_2 { background: url( http://img.combats.ru/i/sprites/gy0/Right/Front/4_2.gif ) }
.Dungeon .LeftFront3_1 { background: url( http://img.combats.ru/i/sprites/gy0/Left/Front/4_1.gif ) }
.Dungeon .RightFront3_1 { background: url( http://img.combats.ru/i/sprites/gy0/Right/Front/4_1.gif ) }
.Dungeon .LeftFront3_0 { background: url( http://img.combats.ru/i/sprites/gy0/Left/Front/4_0.gif ) }
.Dungeon .LeftSide3_1 { background: url( http://img.combats.ru/i/sprites/gy0/Left/3_1.gif ) }
.Dungeon .RightSide3_1 { background: url( http://img.combats.ru/i/sprites/gy0/Right/3_1.gif ) }
.Dungeon .LeftSide3_0 { background: url( http://img.combats.ru/i/sprites/gy0/Left/3_0.gif ) }
.Dungeon .RightSide3_0 { background: url( http://img.combats.ru/i/sprites/gy0/Right/3_0.gif ) }
.Dungeon .LeftFront2_1 { background: url( http://img.combats.ru/i/sprites/gy0/Left/Front/3_1.gif ) }
.Dungeon .RightFront2_1 { background: url( http://img.combats.ru/i/sprites/gy0/Right/Front/3_1.gif ) }
.Dungeon .LeftFront2_0 { background: url( http://img.combats.ru/i/sprites/gy0/Left/Front/3_0.gif ) }
.Dungeon .LeftSide2_0 { background: url( http://img.combats.ru/i/sprites/gy0/Left/2_0.gif ) }
.Dungeon .RightSide2_0 { background: url( http://img.combats.ru/i/sprites/gy0/Right/2_0.gif ) }
.Dungeon .LeftFront1_1 { background: url( http://img.combats.ru/i/sprites/gy0/Left/Front/2_1.gif ) }
.Dungeon .RightFront1_1 { background: url( http://img.combats.ru/i/sprites/gy0/Right/Front/2_1.gif ) }
.Dungeon .LeftFront1_0 { background: url( http://img.combats.ru/i/sprites/gy0/Left/Front/2_0.gif ) }
.Dungeon .LeftSide1_0 { background: url( http://img.combats.ru/i/sprites/gy0/Left/1_0.gif ) }
.Dungeon .RightSide1_0 { background: url( http://img.combats.ru/i/sprites/gy0/Right/1_0.gif ) }
.Dungeon .LeftFront0_1 { background: url( http://img.combats.ru/i/sprites/gy0/Left/Front/1_1.gif ) }
.Dungeon .RightFront0_1 { background: url( http://img.combats.ru/i/sprites/gy0/Right/Front/1_1.gif ) }
.Dungeon .LeftFront0_0 { background: url( http://img.combats.ru/i/sprites/gy0/Left/Front/1_0.gif ) }
.Dungeon .LeftSide0_0 { background: url( http://img.combats.ru/i/sprites/gy0/Left/0_0.gif ) }
.Dungeon .RightSide0_0 { background: url( http://img.combats.ru/i/sprites/gy0/Right/0_0.gif ) }

View File

@ -1,57 +0,0 @@
DIV.Dungeon{
width: 372px;
height: 260px;
padding: 10px;
position: relative;
overflow: hidden;
background: black;
}
.Dungeon BUTTON {
border: 0 solid;
background: transparent;
padding: 0;
margin: 0;
position: absolute;
filter: Alpha(opacity=100),Chroma( Color=#c1cacf );
}
.Dungeon DIV {
width: 352px;
height: 240px;
overflow: hidden;
position: relative;
}
DIV.Life{position:absolute;background:#008000;height:2px;}
DIV.Life2{position:absolute;background:#00FF00;height:2px;}
.Dungeon .Floor0{ background: url( http://img.combats.ru/i/sprites/kn4/bg0.gif ) black }
.Dungeon .Floor1{ background: url( http://img.combats.ru/i/sprites/kn4/bg1.gif ) black }
.Dungeon .LeftSide4_1 { background: url( http://img.combats.ru/i/sprites/kn4/Left/4_1.gif ) }
.Dungeon .RightSide4_1 { background: url( http://img.combats.ru/i/sprites/kn4/Right/4_1.gif ) }
.Dungeon .LeftSide4_0 { background: url( http://img.combats.ru/i/sprites/kn4/Left/4_0.gif ) }
.Dungeon .RightSide4_0 { background: url( http://img.combats.ru/i/sprites/kn4/Right/4_0.gif ) }
.Dungeon .LeftFront3_2 { background: url( http://img.combats.ru/i/sprites/kn4/Left/Front/4_2.gif ) }
.Dungeon .RightFront3_2 { background: url( http://img.combats.ru/i/sprites/kn4/Right/Front/4_2.gif ) }
.Dungeon .LeftFront3_1 { background: url( http://img.combats.ru/i/sprites/kn4/Left/Front/4_1.gif ) }
.Dungeon .RightFront3_1 { background: url( http://img.combats.ru/i/sprites/kn4/Right/Front/4_1.gif ) }
.Dungeon .LeftFront3_0 { background: url( http://img.combats.ru/i/sprites/kn4/Left/Front/4_0.gif ) }
.Dungeon .LeftSide3_1 { background: url( http://img.combats.ru/i/sprites/kn4/Left/3_1.gif ) }
.Dungeon .RightSide3_1 { background: url( http://img.combats.ru/i/sprites/kn4/Right/3_1.gif ) }
.Dungeon .LeftSide3_0 { background: url( http://img.combats.ru/i/sprites/kn4/Left/3_0.gif ) }
.Dungeon .RightSide3_0 { background: url( http://img.combats.ru/i/sprites/kn4/Right/3_0.gif ) }
.Dungeon .LeftFront2_1 { background: url( http://img.combats.ru/i/sprites/kn4/Left/Front/3_1.gif ) }
.Dungeon .RightFront2_1 { background: url( http://img.combats.ru/i/sprites/kn4/Right/Front/3_1.gif ) }
.Dungeon .LeftFront2_0 { background: url( http://img.combats.ru/i/sprites/kn4/Left/Front/3_0.gif ) }
.Dungeon .LeftSide2_0 { background: url( http://img.combats.ru/i/sprites/kn4/Left/2_0.gif ) }
.Dungeon .RightSide2_0 { background: url( http://img.combats.ru/i/sprites/kn4/Right/2_0.gif ) }
.Dungeon .LeftFront1_1 { background: url( http://img.combats.ru/i/sprites/kn4/Left/Front/2_1.gif ) }
.Dungeon .RightFront1_1 { background: url( http://img.combats.ru/i/sprites/kn4/Right/Front/2_1.gif ) }
.Dungeon .LeftFront1_0 { background: url( http://img.combats.ru/i/sprites/kn4/Left/Front/2_0.gif ) }
.Dungeon .LeftSide1_0 { background: url( http://img.combats.ru/i/sprites/kn4/Left/1_0.gif ) }
.Dungeon .RightSide1_0 { background: url( http://img.combats.ru/i/sprites/kn4/Right/1_0.gif ) }
.Dungeon .LeftFront0_1 { background: url( http://img.combats.ru/i/sprites/kn4/Left/Front/1_1.gif ) }
.Dungeon .RightFront0_1 { background: url( http://img.combats.ru/i/sprites/kn4/Right/Front/1_1.gif ) }
.Dungeon .LeftFront0_0 { background: url( http://img.combats.ru/i/sprites/kn4/Left/Front/1_0.gif ) }
.Dungeon .LeftSide0_0 { background: url( http://img.combats.ru/i/sprites/kn4/Left/0_0.gif ) }
.Dungeon .RightSide0_0 { background: url( http://img.combats.ru/i/sprites/kn4/Right/0_0.gif ) }

View File

@ -1,62 +0,0 @@
DIV.Dungeon{
width: 372px;
height: 260px;
padding: 10px;
position: relative;
overflow: hidden;
background: black;
}
.Dungeon BUTTON {
border: 0 solid;
background: transparent;
padding: 0;
margin: 0;
position: absolute;
filter: Chroma( Color=#c1cacf );
}
.Dungeon DIV {
width: 352px;
height: 240px;
overflow: hidden;
position: relative;
}
.Dungeon IMG {
width: 352px;
height: 240px;
position: relative;
}
DIV.Life{position:absolute;background:#008000;height:2px;}
DIV.Life2{position:absolute;background:#00FF00;height:2px;}
.Dungeon .Floor0{ background: url( http://img.combats.ru/i/sprites/sn/bg0.gif ) black }
.Dungeon .Floor1{ background: url( http://img.combats.ru/i/sprites/sn/bg1.gif ) black }
.Dungeon .LeftSide4_1 { background: url( http://img.combats.ru/i/sprites/sn/Left/4_1.gif ) }
.Dungeon .RightSide4_1 { background: url( http://img.combats.ru/i/sprites/sn/Right/4_1.gif ) }
.Dungeon .LeftSide4_0 { background: url( http://img.combats.ru/i/sprites/sn/Left/4_0.gif ) }
.Dungeon .RightSide4_0 { background: url( http://img.combats.ru/i/sprites/sn/Right/4_0.gif ) }
.Dungeon .LeftFront3_2 { background: url( http://img.combats.ru/i/sprites/sn/Left/Front/4_2.gif ) }
.Dungeon .RightFront3_2 { background: url( http://img.combats.ru/i/sprites/sn/Right/Front/4_2.gif ) }
.Dungeon .LeftFront3_1 { background: url( http://img.combats.ru/i/sprites/sn/Left/Front/4_1.gif ) }
.Dungeon .RightFront3_1 { background: url( http://img.combats.ru/i/sprites/sn/Right/Front/4_1.gif ) }
.Dungeon .LeftFront3_0 { background: url( http://img.combats.ru/i/sprites/sn/Left/Front/4_0.gif ) }
.Dungeon .LeftSide3_1 { background: url( http://img.combats.ru/i/sprites/sn/Left/3_1.gif ) }
.Dungeon .RightSide3_1 { background: url( http://img.combats.ru/i/sprites/sn/Right/3_1.gif ) }
.Dungeon .LeftSide3_0 { background: url( http://img.combats.ru/i/sprites/sn/Left/3_0.gif ) }
.Dungeon .RightSide3_0 { background: url( http://img.combats.ru/i/sprites/sn/Right/3_0.gif ) }
.Dungeon .LeftFront2_1 { background: url( http://img.combats.ru/i/sprites/sn/Left/Front/3_1.gif ) }
.Dungeon .RightFront2_1 { background: url( http://img.combats.ru/i/sprites/sn/Right/Front/3_1.gif ) }
.Dungeon .LeftFront2_0 { background: url( http://img.combats.ru/i/sprites/sn/Left/Front/3_0.gif ) }
.Dungeon .LeftSide2_0 { background: url( http://img.combats.ru/i/sprites/sn/Left/2_0.gif ) }
.Dungeon .RightSide2_0 { background: url( http://img.combats.ru/i/sprites/sn/Right/2_0.gif ) }
.Dungeon .LeftFront1_1 { background: url( http://img.combats.ru/i/sprites/sn/Left/Front/2_1.gif ) }
.Dungeon .RightFront1_1 { background: url( http://img.combats.ru/i/sprites/sn/Right/Front/2_1.gif ) }
.Dungeon .LeftFront1_0 { background: url( http://img.combats.ru/i/sprites/sn/Left/Front/2_0.gif ) }
.Dungeon .LeftSide1_0 { background: url( http://img.combats.ru/i/sprites/sn/Left/1_0.gif ) }
.Dungeon .RightSide1_0 { background: url( http://img.combats.ru/i/sprites/sn/Right/1_0.gif ) }
.Dungeon .LeftFront0_1 { background: url( http://img.combats.ru/i/sprites/sn/Left/Front/1_1.gif ) }
.Dungeon .RightFront0_1 { background: url( http://img.combats.ru/i/sprites/sn/Right/Front/1_1.gif ) }
.Dungeon .LeftFront0_0 { background: url( http://img.combats.ru/i/sprites/sn/Left/Front/1_0.gif ) }
.Dungeon .LeftSide0_0 { background: url( http://img.combats.ru/i/sprites/sn/Left/0_0.gif ) }
.Dungeon .RightSide0_0 { background: url( http://img.combats.ru/i/sprites/sn/Right/0_0.gif ) }

View File

@ -1,62 +0,0 @@
DIV.Dungeon{
width: 372px;
height: 260px;
padding: 10px;
position: relative;
overflow: hidden;
background: black;
}
.Dungeon BUTTON {
border: 0 solid;
background: transparent;
padding: 0;
margin: 0;
position: absolute;
filter: Chroma( Color=#c1cacf );
}
.Dungeon DIV {
width: 352px;
height: 240px;
overflow: hidden;
position: relative;
}
.Dungeon IMG {
width: 352px;
height: 240px;
position: relative;
}
DIV.Life{position:absolute;background:#008000;height:2px;}
DIV.Life2{position:absolute;background:#00FF00;height:2px;}
.Dungeon .Floor0{ background: url( http://img.combats.ru/i/sprites/sun/bg0.gif ) black }
.Dungeon .Floor1{ background: url( http://img.combats.ru/i/sprites/sun/bg1.gif ) black }
.Dungeon .LeftSide4_1 { background: url( http://img.combats.ru/i/sprites/sun/Left/4_1.gif ) }
.Dungeon .RightSide4_1 { background: url( http://img.combats.ru/i/sprites/sun/Right/4_1.gif ) }
.Dungeon .LeftSide4_0 { background: url( http://img.combats.ru/i/sprites/sun/Left/4_0.gif ) }
.Dungeon .RightSide4_0 { background: url( http://img.combats.ru/i/sprites/sun/Right/4_0.gif ) }
.Dungeon .LeftFront3_2 { background: url( http://img.combats.ru/i/sprites/sun/Left/Front/4_2.gif ) }
.Dungeon .RightFront3_2 { background: url( http://img.combats.ru/i/sprites/sun/Right/Front/4_2.gif ) }
.Dungeon .LeftFront3_1 { background: url( http://img.combats.ru/i/sprites/sun/Left/Front/4_1.gif ) }
.Dungeon .RightFront3_1 { background: url( http://img.combats.ru/i/sprites/sun/Right/Front/4_1.gif ) }
.Dungeon .LeftFront3_0 { background: url( http://img.combats.ru/i/sprites/sun/Left/Front/4_0.gif ) }
.Dungeon .LeftSide3_1 { background: url( http://img.combats.ru/i/sprites/sun/Left/3_1.gif ) }
.Dungeon .RightSide3_1 { background: url( http://img.combats.ru/i/sprites/sun/Right/3_1.gif ) }
.Dungeon .LeftSide3_0 { background: url( http://img.combats.ru/i/sprites/sun/Left/3_0.gif ) }
.Dungeon .RightSide3_0 { background: url( http://img.combats.ru/i/sprites/sun/Right/3_0.gif ) }
.Dungeon .LeftFront2_1 { background: url( http://img.combats.ru/i/sprites/sun/Left/Front/3_1.gif ) }
.Dungeon .RightFront2_1 { background: url( http://img.combats.ru/i/sprites/sun/Right/Front/3_1.gif ) }
.Dungeon .LeftFront2_0 { background: url( http://img.combats.ru/i/sprites/sun/Left/Front/3_0.gif ) }
.Dungeon .LeftSide2_0 { background: url( http://img.combats.ru/i/sprites/sun/Left/2_0.gif ) }
.Dungeon .RightSide2_0 { background: url( http://img.combats.ru/i/sprites/sun/Right/2_0.gif ) }
.Dungeon .LeftFront1_1 { background: url( http://img.combats.ru/i/sprites/sun/Left/Front/2_1.gif ) }
.Dungeon .RightFront1_1 { background: url( http://img.combats.ru/i/sprites/sun/Right/Front/2_1.gif ) }
.Dungeon .LeftFront1_0 { background: url( http://img.combats.ru/i/sprites/sun/Left/Front/2_0.gif ) }
.Dungeon .LeftSide1_0 { background: url( http://img.combats.ru/i/sprites/sun/Left/1_0.gif ) }
.Dungeon .RightSide1_0 { background: url( http://img.combats.ru/i/sprites/sun/Right/1_0.gif ) }
.Dungeon .LeftFront0_1 { background: url( http://img.combats.ru/i/sprites/sun/Left/Front/1_1.gif ) }
.Dungeon .RightFront0_1 { background: url( http://img.combats.ru/i/sprites/sun/Right/Front/1_1.gif ) }
.Dungeon .LeftFront0_0 { background: url( http://img.combats.ru/i/sprites/sun/Left/Front/1_0.gif ) }
.Dungeon .LeftSide0_0 { background: url( http://img.combats.ru/i/sprites/sun/Left/0_0.gif ) }
.Dungeon .RightSide0_0 { background: url( http://img.combats.ru/i/sprites/sun/Right/0_0.gif ) }

View File

@ -1,57 +0,0 @@
DIV.Dungeon{
width: 372px;
height: 260px;
padding: 10px;
position: relative;
overflow: hidden;
background: black;
}
.Dungeon BUTTON {
border: 0 solid;
background: transparent;
padding: 0;
margin: 0;
position: absolute;
filter: Alpha(opacity=100),Chroma( Color=#c1cacf );
}
.Dungeon DIV {
width: 352px;
height: 240px;
overflow: hidden;
position: relative;
}
DIV.Life{position:absolute;background:#008000;height:2px;}
DIV.Life2{position:absolute;background:#00FF00;height:2px;}
.Dungeon .Floor0{ background: url( http://img.combats.ru/i/sprites/ug/bg0.gif ) black }
.Dungeon .Floor1{ background: url( http://img.combats.ru/i/sprites/ug/bg1.gif ) black }
.Dungeon .LeftSide4_1 { background: url( http://img.combats.ru/i/sprites/ug/Left/4_1.gif ) }
.Dungeon .RightSide4_1 { background: url( http://img.combats.ru/i/sprites/ug/Right/4_1.gif ) }
.Dungeon .LeftSide4_0 { background: url( http://img.combats.ru/i/sprites/ug/Left/4_0.gif ) }
.Dungeon .RightSide4_0 { background: url( http://img.combats.ru/i/sprites/ug/Right/4_0.gif ) }
.Dungeon .LeftFront3_2 { background: url( http://img.combats.ru/i/sprites/ug/Left/Front/4_2.gif ) }
.Dungeon .RightFront3_2 { background: url( http://img.combats.ru/i/sprites/ug/Right/Front/4_2.gif ) }
.Dungeon .LeftFront3_1 { background: url( http://img.combats.ru/i/sprites/ug/Left/Front/4_1.gif ) }
.Dungeon .RightFront3_1 { background: url( http://img.combats.ru/i/sprites/ug/Right/Front/4_1.gif ) }
.Dungeon .LeftFront3_0 { background: url( http://img.combats.ru/i/sprites/ug/Left/Front/4_0.gif ) }
.Dungeon .LeftSide3_1 { background: url( http://img.combats.ru/i/sprites/ug/Left/3_1.gif ) }
.Dungeon .RightSide3_1 { background: url( http://img.combats.ru/i/sprites/ug/Right/3_1.gif ) }
.Dungeon .LeftSide3_0 { background: url( http://img.combats.ru/i/sprites/ug/Left/3_0.gif ) }
.Dungeon .RightSide3_0 { background: url( http://img.combats.ru/i/sprites/ug/Right/3_0.gif ) }
.Dungeon .LeftFront2_1 { background: url( http://img.combats.ru/i/sprites/ug/Left/Front/3_1.gif ) }
.Dungeon .RightFront2_1 { background: url( http://img.combats.ru/i/sprites/ug/Right/Front/3_1.gif ) }
.Dungeon .LeftFront2_0 { background: url( http://img.combats.ru/i/sprites/ug/Left/Front/3_0.gif ) }
.Dungeon .LeftSide2_0 { background: url( http://img.combats.ru/i/sprites/ug/Left/2_0.gif ) }
.Dungeon .RightSide2_0 { background: url( http://img.combats.ru/i/sprites/ug/Right/2_0.gif ) }
.Dungeon .LeftFront1_1 { background: url( http://img.combats.ru/i/sprites/ug/Left/Front/2_1.gif ) }
.Dungeon .RightFront1_1 { background: url( http://img.combats.ru/i/sprites/ug/Right/Front/2_1.gif ) }
.Dungeon .LeftFront1_0 { background: url( http://img.combats.ru/i/sprites/ug/Left/Front/2_0.gif ) }
.Dungeon .LeftSide1_0 { background: url( http://img.combats.ru/i/sprites/ug/Left/1_0.gif ) }
.Dungeon .RightSide1_0 { background: url( http://img.combats.ru/i/sprites/ug/Right/1_0.gif ) }
.Dungeon .LeftFront0_1 { background: url( http://img.combats.ru/i/sprites/ug/Left/Front/1_1.gif ) }
.Dungeon .RightFront0_1 { background: url( http://img.combats.ru/i/sprites/ug/Right/Front/1_1.gif ) }
.Dungeon .LeftFront0_0 { background: url( http://img.combats.ru/i/sprites/ug/Left/Front/1_0.gif ) }
.Dungeon .LeftSide0_0 { background: url( http://img.combats.ru/i/sprites/ug/Left/0_0.gif ) }
.Dungeon .RightSide0_0 { background: url( http://img.combats.ru/i/sprites/ug/Right/0_0.gif ) }

View File

@ -1,590 +0,0 @@
body, td, ol, ul, li, p {
font-size: 10pt;
font-family: Verdana, Arial, Helvetica, Tahoma, serif;
}
.seehp {
color: #F4F4F4;
line-height: 7px;
font-size: 9px;
font-weight: bold;
padding-top: 1px;
margin-left: 3px;
padding-left: 3px;
}
.senohp {
line-height: 7px;
font-size: 9px;
}
.hp_none {
background: url('../i/hp.jpg') 0 0 repeat-x;
}
.hp_1 {
background: url('../i/hp.jpg') 0 -11px repeat-x;
}
.hp_2 {
background: url('../i/hp.jpg') 0 -21px repeat-x;
}
.hp_3 {
background: url('../i/hp.jpg') 0 -31px repeat-x;
}
.hp_mp {
background: url('../i/hp.jpg') 0 -41px repeat-x;
}
.seemp {
color: #00FFFF;
line-height: 7px;
font-size: 9px;
font-weight: bold;
padding-top: 1px;
margin-left: 3px;
padding-left: 3px;
}
.hpborder {
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #DADADA;
}
.text {
font-size: 10pt;
color: #000000;
font-family: Verdana, Arial, Helvetica, Tahoma, serif;
}
H3 {
COLOR: #8f0000;
FONT-FAMILY: Arial, serif;
FONT-SIZE: 12pt;
FONT-WEIGHT: bold;
TEXT-ALIGN: center;
}
H4 {
COLOR: #8f0000;
FONT-FAMILY: Arial, serif;
FONT-SIZE: 11pt;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 5px;
}
H5 {
COLOR: #4f0000;
FONT-FAMILY: Arial, serif;
FONT-SIZE: 11pt;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 0;
MARGIN-TOP: 0;
}
a, a:visited {
text-decoration: none;
FONT-WEIGHT: bold;
color: #003388;
}
a:active {
color: #6F0000
}
a:hover {
color: #0066FF
}
.date {
font-family: Courier, serif;
font-size: 8pt;
text-decoration: none;
font-weight: normal;
color: #007000
}
.date1 {
font-family: Courier, serif;
font-size: 8pt;
text-decoration: none;
font-weight: normal;
color: #b00000;
}
.date2 {
font-family: Courier, serif;
font-size: 8pt;
text-decoration: none;
font-weight: normal;
color: #007000;
background-color: #00FFAA
}
.date22 {
font-family: Courier, serif;
font-size: 8pt;
text-decoration: none;
font-weight: normal;
color: #007000;
background-color: #00FFAA
}
.date3 {
font-family: Courier, serif;
font-size: 8pt;
text-decoration: underline;
font-weight: normal;
color: #007000;
background-color: #00FFAA
}
.priem_hint {
position: absolute;
background-color: #ffffcc;
padding: 2px;
padding-left: 4px;
padding-right: 4px;
border: 1px #666666 solid;
z-index: 1000;
}
.greaytext {
color: grey;
cursor: default;
font-weight: bold;
font-size: 10px;
text-decoration: none;
}
.sysdate {
font-family: Courier, serif;
font-size: 8pt;
text-decoration: none;
font-weight: normal;
color: #B00000
}
.private {
font-weight: bold;
color: red;
background-color: #FAE0E0
}
.klan {
font-weight: bold;
color: green;
background-color: #99FFCC;
}
.number {
font-size: 11pt;
font-weight: bold;
color: #6F0000
}
.dsc {
color: #606060;
font-weight: normal;
}
select, textarea, input {
border: solid 1pt #B0B0B0;
font-family: MS Sans Serif, serif;
font-size: 10px;
color: #191970;
MARGIN-BOTTOM: 2px;
MARGIN-TOP: 1px;
}
.ahint {
font-family: MS Sans Serif, serif;
font-size: 8px;
text-decoration: none;
color: #666666;
z-index: 99;
}
#hint2 {
position: absolute;
width: 140;
background-color: #FFF6DD;
visibility: hidden
}
#hint3 {
position: absolute;
width: 240;
background-color: #FFF6DD;
visibility: hidden
}
.hint {
position: absolute;
background-color: #ffffcc;
padding: 5px;
}
.hpborder {
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #DADADA;
}
#hint4 {
position: absolute;
width: 240;
visibility: hidden
}
.B1 {
font-weight: bold;
color: #6666CC
}
.B2 {
font-weight: bold;
color: #B06A00
}
.B3 {
font-weight: bold;
color: #269088
}
.B4 {
font-weight: bold;
color: #A0AF20
}
.B5 {
font-weight: bold;
color: #0F79D3
}
.B6 {
font-weight: bold;
color: #D85E23
}
.B7 {
font-weight: bold;
color: #5C832F
}
.B8 {
font-weight: bold;
color: #842B61
}
.B9 {
font-weight: bold;
color: navy
}
.Bs1 {
font-size: 8pt;
font-weight: bold;
color: #6666CC
}
.Bs2 {
font-weight: bold;
color: #B06A00
}
img, table {
border: 0
}
.ismagic {
background-color: #E0E0E2;
BACKGROUND-IMAGE: url(blinkmagic1.gif)
}
.glow_pink {
background-color: #E0E0E2;
BACKGROUND-IMAGE: url(blinkmagic_pink.gif)
}
.glow_red {
background-color: #E0E0E2;
BACKGROUND-IMAGE: url(blinkmagic_red.gif)
}
.glow_green {
background-color: #E0E0E2;
BACKGROUND-IMAGE: url(blinkmagic_green.gif)
}
.glow_yellow {
background-color: #E0E0E2;
BACKGROUND-IMAGE: url(blinkmagic_yellow.gif)
}
.glow_dark {
background-color: #E0E0E2;
BACKGROUND-IMAGE: url(blinkmagic_dark.gif)
}
.glow_blue {
background-color: #E0E0E2;
BACKGROUND-IMAGE: url(blinkmagic_blue.gif)
}
.hpStyle1 {
color: #F4F4F4;
line-height: 7px;
font-size: 9px;
font-weight: bold;
padding-top: 1px;
margin-left: 3px;
}
.mpStyle1 {
color: #00FFFF;
line-height: 7px;
font-size: 9px;
font-weight: bold;
padding-top: 1px;
margin-left: 3px;
}
.ahint {
FONT-SIZE: 8px;
COLOR: #000080;
FONT-FAMILY: MS Sans Serif, serif;
TEXT-DECORATION: none
}
#hint2 {
VISIBILITY: hidden;
WIDTH: 140px;
POSITION: absolute;
BACKGROUND-COLOR: #fff6dd;
}
#hint3 {
VISIBILITY: hidden;
WIDTH: 240px;
POSITION: absolute;
BACKGROUND-COLOR: #fff6dd;
}
.genwnew {
background-color: #EBEBEB;
border: 1px solid #C1C1C1;
}
.priem_style {
margin: 0;
width: 40px;
height: 25px;
}
.priem_styleHover {
margin: 1px;
width: 38px;
height: 23px;
}
.priem_style2 {
cursor: pointer;
margin: 0;
width: 40px;
height: 25px;
}
.priem_styleHover2 {
cursor: pointer;
margin: 1px;
width: 38px;
height: 23px;
}
.menutop, a.menutop:visited, a.menutop:active {
font-weight: bold;
font-size: 10px;
text-decoration: none;
color: #3B3936;
}
.btn {
cursor: pointer;
border: 1px double #9a9996;
font-size: 12px;
color: #dfdfdf;
background-color: #504F4C;
}
.btn:hover {
color: #CECECE;
background-color: #393937;
}
.yesbtn {
border: 1px solid #b0b0b0;
background-color: #ece9d8;
width: 70px;
padding-bottom: 2px;
padding-top: 2px;
color: #333333;
text-decoration: none;
font-size: 13px;
}
img {
border: 0;
}
.iframeMain {
width: inherit;
height: inherit;
}
.windowsmf_css1 {
position: absolute;
background-color: #ddd5bf;
-moz-user-select: none;
-khtml-user-select: none;
user-select: none;
border: solid #D8D8D8 1px;
FONT-SIZE: 10pt;
font-family: Verdana, Arial, Helvetica, Tahoma, serif;
}
.windowsmf_css1_active2 {
position: absolute;
background-color: #F9F9F9;
-moz-user-select: none;
-khtml-user-select: none;
user-select: none;
border: solid #FDFDFD 1px;
}
.inpt1 {
font-size: 8pt;
border: 1px solid #CDC698;
}
.windowsmf_css1_title {
background-color: #b1a993;
color: #000000;
padding-top: 2px;
padding-left: 3px;
padding-right: 3px;
padding-bottom: 2px;
FONT-SIZE: 10pt;
font-family: Verdana, Arial, Helvetica, Tahoma, serif;
}
.usermenu {
z-index: 900;
position: absolute;
LEFT: 0;
TOP: 0;
background-color: #E5E5E5;
border: 1px ridge #CCCCCC;
}
.usermenu1 {
background-color: #E5E5E5;
cursor: pointer;
padding-left: 3px;
padding-right: 3px;
padding-top: 1px;
padding-bottom: 1px;
}
.usermenu1:hover {
background-color: #CECECE;
}
.windowsmf_css1_title_active {
background-color: #C9C4B4;
color: #1A1A1A;
padding-top: 2px;
padding-left: 3px;
padding-right: 3px;
padding-bottom: 2px;
cursor: move;
}
.windowsmf_css1_title_active2 {
background-color: #D7D3C8;
color: #333333;
padding-top: 2px;
padding-left: 3px;
padding-right: 3px;
padding-bottom: 2px;
}
.windowsmf_css1_main_active2 {
background-color: #FDFDFD;
color: #FDFDFD;
padding: 10px;
}
.windowsmf_css1_main {
padding: 10px;
}
.btn_grey {
border-top-width: 1px;
background-color: #e5e5e5;
background-image: url(line1.jpg);
border-top-style: solid;
border-top-color: #EFEFEF;
padding-top: 2px;
padding-bottom: 2px;
padding-left: 7px;
padding-right: 7px;
border-right-width: 1px;
border-left-width: 1px;
border-right-style: solid;
border-left-style: solid;
border-right-color: #D8D8D8;
border-left-color: #D8D8D8;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #D8D8D8;
color: #494949;
-moz-user-select: none;
-khtml-user-select: none;
user-select: none;
text-decoration: none;
}
.btn_grey:hover {
background-image: url(line2.jpg);
color: #333333;
}
.btn_grey:active {
background-color: #e5e5e5;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #EFEFEF;
border-right-width: 1px;
border-left-width: 1px;
border-right-style: solid;
border-left-style: solid;
border-right-color: #D8D8D8;
border-left-color: #D8D8D8;
border-top-width: 1px;
border-top-style: solid;
border-top-color: #D8D8D8;
}
.mainframe {
width: inherit;
height: inherit;
}
.message {
font-size: 10pt;
font-family: Verdana, Arial, Helvetica, Tahoma, serif;
}

View File

@ -1,6 +0,0 @@
BODY { FONT-SIZE: 10pt; FONT-FAMILY: Verdana, Arial, Helvetica, Tahoma, sans-serif}TD { FONT-SIZE: 10pt; FONT-FAMILY: Verdana, Arial, Helvetica, Tahoma, sans-serif}OL { FONT-SIZE: 10pt; FONT-FAMILY: Verdana, Arial, Helvetica, Tahoma, sans-serif}UL { FONT-SIZE: 10pt; FONT-FAMILY: Verdana, Arial, Helvetica, Tahoma, sans-serif}LI { FONT-SIZE: 10pt; FONT-FAMILY: Verdana, Arial, Helvetica, Tahoma, sans-serif}P { FONT-SIZE: 10pt; FONT-FAMILY: Verdana, Arial, Helvetica, Tahoma, sans-serif}.inup { BORDER-RIGHT: #302F2A 1px double; BORDER-TOP: #302F2A 1px double; FONT-SIZE: 8pt; BORDER-LEFT: #302F2A 1px double; COLOR: #000000; BORDER-BOTTOM: #302F2A 1px double; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #DED7BD}.text { FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica, Tahoma, sans-serif}H3 { FONT-WEIGHT: bold; FONT-SIZE: 12pt; COLOR: #8f0000; FONT-FAMILY: Arial; TEXT-ALIGN: center}H4 { FONT-WEIGHT: bold; FONT-SIZE: 11pt; MARGIN-BOTTOM: 5px; COLOR: #8f0000; FONT-FAMILY: Arial}A:link { FONT-WEIGHT: normal; COLOR: #524936; TEXT-DECORATION: none}A:visited { FONT-WEIGHT: normal; COLOR: #633525; TEXT-DECORATION: none}A:active { FONT-WEIGHT: normal; COLOR: #77684d; TEXT-DECORATION: none}A:hover { COLOR: #68727B; TEXT-DECORATION: underline}.date { FONT-WEIGHT: normal; FONT-SIZE: 8pt; COLOR: #007000; FONT-FAMILY: Courier; TEXT-DECORATION: none}.dsc { FONT-WEIGHT: normal; COLOR: #606060}SELECT { BORDER-RIGHT: #b0b0b0 1pt solid; BORDER-TOP: #b0b0b0 1pt solid; MARGIN-TOP: 1px; FONT-SIZE: 10px; MARGIN-BOTTOM: 2px; BORDER-LEFT: #b0b0b0 1pt solid; COLOR: #191970; BORDER-BOTTOM: #b0b0b0 1pt solid; FONT-FAMILY: MS Sans Serif}TEXTAREA { BORDER-RIGHT: #b0b0b0 1pt solid; BORDER-TOP: #b0b0b0 1pt solid; MARGIN-TOP: 1px; FONT-SIZE: 10px; MARGIN-BOTTOM: 2px; BORDER-LEFT: #b0b0b0 1pt solid; COLOR: #191970; BORDER-BOTTOM: #b0b0b0 1pt solid; FONT-FAMILY: MS Sans Serif}INPUT { BORDER-RIGHT: #b0b0b0 1pt solid; BORDER-TOP: #b0b0b0 1pt solid; MARGIN-TOP: 1px; FONT-SIZE: 10px; MARGIN-BOTTOM: 2px; BORDER-LEFT: #b0b0b0 1pt solid; COLOR: #191970; BORDER-BOTTOM: #b0b0b0 1pt solid; FONT-FAMILY: MS Sans Serif}.pagetknum { PADDING-RIGHT: 3px; PADDING-LEFT: 3px; FONT-WEIGHT: bold; PADDING-BOTTOM: 0; MARGIN: 0; WIDTH: 1em; COLOR: #6f0000; PADDING-TOP: 0; TEXT-DECORATION: underline} .pagenum A:link { PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 0; MARGIN: 0; WIDTH: 1em; PADDING-TOP: 0
} .pagenum A:visited { PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 0; MARGIN: 0; WIDTH: 1em; PADDING-TOP: 0
} .pagenum A:active { PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 0; MARGIN: 0; WIDTH: 1em; PADDING-TOP: 0
} .pagenum A:hover { PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 0; MARGIN: 0; WIDTH: 1em; PADDING-TOP: 0; BACKGROUND-COLOR: white} .phpeft { PADDING-RIGHT: 0; PADDING-LEFT: 20px; PADDING-BOTTOM: 7px; MARGIN: 0; PADDING-TOP: 3px} .pages { BACKGROUND-COLOR: #ffefbf} IMG { BORDER-RIGHT: 0; BORDER-TOP: 0; BORDER-LEFT: 0; BORDER-BOTTOM: 0
} TABLE { BORDER-RIGHT: 0; BORDER-TOP: 0; BORDER-LEFT: 0; BORDER-BOTTOM: 0
} .btn { BORDER-RIGHT: #817a63 1px double; BORDER-TOP: #817a63 1px double; FONT-SIZE: 7.5pt; BORDER-LEFT: #817a63 1px double; COLOR: #dfddd3; BORDER-BOTTOM: #817a63 1px double; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #2b2b18}

File diff suppressed because one or more lines are too long

View File

@ -1,15 +0,0 @@
#tiptip_holder { display: none; position: absolute; top: 0; left: 0; z-index: 99999; }
#tiptip_holder.tip_top { padding-bottom: 5px; }
#tiptip_holder.tip_bottom { padding-top: 5px; }
#tiptip_holder.tip_left { padding-right: 5px;}
#tiptip_content { font-size: 11px; color: #000; text-shadow: 0 0 2px #fff; padding: 4px 8px; border: 1px solid rgba(255,255,255,0.25); background: #fff; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; box-shadow: 0 0 3px #555; -webkit-box-shadow: 0 0 3px #555; -moz-box-shadow: 0 0 3px #555; }
#tiptip_arrow, #tiptip_arrow_inner { position: absolute; border-color: transparent; border-style: solid; border-width: 6px; height: 0; width: 0; }
#tiptip_holder.tip_top #tiptip_arrow { border-top-color: #fff; border-top-color: rgba(255,255,255,0.35); }
#tiptip_holder.tip_bottom #tiptip_arrow { border-bottom-color: #fff; border-bottom-color: rgba(255,255,255,0.35); }
#tiptip_holder.tip_right #tiptip_arrow { border-right-color: #fff; border-right-color: rgba(255,255,255,0.35); }
#tiptip_holder.tip_left #tiptip_arrow { border-left-color: #fff; border-left-color: rgba(255,255,255,0.35); }
#tiptip_holder.tip_top #tiptip_arrow_inner { margin-top: -7px; margin-left: -6px; border-top-color: rgb(25,25,25); border-top-color: rgba(25,25,25,0.92); }
#tiptip_holder.tip_bottom #tiptip_arrow_inner { margin-top: -5px; margin-left: -6px; border-bottom-color: rgb(25,25,25); border-bottom-color: rgba(25,25,25,0.92); }
#tiptip_holder.tip_right #tiptip_arrow_inner { margin-top: -6px; margin-left: -5px; border-right-color: rgb(25,25,25); border-right-color: rgba(25,25,25,0.92); }
#tiptip_holder.tip_left #tiptip_arrow_inner { margin-top: -6px; margin-left: -7px; border-left-color: rgb(25,25,25); border-left-color: rgba(25,25,25,0.92); }
.txt { font-style: italic; }

View File

@ -51,19 +51,9 @@ if ($username && $password) {
} else {
$error = ERROR_EMPTY_CREDENTIALS;
}
?>
<!doctype html>
<html lang="ru-RU">
<head>
<meta charset=UTF-8">
<link href="css/main.css" rel="stylesheet">
<title>Входим...</title>
</head>
<body>
<?php if (!empty($error)): ?>
<a href="/"> на главную</a>
<h1><?= $error ?></h1>
<?php endif; ?>
</body>
</html>
Template::header('Входим...');
if ($error) {
echo sprintf('<a href="/"> ← на главную</a><h1>%s</h1>', $error);
}

View File

@ -1,7 +1,7 @@
<?php
session_start();
if (!isset($_SESSION['uid'])) {
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
@ -70,39 +70,23 @@ if ($_GET['ext'] == 1) {
}
if (in_array($user['room'], Config::$canalenters)) {
$podzemroom = $user['room'] + 1;
if (in_array($user->room, Config::$canalenters)) {
$podzemroom = $user->room + 1;
$cavedata = [620 => ['x1' => 3, 'y1' => 2, 'dir1' => 2]];
$podzemdata = [621 => ['name1' => 'Проклятый Рудник', 'name2' => 'Проклятого Рудника']];
$warning = $_GET["warning"] ?? '';
Template::header('enter_cave');
if ($warning) {
echo sprintf('<b style="color: #f80000">%s</b>', $warning);
}
?>
<HTML>
<HEAD>
<script LANGUAGE='JavaScript'>
document.ondragstart = test;
//запрет на перетаскивание
document.onselectstart = test;
//запрет на выделение элементов страницы
document.oncontextmenu = test;
//запрет на выведение контекстного меню
function test() {
return false
}
</SCRIPT>
<link rel=stylesheet href="css/main.css">
<meta charset="UTF-8">
</HEAD>
<BODY style="background-color: #dedede;">
<? if ($_GET["warning"] && strlen($_GET["warning"]) > 1) {
echo "<b><font color=red>$_GET[warning]</font></b>";
} ?>
<div id=hint4 class=ahint></div>
<TABLE width=100%>
<TR>
<TD valign=top width=100%>
<center><h3><?= $rooms[$user["room"]] ?></h3></center>
<?
<?php
$select = mysql_query("SELECT `time` FROM `visit_podzem` WHERE `room` = '$podzemroom' AND `login` = '" . $user['login'] . "' AND `time` > 0 LIMIT 1");
if ($el = mysql_fetch_array($select)) {
$wait_sec = $el['time'];
@ -113,18 +97,16 @@ if (in_array($user['room'], Config::$canalenters)) {
if (($user['align'] == '2.99') && $wait_sec > $new_t) {
$wait_sec = 1;
mysql_query("UPDATE `visit_podzem` SET `time` = 1 WHERE `login` = '$user[login]' AND `time` > 0 AND `room` = '$user[room]' LIMIT 1");
mysql_query("UPDATE `visit_podzem` SET `time` = 1 WHERE `login` = '$user[login]' AND `time` > 0 AND `room` = '$user->room' LIMIT 1");
}
if ($wait_sec > $new_t) {
if ($_GET['donate']) {
if ($user['money'] >= $podzemdata[$podzemroom]['passprice']) {
mysql_query("UPDATE `users` SET `money` = (`money`-" . $podzemdata[$podzemroom]['passprice'] . ") WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("INSERT INTO `delo` (`id`, `author`, `pers`, `text`, `type`, `date`) VALUES ('', '0', '{$_SESSION['uid']}', '\"" . $user['login'] . "\" пожертвовал на благоустройство пещеры \"" . $podzemdata[$podzemroom]['passprice'] . "\" кр. ($user[money]/$user[ekr]). ', 7, '" . time() . "')");
$wait_sec = 0;
} else {
echo "<b><font color=red>У вас недостаточно денег</font></b>";
}
if ($wait_sec > $new_t && $_GET['donate']) {
if ($user['money'] >= $podzemdata[$podzemroom]['passprice']) {
mysql_query("UPDATE `users` SET `money` = (`money`-" . $podzemdata[$podzemroom]['passprice'] . ") WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("INSERT INTO `delo` (`id`, `author`, `pers`, `text`, `type`, `date`) VALUES ('', '0', '{$_SESSION['uid']}', '\"" . $user['login'] . "\" пожертвовал на благоустройство пещеры \"" . $podzemdata[$podzemroom]['passprice'] . "\" кр. ($user[money]/$user[ekr]). ', 7, '" . time() . "')");
$wait_sec = 0;
} else {
echo "<b><font color=red>У вас недостаточно денег</font></b>";
}
}
@ -225,7 +207,7 @@ if (in_array($user['room'], Config::$canalenters)) {
return $i;
}
$Q = mysql_query("SELECT * FROM `vxod` WHERE `room` = '$user[room]'");
$Q = mysql_query("SELECT * FROM `vxod` WHERE `room` = '$user->room'");
while ($DATA = mysql_fetch_array($Q)) {
$cr = $DATA['glav_id'];
$z_login[$i] = $DATA['login'];
@ -292,7 +274,7 @@ if (in_array($user['room'], Config::$canalenters)) {
<TD height=1 colspan=2><SPAN></SPAN></TD>
</TR>
</TABLE>
<?
<?php
///////////////Подача заявки////////////////////
if ($_GET['open']) {
@ -302,7 +284,7 @@ if (in_array($user['room'], Config::$canalenters)) {
exit();
}
$time = date("H:i");
$SQL2 = mysql_query("INSERT INTO `vxod` (`date`, `login`, `glav_id`, `comment`, `pass`, `room`) VALUES('$time', '$login', '$user_id', '" . mysql_real_escape_string($_GET['cmt']) . "', '" . mysql_real_escape_string($_GET['pass']) . "', '$user[room]')");
$SQL2 = mysql_query("INSERT INTO `vxod` (`date`, `login`, `glav_id`, `comment`, `pass`, `room`) VALUES('$time', '$login', '$user_id', '" . mysql_real_escape_string($_GET['cmt']) . "', '" . mysql_real_escape_string($_GET['pass']) . "', '$user->room')");
$SQL2 = mysql_query("INSERT INTO `vxodd` (`login`, `glav_id`, `lvl`) VALUES('$login', '$user_id', '$user_lvl')");
if ($SQL2) {
echo "<script>location.href='main.php?act=none'</script>";
@ -332,7 +314,7 @@ if (in_array($user['room'], Config::$canalenters)) {
}
$den = mysql_query("SELECT `id` FROM `vxodd` WHERE `glav_id` = '" . $_GET['naw_id'] . "'");
if (mysql_num_rows($den) >= (in_array($user['room'] + 1, Config::$caverooms) ? 5 : 4)) {
if (mysql_num_rows($den) >= (in_array($user->room + 1, Config::$caverooms) ? 5 : 4)) {
echo "<script>location.href='?warning=5'</script>";
exit();
}
@ -379,94 +361,94 @@ if (in_array($user['room'], Config::$canalenters)) {
}
}
if ($_GET['start']){
if (in_array($user['room'] + 1, Config::$caverooms)) {
$nc = 1;
$locs = [];
}
$zax = mysql_query("SELECT `login`, `fee` FROM `vxodd` WHERE `glav_id` = '" . $user['id'] . "'");
$level = 0;
while ($nana = mysql_fetch_array($zax)) {
$n_login = $nana['login'];
$rty = mysql_query("SELECT `id`, `level`, `login`, `shadow`, `money`, `hp` FROM `users` WHERE `login` = '$n_login' LIMIT 1");
$esth = mysql_fetch_array($rty);
if ($esth['hp'] <= 0) {
$esth['hp'] = 1;
mysql_query('UPDATE `users` SET `hp` = "' . $esth['hp'] . '" WHERE `id` = "' . $esth['id'] . '" LIMIT 1');
if ($_GET['start']) {
if (in_array($user->room + 1, Config::$caverooms)) {
$nc = 1;
$locs = [];
}
if ($nana['fee']) {
if ($nana['fee'] > $esth['money']) {
continue;
$zax = mysql_query("SELECT `login`, `fee` FROM `vxodd` WHERE `glav_id` = '" . $user['id'] . "'");
$level = 0;
while ($nana = mysql_fetch_array($zax)) {
$n_login = $nana['login'];
$rty = mysql_query("SELECT `id`, `level`, `login`, `shadow`, `money`, `hp` FROM `users` WHERE `login` = '$n_login' LIMIT 1");
$esth = mysql_fetch_array($rty);
if ($esth['hp'] <= 0) {
$esth['hp'] = 1;
mysql_query('UPDATE `users` SET `hp` = "' . $esth['hp'] . '" WHERE `id` = "' . $esth['id'] . '" LIMIT 1');
}
mysql_query("UPDATE `users` SET `money` = (`money+$nana[fee]) WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("update `users` SET `money` = (`money-$nana[fee]) WHERE `id` = '$esth[id]' LIMIT 1");
$user['money'] += $nana['fee'];
$esth['money'] -= $nana['fee'];
adddelo($user['id'], "Персонаж $user[login] получил $nana[fee] кр. за поход по локации \"" . $rooms[$user['room'] + 1] . "\" от персонажа $esth[login] ($user[money]).", 1);
adddelo($esth['id'], "Персонаж $esth[login] заплатил $nana[fee] кр. за поход по локации \"" . $rooms[$user['room'] + 1] . "\" персонажу $user[login] ($esth[money]).", 1);
if ($nana['fee']) {
if ($nana['fee'] > $esth['money']) {
continue;
}
mysql_query("UPDATE `users` SET `money` = (`money+$nana[fee]) WHERE `id` = '$user[id]' LIMIT 1");
mysql_query("update `users` SET `money` = (`money-$nana[fee]) WHERE `id` = '$esth[id]' LIMIT 1");
$user['money'] += $nana['fee'];
$esth['money'] -= $nana['fee'];
adddelo($user['id'], "Персонаж $user[login] получил $nana[fee] кр. за поход по локации \"" . $rooms[$user->room + 1] . "\" от персонажа $esth[login] ($user[money]).", 1);
adddelo($esth['id'], "Персонаж $esth[login] заплатил $nana[fee] кр. за поход по локации \"" . $rooms[$user->room + 1] . "\" персонажу $user[login] ($esth[money]).", 1);
}
if ($esth['level'] > $level) {
$level = $esth['level'];
}
$est_id = $esth['id'];
$est_login = $esth['login'];
$vremya = 60 * 60 * 6 + time();
mysql_query('INSERT INTO `visit_podzem` (`login`, `time`, `room`) VALUES ("' . $n_login . '", "' . $vremya . '", \'' . $podzemroom . '\')');
$vrem = 30 * 60 + time();
$cavedata = Config::$cavedata ?? [];
mysql_query("INSERT INTO `caveparties` SET `user` = '$esth[id]', `leader` = '$user[id]', `login` = '$esth[login]', `shadow` = '0.png', `x` = '" . $cavedata[$user->room + 1]['x1'] . "', `y` = '" . $cavedata[$user->room + 1]['y1'] . "', `dir` = '" . $cavedata[$user->room + 1]['dir1'] . "', `floor` = 1");
mysql_query("UPDATE `users`, `online` SET " . ($nc ? "`users`.`caveleader` = '$user[id]', " : "") . " `users`.`room` = '" . ($user->room + 1) . "', `online`.`room` = '" . ($user->room + 1) . "' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '" . $esth['id'] . "'");
}
if ($esth['level'] > $level) {
$level = $esth['level'];
}
$est_id = $esth['id'];
$est_login = $esth['login'];
$vremya = 60 * 60 * 6 + time();
mysql_query('INSERT INTO `visit_podzem` (`login`, `time`, `room`) VALUES ("' . $n_login . '", "' . $vremya . '", \'' . $podzemroom . '\')');
$vrem = 30 * 60 + time();
$cavedata = Config::$cavedata ?? [];
mysql_query("INSERT INTO `caveparties` SET `user` = '$esth[id]', `leader` = '$user[id]', `login` = '$esth[login]', `shadow` = '0.png', `x` = '" . $cavedata[$user['room'] + 1]['x1'] . "', `y` = '" . $cavedata[$user['room'] + 1]['y1'] . "', `dir` = '" . $cavedata[$user['room'] + 1]['dir1'] . "', `floor` = 1");
mysql_query("UPDATE `users`, `online` SET " . ($nc ? "`users`.`caveleader` = '$user[id]', " : "") . " `users`.`room` = '" . ($user['room'] + 1) . "', `online`.`room` = '" . ($user['room'] + 1) . "' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '" . $esth['id'] . "'");
}
if ($nc) {
$r = mysql_query("SELECT * FROM `cavemaps` WHERE `room` = '$user[room]'");
while ($rec = mysql_fetch_assoc($r)) {
$map = unserialize($rec['map']);
foreach ($map as $k => $v) {
foreach ($v as $k2 => $v2) {
$obj = substr($v2, 0, 1);
if ($obj == "b" || $obj == "a" || $obj == "w") {
$tmp = explode("/", $v2);
$i = 1;
if ($obj == "b") {
$t = 0;
} elseif ($obj == "w") {
$t = 1;
} else {
$t = 2;
if ($nc) {
$r = mysql_query("SELECT * FROM `cavemaps` WHERE `room` = '$user->room'");
while ($rec = mysql_fetch_assoc($r)) {
$map = unserialize($rec['map']);
foreach ($map as $k => $v) {
foreach ($v as $k2 => $v2) {
$obj = substr($v2, 0, 1);
if ($obj == "b" || $obj == "a" || $obj == "w") {
$tmp = explode("/", $v2);
$i = 1;
if ($obj == "b") {
$t = 0;
} elseif ($obj == "w") {
$t = 1;
} else {
$t = 2;
}
while ($tmp[$i]) {
mysql_query("INSERT INTO `cavebots` SET `leader` = '$user[id]', `x` = '$k2', `y` = '$k', `startx` = '$k2', `starty` = '$k', `bot` = '$tmp[$i]', `cnt` = '" . ($tmp[$i + 1]) . "', `floor` = '$rec[floor]', `type` = '$t'");
$i += 2;
}
$map[$k][$k2] = 2;
}
while ($tmp[$i]) {
mysql_query("INSERT INTO `cavebots` SET `leader` = '$user[id]', `x` = '$k2', `y` = '$k', `startx` = '$k2', `starty` = '$k', `bot` = '$tmp[$i]', `cnt` = '" . ($tmp[$i + 1]) . "', `floor` = '$rec[floor]', `type` = '$t'");
$i += 2;
}
$map[$k][$k2] = 2;
}
}
include('cave_add_objects.php');
mysql_query("INSERT INTO `caves` SET `leader` = '$user[id]', `map` = '" . serialize($map) . "', `level` = '$level', `floor` = '$rec[floor]'");
savecavedata([], $user['id'], $rec['floor']);
}
include('cave_add_objects.php');
mysql_query("INSERT INTO `caves` SET `leader` = '$user[id]', `map` = '" . serialize($map) . "', `level` = '$level', `floor` = '$rec[floor]'");
savecavedata([], $user['id'], $rec['floor']);
}
}
?>
?>
<script>top.frames['online'].location = 'ch.php?online=' + Math.round(Math.random() * 100000);</script>
<?
mysql_query("DELETE FROM `vxod` WHERE `login` = '$login'");
mysql_query("DELETE FROM `vxodd` WHERE `glav_id` = " . $user['id'] . "");
mysql_query("DELETE FROM `vxodd` WHERE `login` = '$login'");
print "<script>location.href='cave.php'</script>";
exit();
}
<?php
mysql_query("DELETE FROM `vxod` WHERE `login` = '$login'");
mysql_query("DELETE FROM `vxodd` WHERE `glav_id` = " . $user['id'] . "");
mysql_query("DELETE FROM `vxodd` WHERE `login` = '$login'");
print "<script>location.href='cave.php'</script>";
exit();
}
}
?>
<TD nowrap valign=top>
<BR>
<DIV align=right>
<INPUT style="font-size:12px;" onClick="document.location.href='enter_cave.php?<? echo time(); ?>'"
<INPUT style="font-size:12px;" onClick="document.location.href='enter_cave.php?<?= time(); ?>'"
value=Обновить type=button>
<input style="font-size: 12px;" type="button" value="Вернуться"
onclick="document.location.href='enter_cave.php?ext=1';"/>
@ -478,10 +460,7 @@ if (in_array($user['room'], Config::$canalenters)) {
</TABLE>
<div id="goto" style="text-align:right;white-space:nowrap">&nbsp;</div>
<br><br>
</BODY>
</HTML>
<?
<?php
} else {
header("location: main.php");
}
?>
}

View File

@ -1,7 +1,7 @@
<?php
ob_start("ob_gzhandler");
session_start();
if (!isset($_SESSION['uid'])) {
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
@ -21,122 +21,111 @@ if (isset($user['id'])) {
include('./classes/battle_new.class.php');
$fbattle = new fbattle($user['battle']);
Template::header('fbattle');
?>
<html>
<head>
<link rel="stylesheet" href="css/main.css">
<meta charset="utf-8">
<script type="text/javascript" src="js/ZeroClipboard.js"></script>
<script type="text/javascript" src="js/sl2.js"></script>
<script type="text/javascript" src="js/ch.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="js/tooltip.js"></script>
<link rel="stylesheet" type="text/css" href="css/tooltip.css"/>
<SCRIPT>
function refreshPeriodic() {
<?php if($fbattle->battle) { ?>location.href = '<?=$_SERVER['PHP_SELF']?>?batl=<?=$_REQUEST['batl']?>';//reload();
<?}?>
const timerID = setTimeout("refreshPeriodic()", 20000);
<script type="text/javascript" src="js/sl2.js"></script>
<script type="text/javascript" src="js/ch.js"></script>
<script>
function refreshPeriodic() {
<?php if($fbattle->battle) { ?>location.href = '<?=$_SERVER['PHP_SELF']?>?batl=<?=$_REQUEST['batl']?>';//reload();
<?}?>
const timerID = setTimeout("refreshPeriodic()", 20000);
}
timerID = setTimeout("refreshPeriodic()", 20000);
let Hint3Name = '';
function findlogin(title, script, name) {
document.all("hint3").innerHTML = '<table width=100% cellspacing=1 cellpadding=0 bgcolor=CCC3AA><tr><td align=center><B>' + title + '</td><td width=20 align=right valign=top style="cursor: pointer" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>' +
'<form action="' + script + '" method=POST><table width=100% cellspacing=0 cellpadding=2 bgcolor=FFF6DD><tr><INPUT TYPE=hidden name=sd4 value="6"><td colspan=2>' +
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right><INPUT TYPE=text NAME="' + name + '"></TD><TD width=50%><INPUT TYPE="submit" value=" »» "></TD></TR></TABLE></FORM></td></tr></table>';
document.all("hint3").style.visibility = "visible";
document.all("hint3").style.left = 100;
document.all("hint3").style.top = 100;
document.all(name).focus();
Hint3Name = name;
}
let attack = false;
let defend = false;
function check() {
if ((!attack) || (!defend)) {
alert('Блок или удар не выбран.');
return false;
}
return true;
}
timerID = setTimeout("refreshPeriodic()", 20000);
</SCRIPT>
<script>
let Hint3Name = '';
function Prv(logins) {
top.frames['bottom'].window.document.F1.text.focus();
top.frames['bottom'].document.forms[0].text.value = logins + top.frames['bottom'].document.forms[0].text.value;
}
function findlogin(title, script, name) {
document.all("hint3").innerHTML = '<table width=100% cellspacing=1 cellpadding=0 bgcolor=CCC3AA><tr><td align=center><B>' + title + '</td><td width=20 align=right valign=top style="cursor: pointer" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>' +
'<form action="' + script + '" method=POST><table width=100% cellspacing=0 cellpadding=2 bgcolor=FFF6DD><tr><INPUT TYPE=hidden name=sd4 value="6"><td colspan=2>' +
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right><INPUT TYPE=text NAME="' + name + '"></TD><TD width=50%><INPUT TYPE="submit" value=" »» "></TD></TR></TABLE></FORM></td></tr></table>';
document.all("hint3").style.visibility = "visible";
document.all("hint3").style.left = 100;
document.all("hint3").style.top = 100;
document.all(name).focus();
Hint3Name = name;
}
function setattack() {
attack = true;
}
let attack = false;
let defend = false;
function setdefend() {
defend = true;
}
function check() {
if ((!attack) || (!defend)) {
alert('Блок или удар не выбран.');
return false;
}
return true;
}
function refreshPeriodic() {
<?php if($fbattle->battle) { ?>location.href = '<?=$_SERVER['PHP_SELF']?>?batl=<?=$_REQUEST['batl']?>'; <? } ?>
const timerID = setTimeout("refreshPeriodic()", 30000);
}
function Prv(logins) {
top.frames['bottom'].window.document.F1.text.focus();
top.frames['bottom'].document.forms[0].text.value = logins + top.frames['bottom'].document.forms[0].text.value;
}
timerID = setTimeout("refreshPeriodic()", 30000);
function setattack() {
attack = true;
}
function checksubmit() {
const ajaxload = 1;
if (ajaxload > 0) {
let enemy =;
let batl =;
const tac_at = $('input[name=attack]:checked').val();
const att = "&attack=" + $('input[name=attack]:checked').val();
const def = $('input[name=defend]:checked').val();
function setdefend() {
defend = true;
}
function refreshPeriodic() {
<?php if($fbattle->battle) { ?>location.href = '<?=$_SERVER['PHP_SELF']?>?batl=<?=$_REQUEST['batl']?>'; <? } ?>
const timerID = setTimeout("refreshPeriodic()", 30000);
}
timerID = setTimeout("refreshPeriodic()", 30000);
function checksubmit() {
const ajaxload = 1;
if (ajaxload > 0) {
let enemy =;
let batl =;
const tac_at = $('input[name=attack]:checked').val();
const att = "&attack=" + $('input[name=attack]:checked').val();
const def = $('input[name=defend]:checked').val();
if (tac_at >= 1 && def >= 1) {
$.ajax({
url: "fbattle.php",
type: "POST",
cache: false,
data: "batl=" + batl + "&myid=1053012363" + att + "&defend=" + def + "&enemy=" + enemy + "",
success: function (html) {
$("body").html(html);
}
});
} else {
alert('Выберите зону атаки и блока!');
$("#at").prop("disabled", false);
}
} else {
document.f1.submit();
}
}
$("document").ready(function () {
$('#refresh').click(function () {
if (tac_at >= 1 && def >= 1) {
$.ajax({
url: "fbattle.php",
type: "POST",
cache: false,
data: "batl=" + batl + "&myid=1053012363" + att + "&defend=" + def + "&enemy=" + enemy + "",
success: function (html) {
$("body").html(html);
}
});
});
$(".tooltip").tipTip({maxWidth: "auto", edgeOffset: 0, fadeIn: 300, fadeOut: 500});
});
</script>
<style type="text/css">
span {
font-family: Verdana, Arial, Helvetica, Tahoma, sans-serif;
text-decoration: none;
font-weight: bold;
cursor: pointer;
} else {
alert('Выберите зону атаки и блока!');
$("#at").prop("disabled", false);
}
} else {
document.f1.submit();
}
</style>
</head>
<body onLoad="top.setHP(<?= $user['hp'] ?>,<?= $user['maxhp'] ?>)">
}
$("document").ready(function () {
$('#refresh').click(function () {
$.ajax({
url: "fbattle.php",
cache: false,
success: function (html) {
$("body").html(html);
}
});
});
$(".tooltip").tipTip({maxWidth: "auto", edgeOffset: 0, fadeIn: 300, fadeOut: 500});
});
</script>
<style type="text/css">
span {
font-family: Verdana, Arial, Helvetica, Tahoma, sans-serif;
text-decoration: none;
font-weight: bold;
cursor: pointer;
}
</style>
<div id="hint3" class="ahint"></div>
<form action="<?= $_SERVER['PHP_SELF'] ?>" method="POST" name="f1" id="f1">
<table width=100% cellspacing=0 cellpadding=0 border=0>
@ -183,7 +172,7 @@ $fbattle = new fbattle($user['battle']);
$bb = str_replace('"', "&quot;", (strip_tags($bb[0])));
header("Location: " . $_SERVER['PHP_SELF'] . "?buf=" . $bb);
} else {
die();
exit;
}
}
@ -542,12 +531,8 @@ $fbattle = new fbattle($user['battle']);
</td></tr>
</table>
</form>
<div id="oMenu" onmouseout="closeMenu()"
style="position: absolute; border: 1px solid #666; background-color: #CCC; display: none; "></div>
</body>
</html>
<?php
db::c()->query('UNLOCK TABLES');
?>

View File

@ -11,12 +11,8 @@ if (empty($userLoginStatus)) {
} else {
db::c()->query('UPDATE `users` SET `enter_game` = 0 WHERE `enter_game` = 1 AND `id` = ?i', $_SESSION['uid']);
}
Template::header('Окно игры');
?>
<!doctype html>
<html lang="ru">
<head>
<title>Окно игры</title>
<meta charset="utf-8">
<script>
if (!navigator.cookieEnabled) {
document.write('Внимание! В вашем браузере отключена поддержка Cookies. Включите чтобы играть.');
@ -51,8 +47,6 @@ if (empty($userLoginStatus)) {
padding: 0;
}
</style>
</head>
<body>
<table class="frametable">
<tr style="height: 25px;">
<td class="frametd">
@ -71,6 +65,4 @@ if (empty($userLoginStatus)) {
<iframe id="chat<?= mt_rand() ?>" class="FRAME" src="chat.php" frameborder="0" name="chatframe"></iframe>
</td>
</tr>
</table>
</body>
</html>
</table>

View File

@ -1,42 +1,44 @@
<?php
session_start();
if(!isset($_SESSION['uid'])) { die();}
if (empty($_SESSION['uid'])) {
exit;
}
require_once "functions.php";
if($user['room'] == 51) { header('location: city.php'); die(); }
if ($user->room == 51) {
header('location: city.php');
exit;
}
if($_GET['go'] == 'vixod') {
$les_login = mysql_fetch_array(mysql_query("SELECT `room` FROM `les_game` WHERE `owner` = '".$user['id']."' LIMIT 1"));
if($les_login['room'] == 'G8') {
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '51', `online`.`room` = '51' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '".$user['id']."'");
mysql_query("DELETE FROM `les_res` WHERE `owner` = '".$user['id']."' LIMIT 1");
}
if ($_GET['go'] == 'vixod') {
$les_login = mysql_fetch_array(mysql_query("SELECT `room` FROM `les_game` WHERE `owner` = '" . $user['id'] . "' LIMIT 1"));
if ($les_login['room'] == 'G8') {
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '51', `online`.`room` = '51' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `les_res` WHERE `owner` = '" . $user['id'] . "' LIMIT 1");
}
}
$tes = mysql_query("SELECT * FROM `les_res` WHERE `owner` = '".$user['id']."'");
if(!$les_res = mysql_fetch_array($tes)) {
$i = 0;
while($i++ < 25) {
$res = array('', 'Silver Nugget', 'Stem', 'Animal Bone', 'Suede', 'Iron Ore', 'Silver Nugget', 'Stem', 'Animal Bone', 'Suede', 'Iron Ore', 'Silver Nugget', 'Stem', 'Animal Bone', 'Suede', 'Iron Ore', 'Silver Nugget', 'Stem', 'Animal Bone', 'Suede', 'Iron Ore', 'Silver Nugget', 'Stem', 'Animal Bone', 'Suede', 'Iron Ore');
$img = array('', 'Silver_Nugget.jpg', 'Stem.jpg', 'Animal_Bone.jpg', 'Suede.jpg', 'Iron_Ore.jpg', 'Silver_Nugget.jpg', 'Stem.jpg', 'Animal_Bone.jpg', 'Suede.jpg', 'Iron_Ore.jpg', 'Silver_Nugget.jpg', 'Stem.jpg', 'Animal_Bone.jpg', 'Suede.jpg', 'Iron_Ore.jpg', 'Silver_Nugget.jpg', 'Stem.jpg', 'Animal_Bone.jpg', 'Suede.jpg', 'Iron_Ore.jpg', 'Silver_Nugget.jpg', 'Stem.jpg', 'Animal_Bone.jpg', 'Suede.jpg', 'Iron_Ore.jpg');
$otdel = rand(1, 9);
$komnata = rand(0, 7);
$kmn[1] = array('A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8');
$kmn[2] = array('B1', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B8');
$kmn[3] = array('C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'C7', 'C8');
$kmn[4] = array('D1', 'D2', 'D3', 'D4', 'D5', 'D6', 'D7', 'D8');
$kmn[5] = array('E1', 'E2', 'E3', 'E4', 'E5', 'E6', 'E7', 'E8');
$kmn[6] = array('F1', 'F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8');
$kmn[7] = array('G1', 'G2', 'G3', 'G4', 'G5', 'G6', 'G7', 'G8');
$kmn[8] = array('H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'H7', 'H8');
$kmn[9] = array('I1', 'I2', 'I3', 'I4', 'I5', 'I6', 'I7', 'I8');
mysql_query("INSERT INTO les_res (`owner`, `name`, `img`, `kom`) VALUES ('".$user['id']."', '".$res[$i]."', '".$img[$i]."', '".$kmn[$otdel][$komnata]."')");
}
$tes = mysql_query("SELECT * FROM `les_res` WHERE `owner` = '" . $user['id'] . "'");
if (!$les_res = mysql_fetch_array($tes)) {
$i = 0;
while ($i++ < 25) {
$res = ['', 'Silver Nugget', 'Stem', 'Animal Bone', 'Suede', 'Iron Ore', 'Silver Nugget', 'Stem', 'Animal Bone', 'Suede', 'Iron Ore', 'Silver Nugget', 'Stem', 'Animal Bone', 'Suede', 'Iron Ore', 'Silver Nugget', 'Stem', 'Animal Bone', 'Suede', 'Iron Ore', 'Silver Nugget', 'Stem', 'Animal Bone', 'Suede', 'Iron Ore'];
$img = ['', 'Silver_Nugget.jpg', 'Stem.jpg', 'Animal_Bone.jpg', 'Suede.jpg', 'Iron_Ore.jpg', 'Silver_Nugget.jpg', 'Stem.jpg', 'Animal_Bone.jpg', 'Suede.jpg', 'Iron_Ore.jpg', 'Silver_Nugget.jpg', 'Stem.jpg', 'Animal_Bone.jpg', 'Suede.jpg', 'Iron_Ore.jpg', 'Silver_Nugget.jpg', 'Stem.jpg', 'Animal_Bone.jpg', 'Suede.jpg', 'Iron_Ore.jpg', 'Silver_Nugget.jpg', 'Stem.jpg', 'Animal_Bone.jpg', 'Suede.jpg', 'Iron_Ore.jpg'];
$otdel = rand(1, 9);
$komnata = rand(0, 7);
$kmn[1] = ['A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8'];
$kmn[2] = ['B1', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B8'];
$kmn[3] = ['C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'C7', 'C8'];
$kmn[4] = ['D1', 'D2', 'D3', 'D4', 'D5', 'D6', 'D7', 'D8'];
$kmn[5] = ['E1', 'E2', 'E3', 'E4', 'E5', 'E6', 'E7', 'E8'];
$kmn[6] = ['F1', 'F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8'];
$kmn[7] = ['G1', 'G2', 'G3', 'G4', 'G5', 'G6', 'G7', 'G8'];
$kmn[8] = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'H7', 'H8'];
$kmn[9] = ['I1', 'I2', 'I3', 'I4', 'I5', 'I6', 'I7', 'I8'];
mysql_query("INSERT INTO les_res (`owner`, `name`, `img`, `kom`) VALUES ('" . $user['id'] . "', '" . $res[$i] . "', '" . $img[$i] . "', '" . $kmn[$otdel][$komnata] . "')");
}
}
#nick99($user['id']);
$rand = rand(25, 100);
$rbot = rand(1, 5);
$bots[1] = 'Медведь';
@ -44,189 +46,205 @@ $bots[2] = 'Заяц';
$bots[3] = 'Лось';
$bots[4] = 'Волк';
$bots[5] = 'Лесник';
if($rand < 15 && $user['battle'] == 0) {
$sex = mysql_query("SELECT `id`, `maxhp` FROM `users` WHERE `login` = '".$bots[$rbot]."' LIMIT 1");
$dded = mysql_fetch_array($sex);
mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`) VALUES ('".$bots[$rbot]."', '".$dded["id"]."', '', '".$dded["maxhp"]."')");
$bot = mysql_insert_id();
$teams = array();
$teams[$user['id']][$bot] = array(0, 0, time());
$teams[$bot][$user['id']] = array(0, 0, time());
mysql_query("INSERT INTO `battle`(`teams`, `timeout`, `type`, `status`, `t1`, `t2`, `to1`, `to2`) VALUES ('".serialize($teams)."', '3', '1', '0', '".$user['id']."', '".$bot."', '".time()."', '".time()."')");
$id = mysql_insert_id();
mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE `id` = {$bot} LIMIT 1");
$rr = "<b>".Nick::id($user['id'])->full(1)."</b> и <b>".Nick::id($bot)->full(1)."</b>";
addlog($id,"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." бросили вызов друг другу. <br />");
mysql_query("UPDATE `users` SET `battle` = {$id}, `zayavka` = 0 WHERE `id` = '".$user['id']."' LIMIT 1");
addchp ('<b style="color:#990000">Внимание!</b> На вас напал "'.$bots[$rbot].'". ','{[]}'.Nick::id($user["id"])->short().'{[]}');
if ($rand < 15 && $user['battle'] == 0) {
$sex = mysql_query("SELECT `id`, `maxhp` FROM `users` WHERE `login` = '" . $bots[$rbot] . "' LIMIT 1");
$dded = mysql_fetch_array($sex);
mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`) VALUES ('" . $bots[$rbot] . "', '" . $dded["id"] . "', '', '" . $dded["maxhp"] . "')");
$bot = mysql_insert_id();
$teams = [];
$teams[$user['id']][$bot] = [0, 0, time()];
$teams[$bot][$user['id']] = [0, 0, time()];
mysql_query("INSERT INTO `battle`(`teams`, `timeout`, `type`, `status`, `t1`, `t2`, `to1`, `to2`) VALUES ('" . serialize($teams) . "', '3', '1', '0', '" . $user['id'] . "', '" . $bot . "', '" . time() . "', '" . time() . "')");
$id = mysql_insert_id();
mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE `id` = {$bot} LIMIT 1");
$rr = "<b>" . Nick::id($user['id'])->full(1) . "</b> и <b>" . Nick::id($bot)->full(1) . "</b>";
addlog($id, "Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " бросили вызов друг другу. <br />");
mysql_query("UPDATE `users` SET `battle` = {$id}, `zayavka` = 0 WHERE `id` = '" . $user['id'] . "' LIMIT 1");
addchp('<b style="color:#990000">Внимание!</b> На вас напал "' . $bots[$rbot] . '". ', '{[]}' . Nick::id($user["id"])->short() . '{[]}');
}
if($user['battle'] > 0) { header('location: fbattle.php'); die(); }
$les_login = mysql_fetch_array(mysql_query("SELECT * FROM `les_game` WHERE `owner` = '".$user['id']."' LIMIT 1"));
$rooms = array("A1" => array('20', '', 'A2', '', 'B1'), "A2" => array('15', 'A1', 'A3', '', ''), "A3" => array('15', 'A2', '', '', ''), "A4" => array('15', '', 'A5', '', 'B4'), "A5" => array('15', 'A4', '', '', 'B5'), "A6" => array('15', '', 'A7', '', 'B6'), "A7" => array('15', 'A6', 'A8', '', ''), "A8" => array('15', 'A7', '', '', 'B8'), "B1" => array('20', '', '', 'A1', ''), "B2" => array('15', '', 'B3', '', 'C2'), "B3" => array('15', 'B2', 'B4', '', ''), "B4" => array('15', 'B3', '', 'A4', ''), "B5" => array('15', '', 'B6', 'A5', ''), "B6" => array('15', 'B5', 'B7', 'A6', ''), "B7" => array('15', 'B6', '', '', 'C7'), "B8" => array('15', '', '', 'A8', 'C8'), "C1" => array('20', '', '', '', 'D1'), "C2" => array('15', '', 'C3', 'B2', 'D2'), "C3" => array('15', 'C2', '', '', 'D3'), "C4" => array('15', '', '', '', 'D4'), "C5" => array('15', '', '', '', 'D5'), "C6" => array('15', '', 'C7', '', ''), "C7" => array('15', 'C6', 'C8', 'B7', ''), "C8" => array('15', 'C7', '', 'B8', 'D8'), "D1" => array('20', '', 'D2', 'C1', 'E1'), "D2" => array('15', 'D1', 'D3', 'C2', 'E2'), "D3" => array('15', 'D2', 'D4', 'C3', 'E3'), "D4" => array('15', 'D3', 'D5', 'C4', 'E4'), "D5" => array('15', 'D4', '', 'C5', ''), "D6" => array('15', '', 'D7', '', 'E6'), "D7" => array('15', 'D6', '', '', ''), "D8" => array('15', '', '', 'C8', 'E8'), "E1" => array('20', '', 'E2', 'D1', 'F1'), "E2" => array('15', 'E1', 'E3', 'D2', 'F2'), "E3" => array('15', 'E2', 'E4', 'D3', 'F3'), "E4" => array('15', 'E3', 'E5', 'D4', 'F4'), "E5" => array('15', 'E4', 'E6', '', 'F5'), "E6" => array('15', 'E5', '', 'D6', ''), "E7" => array('15', '', 'E8', '', 'F7'), "E8" => array('15', 'E7', '', 'D8', 'F8'), "F1" => array('20', '', 'F2', 'E1', 'G1'), "F2" => array('15', 'F1', 'F3', 'E2', 'G2'), "F3" => array('15', 'F2', 'F4', 'E3', 'G3'), "F4" => array('15', 'F3', 'F5', 'E4', 'G4'), "F5" => array('15', 'F4', '', 'E5', 'G5'), "F6" => array('15', '', '', '', 'G6'), "F7" => array('15', '', '', 'E7', 'G7'), "F8" => array('15', '', '', 'E8', 'G8'), "G1" => array('20', '', '', 'F1', 'H1'), "G2" => array('15', '', '', 'F2', ''), "G3" => array('15', '', '', 'F3', ''), "G4" => array('15', '', '', 'F4', ''), "G5" => array('15', '', 'G6', 'F5', ''), "G6" => array('15', 'G5', 'G7', 'F6', ''), "G7" => array('15', 'G6', 'G8', 'F7', ''), "G8" => array('15', 'G7', '', 'F8', 'H8'), "H1" => array('20', '', 'H2', 'G1', 'I1'), "H2" => array('15', 'H1', '', '', 'I2'), "H3" => array('15', '', '', '', 'I3'), "H4" => array('15', '', 'H5', '', 'I4'), "H5" => array('15', 'H4', '', '', 'I5'), "H6" => array('15', '', 'H7', '', 'I6'), "H7" => array('15', 'H6', '', '', 'I7'), "H8" => array('15', 'H7', '', 'G8', 'I8'), "I1" => array('20', '', 'I2', 'H1', ''), "I2" => array('15', 'I1', 'I3', 'H2', ''), "I3" => array('15', 'I2', 'I4', 'H3', ''), "I4" => array('15', 'I3', 'I5', 'H4', ''), "I5" => array('15', 'I4', 'I6', 'H5', ''), "I6" => array('15', 'I5', 'I7', 'H6', ''), "I7" => array('15', 'I6', 'I8', 'H7', ''), "I8" => array('15', 'I7', '', 'H8', ''));
$time = $_SESSION['time']-time();
if($time < 0) { $time = 0; }
if($_GET["v"] && $_GET["v"] != '' && $time <= 0 && $rooms[$les_login['room']][1] == $_GET["v"]) {
$_SESSION['time'] = time()+$rooms[$les_login['room']][0];
mysql_query("UPDATE `les_game` SET `room` = '".$_GET["v"]."' WHERE `owner` = '".$user['id']."' LIMIT 1");
$_GET["v"] = 0;
if ($user['battle'] > 0) {
header('location: fbattle.php');
exit;
}
if($_GET["n"] && $_GET["n"] != '' && $time <= 0 && $rooms[$les_login['room']][2] == $_GET["n"]) {
$_SESSION['time'] = time()+$rooms[$les_login['room']][0];
mysql_query("UPDATE `les_game` SET `room` = '".$_GET["n"]."' WHERE `owner` = '".$user['id']."' LIMIT 1");
$_GET["n"] = 0;
$les_login = mysql_fetch_array(mysql_query("SELECT * FROM `les_game` WHERE `owner` = '" . $user['id'] . "' LIMIT 1"));
$rooms = ["A1" => ['20', '', 'A2', '', 'B1'], "A2" => ['15', 'A1', 'A3', '', ''], "A3" => ['15', 'A2', '', '', ''], "A4" => ['15', '', 'A5', '', 'B4'], "A5" => ['15', 'A4', '', '', 'B5'], "A6" => ['15', '', 'A7', '', 'B6'], "A7" => ['15', 'A6', 'A8', '', ''], "A8" => ['15', 'A7', '', '', 'B8'], "B1" => ['20', '', '', 'A1', ''], "B2" => ['15', '', 'B3', '', 'C2'], "B3" => ['15', 'B2', 'B4', '', ''], "B4" => ['15', 'B3', '', 'A4', ''], "B5" => ['15', '', 'B6', 'A5', ''], "B6" => ['15', 'B5', 'B7', 'A6', ''], "B7" => ['15', 'B6', '', '', 'C7'], "B8" => ['15', '', '', 'A8', 'C8'], "C1" => ['20', '', '', '', 'D1'], "C2" => ['15', '', 'C3', 'B2', 'D2'], "C3" => ['15', 'C2', '', '', 'D3'], "C4" => ['15', '', '', '', 'D4'], "C5" => ['15', '', '', '', 'D5'], "C6" => ['15', '', 'C7', '', ''], "C7" => ['15', 'C6', 'C8', 'B7', ''], "C8" => ['15', 'C7', '', 'B8', 'D8'], "D1" => ['20', '', 'D2', 'C1', 'E1'], "D2" => ['15', 'D1', 'D3', 'C2', 'E2'], "D3" => ['15', 'D2', 'D4', 'C3', 'E3'], "D4" => ['15', 'D3', 'D5', 'C4', 'E4'], "D5" => ['15', 'D4', '', 'C5', ''], "D6" => ['15', '', 'D7', '', 'E6'], "D7" => ['15', 'D6', '', '', ''], "D8" => ['15', '', '', 'C8', 'E8'], "E1" => ['20', '', 'E2', 'D1', 'F1'], "E2" => ['15', 'E1', 'E3', 'D2', 'F2'], "E3" => ['15', 'E2', 'E4', 'D3', 'F3'], "E4" => ['15', 'E3', 'E5', 'D4', 'F4'], "E5" => ['15', 'E4', 'E6', '', 'F5'], "E6" => ['15', 'E5', '', 'D6', ''], "E7" => ['15', '', 'E8', '', 'F7'], "E8" => ['15', 'E7', '', 'D8', 'F8'], "F1" => ['20', '', 'F2', 'E1', 'G1'], "F2" => ['15', 'F1', 'F3', 'E2', 'G2'], "F3" => ['15', 'F2', 'F4', 'E3', 'G3'], "F4" => ['15', 'F3', 'F5', 'E4', 'G4'], "F5" => ['15', 'F4', '', 'E5', 'G5'], "F6" => ['15', '', '', '', 'G6'], "F7" => ['15', '', '', 'E7', 'G7'], "F8" => ['15', '', '', 'E8', 'G8'], "G1" => ['20', '', '', 'F1', 'H1'], "G2" => ['15', '', '', 'F2', ''], "G3" => ['15', '', '', 'F3', ''], "G4" => ['15', '', '', 'F4', ''], "G5" => ['15', '', 'G6', 'F5', ''], "G6" => ['15', 'G5', 'G7', 'F6', ''], "G7" => ['15', 'G6', 'G8', 'F7', ''], "G8" => ['15', 'G7', '', 'F8', 'H8'], "H1" => ['20', '', 'H2', 'G1', 'I1'], "H2" => ['15', 'H1', '', '', 'I2'], "H3" => ['15', '', '', '', 'I3'], "H4" => ['15', '', 'H5', '', 'I4'], "H5" => ['15', 'H4', '', '', 'I5'], "H6" => ['15', '', 'H7', '', 'I6'], "H7" => ['15', 'H6', '', '', 'I7'], "H8" => ['15', 'H7', '', 'G8', 'I8'], "I1" => ['20', '', 'I2', 'H1', ''], "I2" => ['15', 'I1', 'I3', 'H2', ''], "I3" => ['15', 'I2', 'I4', 'H3', ''], "I4" => ['15', 'I3', 'I5', 'H4', ''], "I5" => ['15', 'I4', 'I6', 'H5', ''], "I6" => ['15', 'I5', 'I7', 'H6', ''], "I7" => ['15', 'I6', 'I8', 'H7', ''], "I8" => ['15', 'I7', '', 'H8', '']];
$time = $_SESSION['time'] - time();
if ($time < 0) {
$time = 0;
}
if($_GET["l"] && $_GET["l"] != '' && $time <= 0 && $rooms[$les_login['room']][3] == $_GET["l"]) {
$_SESSION['time'] = time()+$rooms[$les_login['room']][0];
mysql_query("UPDATE `les_game` SET `room` = '".$_GET["l"]."' WHERE `owner` = '".$user['id']."' LIMIT 1");
$_GET["l"] = 0;
if ($_GET["v"] && $_GET["v"] != '' && $time <= 0 && $rooms[$les_login['room']][1] == $_GET["v"]) {
$_SESSION['time'] = time() + $rooms[$les_login['room']][0];
mysql_query("UPDATE `les_game` SET `room` = '" . $_GET["v"] . "' WHERE `owner` = '" . $user['id'] . "' LIMIT 1");
$_GET["v"] = 0;
}
if($_GET["p"] && $_GET["p"] != '' && $time <= 0 && $rooms[$les_login['room']][4] == $_GET["p"]) {
$_SESSION['time'] = time()+$rooms[$les_login['room']][0];
mysql_query("UPDATE `les_game` SET `room` = '".$_GET["p"]."' WHERE `owner` = '".$user['id']."' LIMIT 1");
$_GET["p"] = 0;
if ($_GET["n"] && $_GET["n"] != '' && $time <= 0 && $rooms[$les_login['room']][2] == $_GET["n"]) {
$_SESSION['time'] = time() + $rooms[$les_login['room']][0];
mysql_query("UPDATE `les_game` SET `room` = '" . $_GET["n"] . "' WHERE `owner` = '" . $user['id'] . "' LIMIT 1");
$_GET["n"] = 0;
}
if ($_GET["l"] && $_GET["l"] != '' && $time <= 0 && $rooms[$les_login['room']][3] == $_GET["l"]) {
$_SESSION['time'] = time() + $rooms[$les_login['room']][0];
mysql_query("UPDATE `les_game` SET `room` = '" . $_GET["l"] . "' WHERE `owner` = '" . $user['id'] . "' LIMIT 1");
$_GET["l"] = 0;
}
if ($_GET["p"] && $_GET["p"] != '' && $time <= 0 && $rooms[$les_login['room']][4] == $_GET["p"]) {
$_SESSION['time'] = time() + $rooms[$les_login['room']][0];
mysql_query("UPDATE `les_game` SET `room` = '" . $_GET["p"] . "' WHERE `owner` = '" . $user['id'] . "' LIMIT 1");
$_GET["p"] = 0;
}
///////////////Сбор/////////////
if($_GET['res']) {
$gss = mysql_fetch_array(mysql_query("SELECT * FROM `les_res` WHERE `owner` = '".$user['id']."' AND `id` = '".mysql_real_escape_string($_GET['res'])."' AND `kom` = '".$les_login['room']."' LIMIT 1"));
if($gss) {
$f = mysql_query("SELECT `koll` FROM `inventory` WHERE `owner` = '".$user['id']."' AND `type` = '200' AND `name` = '".$gss['name']."' LIMIT 1");
if($g = mysql_fetch_array($f)) {
mysql_query("UPDATE `inventory` SET `koll` = (`koll`+1), `massa` = (`massa`+0.1) WHERE `owner` = '".$user['id']."' AND `type` = '200' AND `name` = '".$gss['name']."' LIMIT 1");
if ($_GET['res']) {
$gss = mysql_fetch_array(mysql_query("SELECT * FROM `les_res` WHERE `owner` = '" . $user['id'] . "' AND `id` = '" . mysql_real_escape_string($_GET['res']) . "' AND `kom` = '" . $les_login['room'] . "' LIMIT 1"));
if ($gss) {
$f = mysql_query("SELECT `koll` FROM `inventory` WHERE `owner` = '" . $user['id'] . "' AND `type` = '200' AND `name` = '" . $gss['name'] . "' LIMIT 1");
if ($g = mysql_fetch_array($f)) {
mysql_query("UPDATE `inventory` SET `koll` = (`koll`+1), `massa` = (`massa`+0.1) WHERE `owner` = '" . $user['id'] . "' AND `type` = '200' AND `name` = '" . $gss['name'] . "' LIMIT 1");
} else {
$fo = mysql_query("INSERT INTO `inventory`(`name`, `koll`, `img`, `owner`, `type`, `massa`, `isrep`, `podzem`, `maxdur`, `present`) VALUES ('" . $gss['name'] . "', '1', '" . $gss['img'] . "', '" . $user['id'] . "', '200', '0.1', '0', '1', '1', 'Лес')");
}
mysql_query("DELETE FROM `les_res` WHERE `id` = '" . $gss['id'] . "' LIMIT 1");
addchp('<b style="color:#990000">Внимание!</b> <b>' . $user["login"] . '</b>, поднял предмет "' . $gss['name'] . '".', '{[]}' . Nick::id($user["id"])->short() . '{[]}');
echo "<font style='color:#990000'>Вы подняли <b>'" . $gss['name'] . "'</b>.</font>";
} else {
$fo = mysql_query("INSERT INTO `inventory`(`name`, `koll`, `img`, `owner`, `type`, `massa`, `isrep`, `podzem`, `maxdur`, `present`) VALUES ('".$gss['name']."', '1', '".$gss['img']."', '".$user['id']."', '200', '0.1', '0', '1', '1', 'Лес')");
echo "&nbsp;<font style='font-size:12px; color:cc0000;'>Кто-то оказался быстрее!</font>";
}
mysql_query("DELETE FROM `les_res` WHERE `id` = '".$gss['id']."' LIMIT 1");
addchp ('<b style="color:#990000">Внимание!</b> <b>'.$user["login"].'</b>, поднял предмет "'.$gss['name'].'".', '{[]}'.Nick::id($user["id"])->short().'{[]}');
echo "<font style='color:#990000'>Вы подняли <b>'".$gss['name']."'</b>.</font>";
} else {
echo "&nbsp;<font style='font-size:12px; color:cc0000;'>Кто-то оказался быстрее!</font>";}
}
Template::header('Лес');
?>
<html>
<head>
<META HTTP-EQUIV=imagetoolbar CONTENT=no>
<script src="i/forest/char1.32.js"></script>
<script src="i/forest/funcs1.6.js"></script>
</head>
<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 bgcolor="#e2e0e0" onLoad="top.setHP(<?=$user['hp']?>,<?=$user['maxhp']?>,<? if (!$user['battle']){echo"10";}else{echo"0";}?>)">
<center><h4>Лес</h4></center>
<dd>
<dd><table cellspacing=2 cellpadding=0>
<tr>
<td>
<center><table width="450" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000">
<tr>
<td background="i/forest/bg_scroll_01.gif" align="center">Имя</td>
<td background="i/forest/bg_scroll_01.gif" align="center">Hp</td>
<td background="i/forest/bg_scroll_01.gif" align="center">Расположение</td>
</tr>
<?
$rog = mysql_query("SELECT * FROM `les_game` WHERE `owner` = '".$user['id']."'");
while($more = mysql_fetch_array($rog)) {
$big = mysql_fetch_array(mysql_query("SELECT `hp`, `maxhp`, `id`, `login` FROM `users` WHERE `id` = '".$more['owner']."'"));
?>
<tr>
<td background="i/forest/bg_scroll_05.gif" align="center">
<a href=inf.php?<?=$big['id']?> target=_blank title="Информация о <?=$big['login']?>"><?=$big['login']?></a></td>
<td background="i/forest/bg_scroll_05.gif" align="center"><?=$big['hp']?>/<?=$big['maxhp']?> </td>
<td background="i/forest/bg_scroll_05.gif" align="center"><?=$more['room']?></td>
<?
echo "</tr>";
}
?>
</table></center>
</td>
</tr>
</table>
<table cellpadding=5 width=100%><tr valign=top><td>
<table align=center width=95% height=100% cellpadding=5>
<tr valign=top>
<td width=100%>
<table cellspacing=2 cellpadding=0>
<tr>
<td>
<center>
<table width="450" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000">
<tr>
<td background="i/forest/bg_scroll_01.gif" align="center">Имя</td>
<td background="i/forest/bg_scroll_01.gif" align="center">Hp</td>
<td background="i/forest/bg_scroll_01.gif" align="center">Расположение</td>
</tr>
<?
$rog = mysql_query("SELECT * FROM `les_game` WHERE `owner` = '" . $user['id'] . "'");
while ($more = mysql_fetch_array($rog)) {
$big = mysql_fetch_array(mysql_query("SELECT `hp`, `maxhp`, `id`, `login` FROM `users` WHERE `id` = '" . $more['owner'] . "'"));
?>
<tr>
<td background="i/forest/bg_scroll_05.gif" align="center">
<a href=inf.php?<?= $big['id'] ?> target=_blank
title="Информация о <?= $big['login'] ?>"><?= $big['login'] ?></a></td>
<td background="i/forest/bg_scroll_05.gif" align="center"><?= $big['hp'] ?>
/<?= $big['maxhp'] ?> </td>
<td background="i/forest/bg_scroll_05.gif" align="center"><?= $more['room'] ?></td>
<?
echo "</tr>";
}
?>
</table>
</center>
</td>
</tr>
</table>
<table width=100%><tr>
<table cellpadding=5 width=100%>
<tr valign=top>
<td>
<table align=center width=95% height=100% cellpadding=5>
<tr valign=top>
<td width=100%>
<td align=center colspan=2 id="navtbl">
<?
if($rooms[$les_login['room']][1] != '') {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?v=".$rooms[$les_login['room']][1]."';\" value=\"На север\" />";
} else {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?v=".$rooms[$les_login['room']][1]."';\" value=\"\" />";
}
?>
<br /><br />
<?
if($rooms[$les_login['room']][3] != '') {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?l=".$rooms[$les_login['room']][3]."';\" value=\"На запад\" />";
} else {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onClick=\"location.href='?l=".$rooms[$les_login['room']][3]."';\" value=\"\" />";
}
?>
&nbsp;
<?
if($rooms[$les_login['room']][4] != '') {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?p=".$rooms[$les_login['room']][4]."';\" value=\"На восток\" />";
} else {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?p=".$rooms[$les_login['room']][4]."';\" value=\"\" />";
}
?>&nbsp;
<br /><br />
<?
if($rooms[$les_login['room']][2] != '') {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?n=".$rooms[$les_login['room']][2]."';\" value=\"На юг\" />";
} else {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?n=".$rooms[$les_login['room']][2]."';\" value=\"\" />";
}
?>
<br /><br />
<table width=100%>
<tr>
<td align=center colspan=2 id="navtbl">
<?
if ($rooms[$les_login['room']][1] != '') {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?v=" . $rooms[$les_login['room']][1] . "';\" value=\"На север\" />";
} else {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?v=" . $rooms[$les_login['room']][1] . "';\" value=\"\" />";
}
?>
<br/><br/>
<?
if ($rooms[$les_login['room']][3] != '') {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?l=" . $rooms[$les_login['room']][3] . "';\" value=\"На запад\" />";
} else {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onClick=\"location.href='?l=" . $rooms[$les_login['room']][3] . "';\" value=\"\" />";
}
?>
&nbsp;
<?
if ($rooms[$les_login['room']][4] != '') {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?p=" . $rooms[$les_login['room']][4] . "';\" value=\"На восток\" />";
} else {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?p=" . $rooms[$les_login['room']][4] . "';\" value=\"\" />";
}
?>&nbsp;
<br/><br/>
<?
if ($rooms[$les_login['room']][2] != '') {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?n=" . $rooms[$les_login['room']][2] . "';\" value=\"На юг\" />";
} else {
echo "<input style=\"width: 150px; height: 20;\" type=\"button\" class=\"btn\" onclick=\"location.href='?n=" . $rooms[$les_login['room']][2] . "';\" value=\"\" />";
}
?>
<br/><br/>
<? if($les_login['room'] == 'G8') { ?>
<input class=btn style="width:150px;height:20" type="button" value="Выйти из леса" onclick="location.href='?go=vixod';" /><br /><br />
<? } ?>
</td>
<? $les = mysql_query("SELECT `id` FROM `les_res` WHERE `owner` = '".$user['id']."'"); ?>
</tr>
<tr valign=top>
<td width="40%" valign="top">
<a href='i/forest/les.jpg' target="_blank">Карта</a>
<br />
<span>Расположение : <b><?=$les_login['room']?></b></span><br />
<span>Не собрано ресурсов : <b><?=$col = mysql_num_rows($les);?></b></span><br /><span id="moveid"></span>
<?
$time = ($_SESSION['time']-time());
if($time < 0) { $time = 0; }
?>
<script>go_timer_on(<?=$time?>,200);</script>
</td>
<td width="60%" align=right valign="bottom">
<?
$le = mysql_query("SELECT `id`, `img`, `name`, `owner`, `kom` FROM `les_res` WHERE `owner` = '".$user['id']."' AND `kom` = '".$les_login['room']."'");
while($res = mysql_fetch_array($le)) {
echo "<a href='forest.php?res=".$res['id']."'><img src=\"i/sh/".$res['img']."\" title=\"".$res['name']."\" border=0 /></a>";
}
?>
</td>
</tr>
</table>
<?
$img = rand(1, 24);
?>
<td align=center><div id=bgid style="background-color:#cccccc;border:#666666 1px solid;position:relative;width:450px;height:300px"><img class=img2 height=300 src="forest/<?=$img?>.jpg" /></div></td>
</tr>
</table></td></tr></table>
</body>
</html>
<? if ($les_login['room'] == 'G8') { ?>
<input class=btn style="width:150px;height:20" type="button"
value="Выйти из леса" onclick="location.href='?go=vixod';"/><br/>
<br/>
<? } ?>
</td>
<? $les = mysql_query("SELECT `id` FROM `les_res` WHERE `owner` = '" . $user['id'] . "'"); ?>
</tr>
<tr valign=top>
<td width="40%" valign="top">
<a href='i/forest/les.jpg' target="_blank">Карта</a>
<br/>
<span>Расположение : <b><?= $les_login['room'] ?></b></span><br/>
<span>Не собрано ресурсов : <b><?= $col = mysql_num_rows($les); ?></b></span><br/><span
id="moveid"></span>
<?
$time = ($_SESSION['time'] - time());
if ($time < 0) {
$time = 0;
}
?>
<script>go_timer_on(<?=$time?>, 200);</script>
</td>
<td width="60%" align=right valign="bottom">
<?
$le = mysql_query("SELECT `id`, `img`, `name`, `owner`, `kom` FROM `les_res` WHERE `owner` = '" . $user['id'] . "' AND `kom` = '" . $les_login['room'] . "'");
while ($res = mysql_fetch_array($le)) {
echo "<a href='forest.php?res=" . $res['id'] . "'><img src=\"i/sh/" . $res['img'] . "\" title=\"" . $res['name'] . "\" border=0 /></a>";
}
?>
</td>
</tr>
</table>
<?
$img = rand(1, 24);
?>
<td align=center>
<div id=bgid
style="background-color:#cccccc;border:#666666 1px solid;position:relative;width:450px;height:300px">
<img class=img2 height=300 src="forest/<?= $img ?>.jpg"/></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</dd>

824
forum.php
View File

@ -33,7 +33,7 @@ $replasepost = '';
function parse_bb_code($text)
{
$bbCodes = array(
$bbCodes = [
// Стандартные BB коды
'/\[(\/?)(b|i|u|s)\s*\]/' => "<$1$2>",
'/\[(left|center|right)\]/' => '<p style="text-align:$1;">',
@ -44,138 +44,9 @@ function parse_bb_code($text)
'/\[quote\](.+?)\[\/quote\]/' => "<blockquote>$1</blockquote>",
'/\[code\](.+?)\[\/code\]/' => "<pre><code>$1</code></pre>",
// Смайлы
'/\:smile0\:/' => '<img src="i/forum/icon7.gif" />',
'/\:baby\:/' => '<img src="i/smile/baby.gif" />',
'/\:sniper\:/' => '<img src="i/smile/sniper.gif" />',
'/\:trup\:/' => '<img src="i/smile/trup.gif" />',
'/\:beggar\:/' => '<img src="i/smile/beggar.gif" />',
'/\:rotate\:/' => '<img src="i/smile/rotate.gif" />',
'/\:hello\:/' => '<img src="i/smile/hello.gif" />',
'/\:sten\:/' => '<img src="i/smile/sten.gif" />',
'/\:shuffle\:/' => '<img src="i/smile/shuffle.gif" />',
'/\:elix\:/' => '<img src="i/smile/elix.gif" />',
'/\:smil\:/' => '<img src="i/smile/smil.gif" />',
'/\:mdr\:/' => '<img src="i/smile/mdr.gif" />',
'/\:podz\:/' => '<img src="i/smile/podz.gif" />',
'/\:dont\:/' => '<img src="i/smile/dont.gif" />',
'/\:grust\:/' => '<img src="i/smile/grust.gif" />',
'/\:boks\:/' => '<img src="i/smile/boks.gif" />',
'/\:susel\:/' => '<img src="i/smile/susel.gif" />',
'/\:dedmoroz\:/' => '<img src="i/smile/dedmoroz.gif" />',
'/\:creator\:/' => '<img src="i/smile/creator.gif" />',
'/\:no\:/' => '<img src="i/smile/no.gif" />',
'/\:horse\:/' => '<img src="i/smile/horse.gif" />',
'/\:vamp\:/' => '<img src="i/smile/vamp.gif" />',
'/\:eek\:/' => '<img src="i/smile/eek.gif" />',
'/\:sorry\:/' => '<img src="i/smile/sorry.gif" />',
'/\:friday\:/' => '<img src="i/smile/friday.gif" />',
'/\:obm\:/' => '<img src="i/smile/obm.gif" />',
'/\:smile\:/' => '<img src="i/smile/smile.gif" />',
'/\:nail\:/' => '<img src="i/smile/nail.gif" />',
'/\:gent\:/' => '<img src="i/smile/gent.gif" />',
'/\:beer\:/' => '<img src="i/smile/beer.gif" />',
'/\:inv\:/' => '<img src="i/smile/inv.gif" />',
'/\:fire\:/' => '<img src="i/smile/fire.gif" />',
'/\:dance1\:/' => '<img src="i/smile/dance1.gif" />',
'/\:maniac\:/' => '<img src="i/smile/maniac.gif" />',
'/\:kiss4\:/' => '<img src="i/smile/kiss4.gif" />',
'/\:confused\:/' => '<img src="i/smile/confused.gif" />',
'/\:kiss2\:/' => '<img src="i/smile/kiss2.gif" />',
'/\:snowfight\:/' => '<img src="i/smile/snowfight.gif" />',
'/\:row\:/' => '<img src="i/smile/row.gif" />',
'/\:naem\:/' => '<img src="i/smile/naem.gif" />',
'/\:radio1\:/' => '<img src="i/smile/radio1.gif" />',
'/\:fie\:/' => '<img src="i/smile/fie.gif" />',
'/\:love\:/' => '<img src="i/smile/love.gif" />',
'/\:sneeze\:/' => '<img src="i/smile/sneeze.gif" />',
'/\:mol\:/' => '<img src="i/smile/mol.gif" />',
'/\:showng\:/' => '<img src="i/smile/showng.gif" />',
'/\:rocket\:/' => '<img src="i/smile/rocket.gif" />',
'/\:dustman\:/' => '<img src="i/smile/dustman.gif" />',
'/\:rupor\:/' => '<img src="i/smile/rupor.gif" />',
'/\:nnn\:/' => '<img src="i/smile/nnn.gif" />',
'/\:snegur\:/' => '<img src="i/smile/snegur.gif" />',
'/\:dance2\:/' => '<img src="i/smile/dance2.gif" />',
'/\:jeer\:/' => '<img src="i/smile/jeer.gif" />',
'/\:kiss\:/' => '<img src="i/smile/kiss.gif" />',
'/\:ponder\:/' => '<img src="i/smile/ponder.gif" />',
'/\:drink\:/' => '<img src="i/smile/drink.gif" />',
'/\:angel\:/' => '<img src="i/smile/angel.gif" />',
'/\:idea\:/' => '<img src="i/smile/idea.gif" />',
'/\:lady\:/' => '<img src="i/smile/lady.gif" />',
'/\:gun\:/' => '<img src="i/smile/gun.gif" />',
'/\:pif\:/' => '<img src="i/smile/pif.gif" />',
'/\:help\:/' => '<img src="i/smile/help.gif" />',
'/\:alch\:/' => '<img src="i/smile/alch.gif" />',
'/\:kiss3\:/' => '<img src="i/smile/kiss3.gif" />',
'/\:hug\:/' => '<img src="i/smile/hug.gif" />',
'/\:lordhaos\:/' => '<img src="i/smile/lordhaos.gif" />',
'/\:rose\:/' => '<img src="i/smile/rose.gif" />',
'/\:radio2\:/' => '<img src="i/smile/radio2.gif" />',
'/\:boks2\:/' => '<img src="i/smile/boks2.gif" />',
'/\:str\:/' => '<img src="i/smile/str.gif" />',
'/\:invis\:/' => '<img src="i/smile/invis.gif" />',
'/\:rev\:/' => '<img src="i/smile/rev.gif" />',
'/\:ok\:/' => '<img src="i/smile/ok.gif" />',
'/\:alien\:/' => '<img src="i/smile/alien.gif" />',
'/\:smash\:/' => '<img src="i/smile/smash.gif" />',
'/\:super\:/' => '<img src="i/smile/super.gif" />',
'/\:love2\:/' => '<img src="i/smile/love2.gif" />',
'/\:victory\:/' => '<img src="i/smile/victory.gif" />',
'/\:kruger\:/' => '<img src="i/smile/kruger.gif" />',
'/\:agree\:/' => '<img src="i/smile/agree.gif" />',
'/\:hi\:/' => '<img src="i/smile/hi.gif" />',
'/\:privet\:/' => '<img src="i/smile/privet.gif" />',
'/\:devil\:/' => '<img src="i/smile/devil.gif" />',
'/\:naem2\:/' => '<img src="i/smile/naem2.gif" />',
'/\:tongue\:/' => '<img src="i/smile/tongue.gif" />',
'/\:red\:/' => '<img src="i/smile/red.gif" />',
'/\:doc\:/' => '<img src="i/smile/doc.gif" />',
'/\:icon7\:/' => '<img src="i/forum/icon7.gif" />',
'/\:lightfly\:/' => '<img src="i/smile/lightfly.gif" />',
'/\:owl\:/' => '<img src="i/smile/owl.gif" />',
'/\:pirate\:/' => '<img src="i/smile/pirate.gif" />',
'/\:sword\:/' => '<img src="i/smile/sword.gif" />',
'/\:bye\:/' => '<img src="i/smile/bye.gif" />',
'/\:mad\:/' => '<img src="i/smile/mad.gif" />',
'/\:fingal\:/' => '<img src="i/smile/fingal.gif" />',
'/\:nono\:/' => '<img src="i/smile/nono.gif" />',
'/\:loveya\:/' => '<img src="i/smile/loveya.gif" />',
'/\:cry\:/' => '<img src="i/smile/cry.gif" />',
'/\:superng\:/' => '<img src="i/smile/superng.gif" />',
'/\:yes\:/' => '<img src="i/smile/yes.gif" />',
'/\:crying\:/' => '<img src="i/smile/crying.gif" />',
'/\:\'\(\:/' => '<img src="i/smile/crying.gif" />',
'/\:flowers\:/' => '<img src="i/smile/flowers.gif" />',
'/\:tease\:/' => '<img src="i/smile/tease.gif" />',
'/\:wink\:/' => '<img src="i/smile/wink.gif" />',
'/\:sharp\:/' => '<img src="i/smile/sharp.gif" />',
'/\:nunu\:/' => '<img src="i/smile/nunu.gif" />',
'/\:angel2\:/' => '<img src="i/smile/angel2.gif" />',
'/\:naem3\:/' => '<img src="i/smile/naem3.gif" />',
'/\:lick\:/' => '<img src="i/smile/lick.gif" />',
'/\:ninja\:/' => '<img src="i/smile/ninja.gif" />',
'/\:cat\:/' => '<img src="i/smile/cat.gif" />',
'/\:smoke\:/' => '<img src="i/smile/smoke.gif" />',
'/\:chtoza\:/' => '<img src="i/smile/chtoza.gif" />',
'/\:grace\:/' => '<img src="i/smile/grace.gif" />',
'/\:tongue2\:/' => '<img src="i/smile/tongue2.gif" />',
'/\:sorry2\:/' => '<img src="i/smile/sorry2.gif" />',
'/\:yar\:/' => '<img src="i/smile/yar.gif" />',
'/\:king2\:/' => '<img src="i/smile/king2.gif" />',
'/\:carreat\:/' => '<img src="i/smile/carreat.gif" />',
'/\:hlw\:/' => '<img src="i/smile/hlw.gif" />',
'/\:grenade\:/' => '<img src="i/smile/grenade.gif" />',
'/\:bow\:/' => '<img src="i/smile/bow.gif" />',
'/\:doc2\:/' => '<img src="i/smile/doc2.gif" />',
'/\:duel\:/' => '<img src="i/smile/duel.gif" />',
'/\:mag\:/' => '<img src="i/smile/mag.gif" />',
'/\:king\:/' => '<img src="i/smile/king.gif" />',
'/\:laugh\:/' => '<img src="i/smile/laugh.gif" />',
'/\:pal\:/' => '<img src="i/smile/pal.gif" />',
'/\:nun\:/' => '<img src="i/smile/nun.gif" />',
'/\:ura\:/' => '<img src="i/smile/ura.gif" />',
);
];
$text = preg_replace(array_keys($bbCodes), array_values($bbCodes), $text);
$text = close_dangling_tags($text);
@ -335,343 +206,336 @@ if (isset($_GET['do']) && $isModerator == true) {
exit();
}
}
Template::header('Форум');
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Форум</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/wysibb/theme/default/wbbtheme.css"/>
<script type="text/javascript" language="JavaScript" src='js/forum.js'></script>
</head>
<body>
<table width="100%" border="0">
<tr valign="top">
<td width="200">
<br/>
<?php if (isset($user['id'])) echo "Игрок : " . Nick::id($user['id'])->full(1) . "<br />"; ?>
<h4>Конференции</h4>
<?php
if ((isset($_GET['conf']) && is_numeric($_GET['conf'])) || (isset($_GET['konftop']) && is_numeric($_GET['konftop'])) || $Movemess == 1) {
$data = db::c()->query('SELECT * FROM `forum` WHERE `parent` = 0 AND `type` = 1 ORDER BY `id` ASC');
while ($row = $data->fetch_assoc()) {
if (($row['min_align'] == 0 && $row['max_align'] == 0) || ($user['align'] >= $row['min_align'] && $user['align'] <= $row['max_align']) || $isAdmin) {
$min = $row['min_align'] == 0;
$max = $row['max_align'] == 0;
<table width="100%" border="0">
<tr valign="top">
<td width="200">
<br/>
<?php if (isset($user['id'])) echo "Игрок : " . Nick::id($user['id'])->full(1) . "<br />"; ?>
<h4>Конференции</h4>
<?php
if ((isset($_GET['conf']) && is_numeric($_GET['conf'])) || (isset($_GET['konftop']) && is_numeric($_GET['konftop'])) || $Movemess == 1) {
$data = db::c()->query('SELECT * FROM `forum` WHERE `parent` = 0 AND `type` = 1 ORDER BY `id` ASC');
while ($row = $data->fetch_assoc()) {
if (($row['min_align'] == 0 && $row['max_align'] == 0) || ($user['align'] >= $row['min_align'] && $user['align'] <= $row['max_align']) || $isAdmin) {
$min = $row['min_align'] == 0;
$max = $row['max_align'] == 0;
if (!isset($user['id']) || (($user['align'] < $row['min_align']) || ($user['align'] > $row['max_align']) && !$min && !$max)) {
echo '<nobr><b>&nbsp;&nbsp;📕';
} else {
echo '<nobr><b>&nbsp;&nbsp;📖&nbsp;';
if (!isset($user['id']) || (($user['align'] < $row['min_align']) || ($user['align'] > $row['max_align']) && !$min && !$max)) {
echo '<nobr><b>&nbsp;&nbsp;📕';
} else {
echo '<nobr><b>&nbsp;&nbsp;📖&nbsp;';
}
echo '<a href="?conf=' . $row['id'] . '">' . $row['topic'] . '</a><br /></b></nobr>';
}
echo '<a href="?conf=' . $row['id'] . '">' . $row['topic'] . '</a><br /></b></nobr>';
}
}
}
?>
</td>
<td rowspan="2" style="padding-left: 10px;">
<?php
if (!isset($_GET['conf'])) {
$row = db::c()->query('SELECT * FROM `forum` WHERE `id` = "?s"', $_GET['topic'])->fetch_assoc();
if (($row['min_align'] == 0 && $row['max_align'] == 0) || ($user['align'] >= $row['min_align'] && $user['align'] <= $row['max_align']) || $isAdmin) {
$top = $row['parent'];
$parentCat = db::c()->query('SELECT * FROM `forum` WHERE `id` = ?i', $top)->fetch_assoc();
$icons = $row['icon'];
?>
<h3><a href="forum.php?conf=<?= $top ?>">Конференция «<?= $parentCat['topic'] ?>»</a></h3>
<?php
if (isset($error)) err($error);
$par_top = db::c()->query('SELECT `closepal`, `id` FROM `forum` WHERE `id` = "?s"', $_GET['topic'])->fetch_row();
if (((int)$par_top[1] != 0) || ((int)$_GET['konftop'] > 0)) {
if ($row['close'] == 1) {
$close = "<a href='?topic={$_GET['topic']}&do=open'>🔓Открыть</a>";
$closed = 1;
$closepal = $row['closepal'];
} else {
$close = "<a href='?topic={$_GET['topic']}&do=close'>🔒Закрыть</a>";
}
if ($row['fix'] == 1) {
$fix = "<a href='?topic={$_GET['topic']}&do=unfix'>📄Открепить</a>";
} else {
$fix = "<a href='?topic={$_GET['topic']}&do=fix'>📌Прикрепить</a>";
}
if ($isModerator): ?>
<br>
<div align="right">
<small>
<?= $close ?> | <?= $fix ?>
<br><i>Перемещение тем не работает.</i>
</small>
</div>
<?php
endif;
$pgs = db::c()->query('SELECT count(`id`) FROM `forum` WHERE `parent` = "?s"', $_GET['topic'])->fetch_row();
$pgs = $pgs[0] / 20;
if ($pgs > 1) echo "<img src=i/ico/news.gif width=\"16\" height=\"16\" /> Страницы: ";
$pages_str = '';
$page = isset($_GET['page']) ? (((int)$_GET['page'] + 1) > $pgs ? ($pgs - 1) : (int)$_GET['page']) : 0;
$page = ceil($page);
if ($pgs > 1) {
for ($i = 0; $i < ceil($pgs); $i++) {
if (($i > ($page - 5)) && ($i <= ($page + 4))) {
$pages_str .= ($i == $page ? " <b>" . ($i + 1) . "</b>" : " <a href='?topic=" . (int)$row['id'] . "&konftop=" . htmlspecialchars($_GET['konftop']) . "&page=" . ($i) . "'>" . ($i + 1) . "</a>");
}
}
$pages_str .= ($page < $pgs - 5 ? " ..." : "");
$pages_str = ($page > 4 ? "<a href='?topic=" . (int)$row['id'] . "&konftop=" . htmlspecialchars($_GET['konftop']) . "&page=" . ($page - 1) . "'> &laquo; </a> ... " : "") . $pages_str . (($page < ($pgs - 1) ? "<a href='?topic=" . (int)$row['id'] . "&page=" . ($page + 1) . "' > &raquo; </a>" : ""));
}
$FirstPage = (ceil($pgs) > 4 ? $_GET['page'] > 0 ? "<a href='?topic=" . (int)$row['id'] . "&konftop=" . htmlspecialchars($_GET['konftop']) . "&page=0'> Первая </a>" : "" : "");
$LastPage = (ceil($pgs) > 4 ? (ceil($pgs) - 1) != $_GET['page'] ? "<a href='?topic=" . (int)$row['id'] . "&konftop=" . htmlspecialchars($_GET['konftop']) . "&page=" . (ceil($pgs) - 1) . "'> Последняя </a>" : "" : "");
$pages_str = $FirstPage . $pages_str . $LastPage;
echo $pages_str;
?>
</td>
<td rowspan="2" style="padding-left: 10px;">
<?php
if (!isset($_GET['conf'])) {
$row = db::c()->query('SELECT * FROM `forum` WHERE `id` = "?s"', $_GET['topic'])->fetch_assoc();
if (($row['min_align'] == 0 && $row['max_align'] == 0) || ($user['align'] >= $row['min_align'] && $user['align'] <= $row['max_align']) || $isAdmin) {
$top = $row['parent'];
$parentCat = db::c()->query('SELECT * FROM `forum` WHERE `id` = ?i', $top)->fetch_assoc();
$icons = $row['icon'];
?>
<div id="leaf<?= $row['id'] ?>"
style="background-color: #ddd;margin: 2px;padding:5px;overflow-x: auto;word-wrap: break-word;box-shadow: 1px 2px 3px #ccc;">
<h3><a href="forum.php?conf=<?= $top ?>">Конференция «<?= $parentCat['topic'] ?>»</a></h3>
<?php
if (isset($error)) err($error);
$par_top = db::c()->query('SELECT `closepal`, `id` FROM `forum` WHERE `id` = "?s"', $_GET['topic'])->fetch_row();
if (((int)$par_top[1] != 0) || ((int)$_GET['konftop'] > 0)) {
if ($row['close'] == 1) {
$close = "<a href='?topic={$_GET['topic']}&do=open'>🔓Открыть</a>";
$closed = 1;
$closepal = $row['closepal'];
} else {
$close = "<a href='?topic={$_GET['topic']}&do=close'>🔒Закрыть</a>";
}
if ($row['fix'] == 1) {
$fix = "<a href='?topic={$_GET['topic']}&do=unfix'>📄Открепить</a>";
} else {
$fix = "<a href='?topic={$_GET['topic']}&do=fix'>📌Прикрепить</a>";
}
if ($isModerator): ?>
<br>
<div align="right">
<small>
<?= $close ?> | <?= $fix ?>
<br><i>Перемещение тем не работает.</i>
</small>
</div>
<?php
endif;
$pgs = db::c()->query('SELECT count(`id`) FROM `forum` WHERE `parent` = "?s"', $_GET['topic'])->fetch_row();
$pgs = $pgs[0] / 20;
if ($pgs > 1) echo "<img src=i/ico/news.gif width=\"16\" height=\"16\" /> Страницы: ";
$pages_str = '';
$page = isset($_GET['page']) ? (((int)$_GET['page'] + 1) > $pgs ? ($pgs - 1) : (int)$_GET['page']) : 0;
$page = ceil($page);
if ($pgs > 1) {
for ($i = 0; $i < ceil($pgs); $i++) {
if (($i > ($page - 5)) && ($i <= ($page + 4))) {
$pages_str .= ($i == $page ? " <b>" . ($i + 1) . "</b>" : " <a href='?topic=" . (int)$row['id'] . "&konftop=" . htmlspecialchars($_GET['konftop']) . "&page=" . ($i) . "'>" . ($i + 1) . "</a>");
}
}
$pages_str .= ($page < $pgs - 5 ? " ..." : "");
$pages_str = ($page > 4 ? "<a href='?topic=" . (int)$row['id'] . "&konftop=" . htmlspecialchars($_GET['konftop']) . "&page=" . ($page - 1) . "'> &laquo; </a> ... " : "") . $pages_str . (($page < ($pgs - 1) ? "<a href='?topic=" . (int)$row['id'] . "&page=" . ($page + 1) . "' > &raquo; </a>" : ""));
}
$FirstPage = (ceil($pgs) > 4 ? $_GET['page'] > 0 ? "<a href='?topic=" . (int)$row['id'] . "&konftop=" . htmlspecialchars($_GET['konftop']) . "&page=0'> Первая </a>" : "" : "");
$LastPage = (ceil($pgs) > 4 ? (ceil($pgs) - 1) != $_GET['page'] ? "<a href='?topic=" . (int)$row['id'] . "&konftop=" . htmlspecialchars($_GET['konftop']) . "&page=" . (ceil($pgs) - 1) . "'> Последняя </a>" : "" : "");
$pages_str = $FirstPage . $pages_str . $LastPage;
echo $pages_str;
?>
<div id="leaf<?= $row['id'] ?>"
style="background-color: #ddd;margin: 2px;padding:5px;overflow-x: auto;word-wrap: break-word;box-shadow: 1px 2px 3px #ccc;">
<span class="topicTitle">
<img src="i/forum/icon<?= $icons ?>.gif"> <?= $row['topic'] ?>
</span>
<div class="auth_str">
<?= $row['author'] ?><span class="date">(<?= $row['date'] ?>)</span>
<a href='#' class='cite' onclick="add_cites(<?= $row['id'] ?>);" title="Цитата">
<small>Цитировать</small>
</a>
<?php if ($isAdmin): ?>
| <a href="javascript:void(0);" class="contact" id="<?= $row['id'] ?>">
<small>Редактировать</small>
<div class="auth_str">
<?= $row['author'] ?><span class="date">(<?= $row['date'] ?>)</span>
<a href='#' class='cite' onclick="add_cites(<?= $row['id'] ?>);" title="Цитата">
<small>Цитировать</small>
</a>
<?php endif; ?>
<?php if ($isAdmin): ?>
| <a href="javascript:void(0);" class="contact" id="<?= $row['id'] ?>">
<small>Редактировать</small>
</a>
<?php endif; ?>
<?php if ($isModerator AND (isset($_GET['conf']) OR isset($_GET['page']))): ?>
<a href="?topic=<?= $_GET['topic'] ?>&konftop=<?= htmlspecialchars($_GET['conf']) ?>&page=<?= $_GET['page'] ?>&dp=<?= $row['id'] ?>">
<small>Удалить</small>
</a> |
<a onclick="let obj; if (obj = prompt('Введите комментарий','')) { window.location='forum.php?topic=<?= $_GET['topic'] ?>&konftop=<?= htmlspecialchars($_GET['conf']) ?>&page=<?= $_GET['page'] ?>&cpr='+obj+'&com=<?= $row['id'] ?>'; }"
href='#'>
<small>Комментарий</small>
</a>
<?php endif; ?>
<br>
<br>
</div>
<span><?= $row['text'] ?></span>
</div>
<?php
if (empty($_GET['page'])) $_GET['page'] = "";
$data = db::c()->query('SELECT * FROM `forum` WHERE `parent` = "?s" ORDER BY `id` ASC LIMIT ?i,20', $_GET['topic'], ($_GET['page'] * 20));
while ($row = $data->fetch_assoc()): ?>
<div id="leaf<?= $row['id'] ?>"
style="background-color: #ddd;margin: 2px;padding:5px;overflow-x: auto;word-wrap: break-word;box-shadow: 1px 2px 3px #ccc;">
<div class="mesTopBar">
<table width="100%">
<tr>
<td>
<?= $row['author'] ?> <span class="date">(<?= $row['date'] ?>)</span>
<?php if ($isModerator AND isset($_GET['conf']) AND isset($_GET['page'])): ?>
<a href="?topic=<?= $_GET['topic'] ?>&konftop=<?= htmlspecialchars($_GET['conf']) ?>&page=<?= $_GET['page'] ?>&dp=<?= $row['id'] ?>">
<small>Удалить</small>
</a>
<a onclick="let obj; if (obj = prompt('Введите комментарий','')) { window.location='forum.php?topic=<?= $_GET['topic'] ?>&konftop=<?= htmlspecialchars($_GET['conf']) ?>&page=<?= $_GET['page'] ?>&cpr='+obj+'&com=<?= $row['id'] ?>'; }"
href='#'>
|
<small>Комментарий</small>
</a>
<?php endif; ?>
</td>
<td align="right">
<a href="javascript:void(0);" class="quote_btn"
onclick="return add_cites(<?= $row['id'] ?>);" title="Цитата">
<small>Цитировать</small>
</a>
<?php if ($isAdmin): ?>
<a href="javascript:void(0);" class="contact"
id="<?= $row['id'] ?>">
<small>Редактировать</small>
</a>
<?php endif; ?>
</td>
</tr>
</table>
<?php if ($isModerator and (isset($_GET['conf']) or isset($_GET['page']))): ?>
<a href="?topic=<?= $_GET['topic'] ?>&konftop=<?= htmlspecialchars($_GET['conf']) ?>&page=<?= $_GET['page'] ?>&dp=<?= $row['id'] ?>">
<small>Удалить</small>
</a> |
<a onclick="let obj; if (obj = prompt('Введите комментарий','')) { window.location='forum.php?topic=<?= $_GET['topic'] ?>&konftop=<?= htmlspecialchars($_GET['conf']) ?>&page=<?= $_GET['page'] ?>&cpr='+obj+'&com=<?= $row['id'] ?>'; }"
href='#'>
<small>Комментарий</small>
</a>
<?php endif; ?>
<br>
<br>
</div>
<span><?= $row['text'] ?></span>
</div>
<?php
endwhile;
if ($pgs > 1) {
echo "<img src=i/ico/news.gif> Страницы: ";
}
echo $pages_str;
<?php
if (empty($_GET['page'])) $_GET['page'] = "";
$data = db::c()->query('SELECT * FROM `forum` WHERE `parent` = "?s" ORDER BY `id` ASC LIMIT ?i,20', $_GET['topic'], ($_GET['page'] * 20));
while ($row = $data->fetch_assoc()): ?>
<div id="leaf<?= $row['id'] ?>"
style="background-color: #ddd;margin: 2px;padding:5px;overflow-x: auto;word-wrap: break-word;box-shadow: 1px 2px 3px #ccc;">
<div class="mesTopBar">
<table width="100%">
<tr>
<td>
<?= $row['author'] ?> <span
class="date">(<?= $row['date'] ?>)</span>
<?php if ($isModerator and isset($_GET['conf']) and isset($_GET['page'])): ?>
<a href="?topic=<?= $_GET['topic'] ?>&konftop=<?= htmlspecialchars($_GET['conf']) ?>&page=<?= $_GET['page'] ?>&dp=<?= $row['id'] ?>">
<small>Удалить</small>
</a>
<a onclick="let obj; if (obj = prompt('Введите комментарий','')) { window.location='forum.php?topic=<?= $_GET['topic'] ?>&konftop=<?= htmlspecialchars($_GET['conf']) ?>&page=<?= $_GET['page'] ?>&cpr='+obj+'&com=<?= $row['id'] ?>'; }"
href='#'>
|
<small>Комментарий</small>
</a>
<?php endif; ?>
</td>
<td align="right">
<a href="javascript:void(0);" class="quote_btn"
onclick="return add_cites(<?= $row['id'] ?>);" title="Цитата">
<small>Цитировать</small>
</a>
<?php if ($isAdmin): ?>
<a href="javascript:void(0);" class="contact"
id="<?= $row['id'] ?>">
<small>Редактировать</small>
</a>
<?php endif; ?>
</td>
</tr>
</table>
</div>
<span><?= $row['text'] ?></span>
</div>
<?php
endwhile;
if ($pgs > 1) {
echo "<img src=i/ico/news.gif> Страницы: ";
}
echo $pages_str;
if ($closed == 1) {
echo "<br /><div align=center>" . $closepal . "</div><br /><br />";
} else {
if (!empty($user['block'])) {
$error = "Вы заблокированы!";
} elseif ($user['level'] < 2) {
$error = "Персонажам до 2-го уровня запрещено писать на форуме!";
} elseif (isset($sleep['id'])) {
$error = "Вы молчите!";
if ($closed == 1) {
echo "<br /><div align=center>" . $closepal . "</div><br /><br />";
} else {
?>
<a name="add_comment_place"></a>
<form method=POST
action="forum.php?topic=<?= $_GET['topic'] ?>&konftop=<?= $_GET['conf'] ?>&page=<?= $_GET['page'] ?>"
name="F1">
if (!empty($user['block'])) {
$error = "Вы заблокированы!";
} elseif ($user['level'] < 2) {
$error = "Персонажам до 2-го уровня запрещено писать на форуме!";
} elseif (isset($sleep['id'])) {
$error = "Вы молчите!";
} else {
?>
<a name="add_comment_place"></a>
<form method=POST
action="forum.php?topic=<?= $_GET['topic'] ?>&konftop=<?= $_GET['conf'] ?>&page=<?= $_GET['page'] ?>"
name="F1">
<table bgcolor="F6E5B1" cellpadding="5" style="border: 1px outset;">
<tr>
<td colspan="2">
<h4 id="response">Оставить комментарий</h4>
</td>
</tr>
<tr>
<td colspan="2">
<table bgcolor="F6E5B1" cellpadding="5" style="border: 1px outset;">
<tr>
<td colspan="2">
<h4 id="response">Оставить комментарий</h4>
</td>
</tr>
<tr>
<td colspan="2">
<textarea class="inup" id="answer" rows="12" name="text"
cols="84" wrap="virtual"
onselect="storeCaret(this);"
onclick="storeCaret(this);"
onkeyup="storeCaret(this);"
onchange="storeCaret(this);"></textarea>
</td>
</tr>
<tr>
<td align="right">
<input type="submit" class="btn" value="Добавить" name="add2">
<div class="page" id="<?= $ps; ?>" style="display: none;"></div>
</td>
</tr>
</table>
<input type="hidden" value="index" name="n"/>
<input type="hidden" value="73991290635595" name="id"/>
<input type="hidden" value="add_com" name="act"/>
<input type="hidden" id="key_person_line" name="key_person_line"
value="1290639545#1227576496"/>
<input type="hidden" id="set_person_line" name="set_person_line"
value="9c84c2b3d7e44a2b82928fd840ec97d7"/>
</form>
<?
}
}
} else echo "Тема удалена с форума, либо её не существует.<br>";
}
} else {
if (is_numeric($_GET['conf']) && $row = db::c()->query('SELECT * FROM `forum` WHERE `id` = ?i', $_GET['conf'])->fetch_assoc()) {
if (($row['min_align'] == 0 && $row['max_align'] == 0) || ($user['align'] >= $row['min_align'] && $user['align'] <= $row['max_align']) || $isAdmin) {
$confname = 'Конференция «' . $row['topic'] . '»';
$pgs = db::c()->query('SELECT count(`id`) FROM `forum` WHERE `parent` = ?i ORDER BY `fix` DESC, `updated` DESC', $_GET['conf'])->fetch_row();
$pgs = $pgs[0] / 20;
$pages_str = '';
if (empty($_GET['page'])) $_GET['page'] = 0;
$page = (int)$_GET['page'] ? (((int)$_GET['page'] + 1) > $pgs ? ($pgs - 1) : (int)$_GET['page']) : 0;
$page = ceil($page);
?>
<td rowspan="2" style="padding-left: 10px">
<h3><?= $confname ?></h3>
<?php
if (isset($error)) err($error);
if (empty($row['parent'])) echo $row['text'];
if ($pgs > 1) {
for ($i = 0; $i < ceil($pgs); $i++) {
if (($i > ($page - 5)) && ($i <= ($page + 4))) {
$pages_str .= ($i == $page ? " <b>" . ($i + 1) . "</b>" : " <a href='?conf=" . $_GET['conf'] . "&konftop=" . htmlspecialchars($_GET['conf']) . "&page=" . ($i) . "'>" . ($i + 1) . "</a>");
}
}
$pages_str .= ($page < $pgs - 5 ? " ..." : "");
$pages_str = ($page > 4 ? "<a href='?conf=" . $_GET['conf'] . "&konftop=" . htmlspecialchars($_GET['conf']) . "&page=" . ($page - 1) . "'> &laquo; </a> ... " : "") . $pages_str . (($page < ($pgs - 1) ? "<a href='?conf=" . $_GET['conf'] . "&page=" . ($page + 1) . "' > &raquo;</a>" : ""));
?>
<div style="width: 100%; margin: 5px;">
<img src="i/ico/news.gif" width="16" height="16"/> Страницы:<?= $pages_str ?>
</div>
<?php
}
$FirstPage = (ceil($pgs) > 4 ? $_GET['page'] > 0 ? "<a href='?conf=" . $_GET['conf'] . "&konftop=" . htmlspecialchars($_GET['conf']) . "&page=0'> Первая </a>" : "" : "");
$LastPage = (ceil($pgs) > 4 ? (ceil($pgs) - 1) != $_GET['page'] ? "<a href='?conf=" . $_GET['conf'] . "&konftop=" . htmlspecialchars($_GET['conf']) . "&page=" . (ceil($pgs) - 1) . "'> Последняя </a>" : "" : "");
$pages_str = $FirstPage . $pages_str . $LastPage;
if (!empty($_GET['conf'])) {
if (empty($_GET['page'])) $_GET['page'] = 0;
$data = db::c()->query('SELECT * FROM `forum` WHERE `parent` = "?s" ORDER BY `fix` DESC, `updated` DESC LIMIT ?i,20', $_GET['conf'], ($_GET['page'] * 20));
while ($row = $data->fetch_assoc()) {
$logi = '';
$userlist = '';
$icons = $row['icon'];
$data2 = db::c()->query('SELECT `author` FROM (SELECT `author`,`id` FROM `forum` WHERE `parent` = ?i ORDER BY `id` DESC LIMIT 10) AS sTable ORDER BY id DESC', $row['id']);
while ($row2 = $data2->fetch_row()) {
$userlist = strip_tags($row2[0], "");
[$username, $level] = split(" \[", $userlist);
$logi .= $username;
}
$datacount = db::c()->query('SELECT count(*) AS CountNumber FROM `forum` WHERE `parent` = ?i', $row['id'])->fetch_assoc();
$count = $datacount["CountNumber"];
$lasttimedb = db::c()->query('SELECT `date` FROM `forum` WHERE `parent` = ?i ORDER BY `id` DESC', $row['id'])->fetch_assoc();
$lasttime = $lasttimedb['date'];
echo "<div class=\"mBodyBlock rounded rc6\" style='background-color: #ddd;margin: 2px;overflow-x: auto;word-wrap: break-word; box-shadow: 1px 2px 3px #ccc'>
<p class=pleft>" . ($row['fix'] ? "📌 " : "") . "<a href='?topic=" . $row['id'];
if (isset($_GET['conf'])) echo "&konftop=" . $_GET['conf'];
$pgs1 = db::c()->query('SELECT count(`id`) FROM `forum` WHERE `parent` = ?i', $row['id'])->fetch_assoc();
$pgs1 = $pgs1[0] / 20;
$pages_str1 = '';
$page1 = (int)$_GET['page'] > 0 ? (((int)$_GET['page'] + 1) > $pgs ? ($pgs - 1) : (int)$_GET['page']) : 0;
$page1 = ceil($page1);
if ($pgs1 > 1) {
for ($i = 0; $i < ceil($pgs1); $i++)
if (($i > ($page1 - 5)) && ($i <= ($page1 + 4)))
$pages_str1 .= ($i == $page1 ? "<b>" . ($i + 1) . "</b>" : "<a href='?topic=" . $row['id'] . "&konftop=" . htmlspecialchars($_GET['conf']) . "&page=" . ($i) . "'>" . ($i + 1) . "</a>");
$pages_str1 .= ($page1 < $pgs1 - 5 ? " ..." : "");
}
if ($pgs1 > 1) {
$pages_str1 = "<nobr><img src=\"i/forum/p.gif\" width=\"10\" height=\"12\" /><small class=pages><span class=pagenum>" . $pages_str1 . "</span></small></nobr>";
}
echo "'><IMG height=15 src=\"i/forum/icon{$icons}.gif\" width=15 border=0> {$row['topic']}</a> " . $pages_str1 . "<nobr>&nbsp;{$row['author']}</nobr>";
if ($isModerator) echo " <a href='?conf={$_GET['conf']}&dt={$row['id']}'><small>Удалить</small></a>";
echo "<br /><span class=date>" . $row['date'] . "</span><span class=dsc> " . strip_tags(substr($row['text'], 0, 250), "") . "</span>
<br /><small>Ответов: <b>" . $count . "</b> <span title=\"Последний ответ: " . $logi . "\" style=\"border-bottom:1px dashed grey;cursor:help;font-size:10px;\">(" . $lasttime . ")</span></small>
</p></div>";
}
}
if ($pgs > 1) echo "<p><img src=i/ico/news.gif width=\"16\" height=\"16\" /> Страницы:";
echo $pages_str . "</p>";
if (!empty($user['block'])) {
$error = "Вы заблокированы!";
} elseif ($user['level'] < 2) {
$error = "Персонажам до 2-го уровня запрещено писать на форуме!";
} elseif (isset($sleep['id'])) {
$error = "Вы молчите!";
} else {
?>
<a name="answer"></a>
<br/>
<form method=POST action="forum.php?conf=<?= $_GET['conf'] ?>" name="F1">
<table bgcolor="F6E5B1" width="100%" cellspacing="0" cellpadding="2"
style="border: 1px outset;">
<tr>
<td align=center>
<table>
<tr>
<td colspan="2">
<h4>Добавить свой вопрос в форум</h4>
<input type="text" class="inup" name="title" size="57" maxlength="65"
placeholder="Тема сообщения">
</td>
</tr>
<tr>
<td align="right">
<input type="submit" class="btn" value="Добавить" name="add2">
<div class="page" id="<?= $ps; ?>" style="display: none;"></div>
</td>
</tr>
</table>
<input type="hidden" value="index" name="n"/>
<input type="hidden" value="73991290635595" name="id"/>
<input type="hidden" value="add_com" name="act"/>
<input type="hidden" id="key_person_line" name="key_person_line"
value="1290639545#1227576496"/>
<input type="hidden" id="set_person_line" name="set_person_line"
value="9c84c2b3d7e44a2b82928fd840ec97d7"/>
</form>
<?
}
}
} else echo "Тема удалена с форума, либо её не существует.<br>";
}
} else {
if (is_numeric($_GET['conf']) && $row = db::c()->query('SELECT * FROM `forum` WHERE `id` = ?i', $_GET['conf'])->fetch_assoc()) {
if (($row['min_align'] == 0 && $row['max_align'] == 0) || ($user['align'] >= $row['min_align'] && $user['align'] <= $row['max_align']) || $isAdmin) {
$confname = 'Конференция «' . $row['topic'] . '»';
$pgs = db::c()->query('SELECT count(`id`) FROM `forum` WHERE `parent` = ?i ORDER BY `fix` DESC, `updated` DESC', $_GET['conf'])->fetch_row();
$pgs = $pgs[0] / 20;
$pages_str = '';
if (empty($_GET['page'])) $_GET['page'] = 0;
$page = (int)$_GET['page'] ? (((int)$_GET['page'] + 1) > $pgs ? ($pgs - 1) : (int)$_GET['page']) : 0;
$page = ceil($page);
?>
<td rowspan="2" style="padding-left: 10px">
<h3><?= $confname ?></h3>
<?php
if (isset($error)) err($error);
if (empty($row['parent'])) echo $row['text'];
if ($pgs > 1) {
for ($i = 0; $i < ceil($pgs); $i++) {
if (($i > ($page - 5)) && ($i <= ($page + 4))) {
$pages_str .= ($i == $page ? " <b>" . ($i + 1) . "</b>" : " <a href='?conf=" . $_GET['conf'] . "&konftop=" . htmlspecialchars($_GET['conf']) . "&page=" . ($i) . "'>" . ($i + 1) . "</a>");
}
}
$pages_str .= ($page < $pgs - 5 ? " ..." : "");
$pages_str = ($page > 4 ? "<a href='?conf=" . $_GET['conf'] . "&konftop=" . htmlspecialchars($_GET['conf']) . "&page=" . ($page - 1) . "'> &laquo; </a> ... " : "") . $pages_str . (($page < ($pgs - 1) ? "<a href='?conf=" . $_GET['conf'] . "&page=" . ($page + 1) . "' > &raquo;</a>" : ""));
?>
<div style="width: 100%; margin: 5px;">
<img src="i/ico/news.gif" width="16" height="16"/> Страницы:<?= $pages_str ?>
</div>
<?php
}
$FirstPage = (ceil($pgs) > 4 ? $_GET['page'] > 0 ? "<a href='?conf=" . $_GET['conf'] . "&konftop=" . htmlspecialchars($_GET['conf']) . "&page=0'> Первая </a>" : "" : "");
$LastPage = (ceil($pgs) > 4 ? (ceil($pgs) - 1) != $_GET['page'] ? "<a href='?conf=" . $_GET['conf'] . "&konftop=" . htmlspecialchars($_GET['conf']) . "&page=" . (ceil($pgs) - 1) . "'> Последняя </a>" : "" : "");
$pages_str = $FirstPage . $pages_str . $LastPage;
if (!empty($_GET['conf'])) {
if (empty($_GET['page'])) $_GET['page'] = 0;
$data = db::c()->query('SELECT * FROM `forum` WHERE `parent` = "?s" ORDER BY `fix` DESC, `updated` DESC LIMIT ?i,20', $_GET['conf'], ($_GET['page'] * 20));
while ($row = $data->fetch_assoc()) {
$logi = '';
$userlist = '';
$icons = $row['icon'];
$data2 = db::c()->query('SELECT `author` FROM (SELECT `author`,`id` FROM `forum` WHERE `parent` = ?i ORDER BY `id` DESC LIMIT 10) AS sTable ORDER BY id DESC', $row['id']);
while ($row2 = $data2->fetch_row()) {
$userlist = strip_tags($row2[0], "");
[$username, $level] = split(" \[", $userlist);
$logi .= $username;
}
$datacount = db::c()->query('SELECT count(*) AS CountNumber FROM `forum` WHERE `parent` = ?i', $row['id'])->fetch_assoc();
$count = $datacount["CountNumber"];
$lasttimedb = db::c()->query('SELECT `date` FROM `forum` WHERE `parent` = ?i ORDER BY `id` DESC', $row['id'])->fetch_assoc();
$lasttime = $lasttimedb['date'];
echo "<div class=\"mBodyBlock rounded rc6\" style='background-color: #ddd;margin: 2px;overflow-x: auto;word-wrap: break-word; box-shadow: 1px 2px 3px #ccc'>
<p class=pleft>" . ($row['fix'] ? "📌 " : "") . "<a href='?topic=" . $row['id'];
if (isset($_GET['conf'])) echo "&konftop=" . $_GET['conf'];
$pgs1 = db::c()->query('SELECT count(`id`) FROM `forum` WHERE `parent` = ?i', $row['id'])->fetch_assoc();
$pgs1 = $pgs1[0] / 20;
$pages_str1 = '';
$page1 = (int)$_GET['page'] > 0 ? (((int)$_GET['page'] + 1) > $pgs ? ($pgs - 1) : (int)$_GET['page']) : 0;
$page1 = ceil($page1);
if ($pgs1 > 1) {
for ($i = 0; $i < ceil($pgs1); $i++)
if (($i > ($page1 - 5)) && ($i <= ($page1 + 4)))
$pages_str1 .= ($i == $page1 ? "<b>" . ($i + 1) . "</b>" : "<a href='?topic=" . $row['id'] . "&konftop=" . htmlspecialchars($_GET['conf']) . "&page=" . ($i) . "'>" . ($i + 1) . "</a>");
$pages_str1 .= ($page1 < $pgs1 - 5 ? " ..." : "");
}
if ($pgs1 > 1) {
$pages_str1 = "<nobr><img src=\"i/forum/p.gif\" width=\"10\" height=\"12\" /><small class=pages><span class=pagenum>" . $pages_str1 . "</span></small></nobr>";
}
echo "'><IMG height=15 src=\"i/forum/icon{$icons}.gif\" width=15 border=0> {$row['topic']}</a> " . $pages_str1 . "<nobr>&nbsp;{$row['author']}</nobr>";
if ($isModerator) echo " <a href='?conf={$_GET['conf']}&dt={$row['id']}'><small>Удалить</small></a>";
echo "<br /><span class=date>" . $row['date'] . "</span><span class=dsc> " . strip_tags(substr($row['text'], 0, 250), "") . "</span>
<br /><small>Ответов: <b>" . $count . "</b> <span title=\"Последний ответ: " . $logi . "\" style=\"border-bottom:1px dashed grey;cursor:help;font-size:10px;\">(" . $lasttime . ")</span></small>
</p></div>";
}
}
if ($pgs > 1) echo "<p><img src=i/ico/news.gif width=\"16\" height=\"16\" /> Страницы:";
echo $pages_str . "</p>";
if (!empty($user['block'])) {
$error = "Вы заблокированы!";
} elseif ($user['level'] < 2) {
$error = "Персонажам до 2-го уровня запрещено писать на форуме!";
} elseif (isset($sleep['id'])) {
$error = "Вы молчите!";
} else {
?>
<a name="answer"></a>
<br/>
<form method=POST action="forum.php?conf=<?= $_GET['conf'] ?>" name="F1">
<table bgcolor="F6E5B1" width="100%" cellspacing="0" cellpadding="2"
style="border: 1px outset;">
<tr>
<td align=center>
<table>
<tr>
<td colspan="2">
<h4>Добавить свой вопрос в форум</h4>
<input type="text" class="inup" name="title" size="57" maxlength="65"
placeholder="Тема сообщения">
</td>
</tr>
<tr>
<td>
<td>
<textarea rows="8" class="inup" id="message" name="text" cols="85"
wrap="virtual"
onselect="storeCaret(this);"
@ -679,48 +543,50 @@ if (isset($_GET['do']) && $isModerator == true) {
onkeyup="storeCaret(this);"
onchange="storeCaret(this);"
placeholder="Введите сообщение..."></textarea>
<input type=hidden value=0 name=n>
<input type=hidden value=1025804759 name=id>
<input type=hidden name=redirect>
</td>
</tr>
<tr>
<td colspan="2">
<table width="100%">
<tr>
<td>
<input type="hidden" name="icon" value="13">
</td>
<td align="right">
<input type="submit" class="btn" value="Добавить" name="add"/>
<input type="hidden" name="n" value="klans">
<input type="hidden" id="act" name="act" value="add_branch"/>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<?
}
}
} else echo ' <div style="width: 300px; margin: auto; font-weight: bold;">Ничего не найдено!</div> ';
}
?>
<!-- End of text -->
</td>
</tr>
</table>
<input type=hidden value=0 name=n>
<input type=hidden value=1025804759 name=id>
<input type=hidden name=redirect>
</td>
</tr>
<tr>
<td colspan="2">
<table width="100%">
<tr>
<td>
<input type="hidden" name="icon" value="13">
</td>
<td align="right">
<input type="submit" class="btn" value="Добавить"
name="add"/>
<input type="hidden" name="n" value="klans">
<input type="hidden" id="act" name="act"
value="add_branch"/>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<?
}
}
} else {
echo ' <div style="width: 300px; margin: auto; font-weight: bold;">Ничего не найдено!</div> ';
}
}
?>
<!-- End of text -->
</td>
</tr>
</table>
<?php if ($isModerator == true): ?>
<form name='repltopic' method='post'>
<input type='hidden' id='selectt' name='selectt'/>
<input type='hidden' id='numt' name='numt'/>
</form>
<? endif; ?>
</body>
</html>
<? endif; ?>

View File

@ -145,8 +145,6 @@ function takeshopitem($item, $table = "shop", $present = '', $onlyonetrip = '',
define('_BOTSEPARATOR_', 10000000);
header("Cache-Control: no-cache");
function level_up($uid)
{
$us = db::c()->query('SELECT `id`, `login`, `level`, `money`, `exp`, `nextup`, `stats`, `master`, `ip`, `in_tower` FROM `users` WHERE `id` =?i', $uid)->fetch_assoc();

105
game.php
View File

@ -6,73 +6,66 @@
*/
session_start();
if (!isset($_SESSION['uid'])) header("Location: index.php");
if (empty($_SESSION['uid'])) header("Location: index.php");
//include("config.php");
//$msg = filter_input(INPUT_POST,'msg');
//$uid = $_SESSION['uid'];
//if ($msg) db::c()->query('INSERT INTO `chat` (`cid`, `uid`, `msg`) VALUES (?i, ?i, "?s")', 1, $uid, $msg);
Template::header('Окно игры');
?>
<!doctype html>
<html>
<head>
<title>Окно игры</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/main.css">
<style>
form {
width: 100%;
text-align: center;
}
<style>
form {
width: 100%;
text-align: center;
}
form input {
border: 1px solid silver;
width: 80%;
margin-right: .5%;
}
form input {
border: 1px solid silver;
width: 80%;
margin-right: .5%;
}
form input[type="submit"] {
width: 15%;
}
form input[type="submit"] {
width: 15%;
}
body {
margin: 0;
}
body {
margin: 0;
}
.wrap {
display: grid;
height: 100vh;
grid-template-rows: 45px /* Шапка */ 2fr /* Окно игры */ 1fr /* Окно чата*/ 30px; /* Подвал */
}
.wrap {
display: grid;
height: 100vh;
grid-template-rows: 45px /* Шапка */ 2fr /* Окно игры */ 1fr /* Окно чата*/ 30px; /* Подвал */
}
header {
text-align: right;
box-shadow: 0 3px 2px -2px slategray;
}
header {
text-align: right;
box-shadow: 0 3px 2px -2px slategray;
}
footer {
margin: 5px;
}
footer {
margin: 5px;
}
#game, #chat {
overflow: auto;
box-shadow: 0 3px 2px -2px slategray;
padding: 5px;
}
#game, #chat {
overflow: auto;
box-shadow: 0 3px 2px -2px slategray;
padding: 5px;
}
a img {
border: 1px solid #fff;
transition: box-shadow 0.5s ease;
margin: 5px;
}
a img {
border: 1px solid #fff;
transition: box-shadow 0.5s ease;
margin: 5px;
}
a img:hover {
box-shadow: 0 0 7px slategray;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
a img:hover {
box-shadow: 0 0 7px slategray;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="wrap">
<header>
<a href="/user_anketa.php" title="Анкета" target="main"><img src="http://placehold.it/32x32/33ff33?text=A"/></a>
@ -98,14 +91,12 @@ if (!isset($_SESSION['uid'])) header("Location: index.php");
<script>
$("#game").load("main.php");
function loadlink(){
function loadlink() {
$('#chat').load('chat.php');
}
loadlink(); // This will run on page load
setInterval(function(){
setInterval(function () {
loadlink() // this will run after every 5 seconds
}, 5000);
</script>
</body>
</html>
</script>

231
game2.php
View File

@ -6,129 +6,132 @@
*/
session_start();
if (!isset($_SESSION['uid'])) header("Location: index.php");
if (empty($_SESSION['uid'])) header("Location: index.php");
//include("config.php");
//$msg = filter_input(INPUT_POST,'msg');
//$uid = $_SESSION['uid'];
//if ($msg) db::c()->query('INSERT INTO `chat` (`cid`, `uid`, `msg`) VALUES (?i, ?i, "?s")', 1, $uid, $msg);
Template::header('Окно игры');
?>
<!doctype html>
<html>
<head>
<title>Окно игры</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/main.css">
<style>
form {
width: 100%;
text-align: center;
}
<style>
form {
width: 100%;
text-align: center;
}
form input {
border: 1px solid silver;
width: 80%;
margin-right: .5%;
}
form input {
border: 1px solid silver;
width: 80%;
margin-right: .5%;
}
form input[type="submit"] {
width: 15%;
}
form input[type="submit"] {
width: 15%;
}
body {
margin: 0;
}
body {
margin: 0;
}
.wrap {
display: grid;
height: 100vh;
grid-template-rows: 45px /* Шапка */ 2fr /* Окно игры */ 1fr /* Окно чата*/ 30px; /* Подвал */
}
.wrap {
display: grid;
height: 100vh;
grid-template-rows: 45px /* Шапка */ 2fr /* Окно игры */ 1fr /* Окно чата*/ 30px; /* Подвал */
}
header {
text-align: right;
box-shadow: 0 3px 2px -2px slategray;
}
header {
text-align: right;
box-shadow: 0 3px 2px -2px slategray;
}
footer {
margin: 5px;
}
footer {
margin: 5px;
}
#game, #chat {
overflow: auto;
box-shadow: 0 3px 2px -2px slategray;
padding: 5px;
}
#game, #chat {
overflow: auto;
box-shadow: 0 3px 2px -2px slategray;
padding: 5px;
}
a img {
border: 1px solid #fff;
transition: box-shadow 0.5s ease;
margin: 5px;
}
a img {
border: 1px solid #fff;
transition: box-shadow 0.5s ease;
margin: 5px;
}
a img:hover {
box-shadow: 0 0 7px slategray;
}
a img:hover {
box-shadow: 0 0 7px slategray;
}
.chat {
border:1px solid #333;
margin:15px;
width:40%;
height:70%;
background:#555;
color:#fff;
}
.chat-messages {
min-height:93%;
max-height:93%;
overflow:auto;
}
.chat-messages__content {
padding:1px;
}
.chat__message {
border-left:3px solid #333;
margin-top:2px;
padding:2px;
}
.chat__message_black {
border-color:#000;
}
.chat__message_blue {
border-color:blue;
}
.chat__message_green {
border-color:green;
}
.chat__message_red {
border-color:red;
}
.chat-input {
min-height:6%;
}
input {
font-family:arial;
font-size:16px;
vertical-align:middle;
background:#333;
color:#fff;
border:0;
display:inline-block;
margin:1px;
height:30px;
}
.chat-form__input {
width:79%;
}
.chat-form__submit {
width:18%;
}
.chat {
border: 1px solid #333;
margin: 15px;
width: 40%;
height: 70%;
background: #555;
color: #fff;
}
</style>
.chat-messages {
min-height: 93%;
max-height: 93%;
overflow: auto;
}
</head>
<body>
.chat-messages__content {
padding: 1px;
}
.chat__message {
border-left: 3px solid #333;
margin-top: 2px;
padding: 2px;
}
.chat__message_black {
border-color: #000;
}
.chat__message_blue {
border-color: blue;
}
.chat__message_green {
border-color: green;
}
.chat__message_red {
border-color: red;
}
.chat-input {
min-height: 6%;
}
input {
font-family: arial;
font-size: 16px;
vertical-align: middle;
background: #333;
color: #fff;
border: 0;
display: inline-block;
margin: 1px;
height: 30px;
}
.chat-form__input {
width: 79%;
}
.chat-form__submit {
width: 18%;
}
</style>
<div class="wrap">
<header>
Всякие заголовки, кнопки, ссылки, etc...
@ -143,7 +146,9 @@ if (!isset($_SESSION['uid'])) header("Location: index.php");
</div>
<div class='chat-input'>
<form method='post' id='chat-form'>
<input id='message-text' class='chat-form__input' placeholder='Введите сообщение'> <input type='submit' class='chat-form__submit' value='=>'>
<input id='message-text' class='chat-form__input' placeholder='Введите сообщение'> <input type='submit'
class='chat-form__submit'
value='=>'>
</form>
</div>
</div>
@ -165,22 +170,22 @@ if (!isset($_SESSION['uid'])) header("Location: index.php");
//Переменные, которые будут отправляться
var var1 = null;
var var2 = null;
if(act == 'auth') {
if (act == 'auth') {
//Если нужно авторизоваться, получаем логин и пароль, которые были переданы в функцию
var1 = login;
var2 = password;
} else if(act == 'send') {
} else if (act == 'send') {
//Если нужно отправить сообщение, то получаем текст из поля ввода
var1 = messageInput.value;
}
$.post('includes/chat.php',{ //Отправляем переменные
$.post('includes/chat.php', { //Отправляем переменные
act: act,
var1: var1,
var2: var2
}).done(function (data) {
//Заносим в контейнер ответ от сервера
messages__container.innerHTML = data;
if(act == 'send') {
if (act == 'send') {
//Если нужно было отправить сообщение, очищаем поле ввода
messageInput.value = '';
}
@ -190,14 +195,12 @@ if (!isset($_SESSION['uid'])) header("Location: index.php");
function update() {
send_request('load');
}
interval = setInterval(update,500);
interval = setInterval(update, 500);
//отлавливается событие отправки формы — это поможет отказаться от обновления страницы:
sendForm.onsubmit = function () {
send_request('send');
return false; //Возвращаем ложь, чтобы остановить классическую отправку формы
};
</script>
</body>
</html>
</script>

View File

@ -3,30 +3,46 @@
* */
session_start();
define("CASTLE_MAX_LEVEL", 10);
if ($_SESSION['uid'] == null) header("Location: index.php");
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
require_once 'functions.php';
if (!($user['room'] >= 37 AND $user['room'] <= 41)) {
if (!($user->room >= 37 && $user->room <= 41)) {
header("Location: main.php");
die();
exit;
}
$castleOwners = db::c()->query('SELECT * FROM `clans` WHERE `short` = (SELECT * FROM `variables` WHERE `var` = "?s")', 'gotzamok');
if ($castleOwners['id'] == $user['klan']) {
// если мой клан
if ($_GET['goto'] == 'arsenal') $user['room'] = 38;
if ($_GET['goto'] == 'home') $user['room'] = 37;
if ($_GET['goto'] == 'dvor') $user['room'] = 39;
if ($_GET['goto'] == 'master') $user['room'] = 40;
if ($_GET['goto'] == 'rest') $user['room'] = 41;
if ($_GET['goto'] == 'arsenal') {
$user->room = 38;
}
if ($_GET['goto'] == 'home') {
$user->room = 37;
}
if ($_GET['goto'] == 'dvor') {
$user->room = 39;
}
if ($_GET['goto'] == 'master') {
$user->room = 40;
}
if ($_GET['goto'] == 'rest') {
$user->room = 41;
}
if (in_array($_GET['goto'], ['arsenal', 'home', 'dvor', 'master', 'rest'])) {
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = ?i,`online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $user['room'], $user['room'], $_SESSION['uid']);
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = ?i,`online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $user->room, $user->room, $_SESSION['uid']);
header('location: gotzamok.php');
} else $status = 'В этом замке нет такого места!';
} else {
$status = 'В этом замке нет такого места!';
}
}
switch ($user['room']) {
switch ($user->room) {
case '37' :
$backgroundImage = '689_small_550.jpg';
break;
@ -35,13 +51,13 @@ switch ($user['room']) {
break;
}
if ($user['room'] == 38) {
if ($user->room == 38) {
$glava = db::c()->query('SELECT `glava` FROM `clans` WHERE `short` = "?s"', $user['klan'])->fetch_assoc();
// возврат шмотки
if ($_GET['back']) {
$item = db::c()->query('SELECT * FROM `gotzam_arsenal` WHERE `id` = ?i', $_GET['back'])->fetch_assoc();
if ($_SESSION['uid'] == $item['owner'] OR $_SESSION['uid'] == $glava['glava']) {
if ($_SESSION['uid'] == $item['owner'] or $_SESSION['uid'] == $glava['glava']) {
$status = 'Вы забрали вещь из арсенала.';
db::c()->query('UPDATE `inventory` SET `owner` = ?i WHERE `id` = ?i', $_SESSION['uid'], $item['id_it']);
db::c()->query('DELETE FROM `gotzam_arsenal` WHERE `id` = ?i', $_GET['back']);
@ -59,7 +75,7 @@ if ($user['room'] == 38) {
}
}
if ($user['room'] == 40) {
if ($user->room == 40) {
$at = db::c()->query('SELECT * FROM `variables` WHERE `var` = "?s"', 'gotzam_att')->fetch_assoc();
$def = db::c()->query('SELECT * FROM `variables` WHERE `var` = "?s"', 'gotzam_def')->fetch_assoc();
@ -80,24 +96,20 @@ if ($user['room'] == 40) {
} else $status = 'Не хватает денег!';
}
}
Template::header('Клановый замок');
?>
<HTML>
<head>
<link rel=stylesheet href="css/main.css">
<script src="js/main.js"></script>
<meta charset="utf-8">
<style>
body {
background: url('i/<?= $backgroundImage ?>.jpg') no-repeat top right;
}
</style>
</head>
<body>
<h3>Приветствую тебя в замке <img src='i/clan/<?= $castleOwners['short'] ?>.gif'> <?= $castleOwners['name'] ?>, воин!</h3>
<div style="text-align: right;">
<button onClick="hrefToFrame('city.php?bps')">Вернуться</button>
</div>
<div><?php if (!empty($status)) err($status); ?></div>
<h3>Приветствую тебя в замке <img src='i/clan/<?= $castleOwners['short'] ?>.png'> <?= $castleOwners['name'] ?>,
воин!</h3>
<div style="text-align: right;">
<button onClick="hrefToFrame('city.php?bps')">Вернуться</button>
</div>
<div><?php if (!empty($status)) err($status); ?></div>
<?php
if ($castleOwners['id'] == $user['klan']) { ?>
@ -107,32 +119,32 @@ if ($castleOwners['id'] == $user['klan']) { ?>
<TD valign=top style="width:250px;">
<INPUT TYPE=button style="width:200px;" value="Перейти в приемную"
onClick="hrefToFrame('gotzamok.php?goto=home')">
<? if ($user['room'] == 37): ?>
<? if ($user->room == 37): ?>
<img src='i/flag.gif'>
<?php endif; ?><BR>
<INPUT TYPE=button style="width:200px;" value="Перейти в арсенал"
onClick="hrefToFrame('gotzamok.php?goto=arsenal')">
<? if ($user['room'] == 38): ?>
<? if ($user->room == 38): ?>
<img src='i/flag.gif'>
<?php endif; ?><BR>
<INPUT TYPE=button style="width:200px;" value="Перейти во внутренний двор"
onClick="hrefToFrame('gotzamok.php?goto=dvor')">
<? if ($user['room'] == 39): ?>
<? if ($user->room == 39): ?>
<img src='i/flag.gif'>
<?php endif; ?><BR>
<INPUT TYPE=button style="width:200px;" value="Перейти в мастерские"
onClick="hrefToFrame('gotzamok.php?goto=master')">
<? if ($user['room'] == 40): ?>
<? if ($user->room == 40): ?>
<img src='i/flag.gif'>
<?php endif; ?><BR>
<INPUT TYPE=button style="width:200px;" value="Перейти в опочивальни"
onClick="hrefToFrame('gotzamok.php?goto=rest')">
<? if ($user['room'] == 41): ?>
<? if ($user->room == 41): ?>
<img src='i/flag.gif'>
<?php endif; ?><BR>
</td>
<td valign=top>
<?php if ($user['room'] == 38): ?>
<?php if ($user->room == 38): ?>
<h4>Арсенал</h4>
<button onClick="hrefToFrame('gotzamok.php?do=zdat')">Сдать в арсенал</button>
<div style="background: silver; border: 1px solid dimgray;">
@ -149,12 +161,12 @@ if ($castleOwners['id'] == $user['klan']) { ?>
<BR>
<small>Положил: <?= Nick::id($item['owner'])->full(1) ?><BR></small>
<?php
if ($_SESSION['uid'] == $item['owner'] OR $_SESSION['uid'] == $glava['glava']): ?>
if ($_SESSION['uid'] == $item['owner'] or $_SESSION['uid'] == $glava['glava']): ?>
<A HREF="?back=<?= $item['id'] ?>">забрать</A><BR>
<?php else: $status = 'Вы не можете забрать эту вещь из арсенала.';
endif; ?>
</TD>
<TD valign=top> Тут был showitem($row); </TD>
<TD valign=top> Тут был showitem($row);</TD>
</TR>
<?php endwhile; ?>
</table>
@ -168,14 +180,14 @@ if ($castleOwners['id'] == $user['klan']) { ?>
<IMG SRC="i/sh/<?= $row['img'] ?>">
<BR><A HREF="?add=<?= $row['id'] ?>&sid=&sale=1">сдать в арсенал</A>
</TD>
<TD valign=top> Тут был showitem($row); </TD>
<TD valign=top> Тут был showitem($row);</TD>
</TR>
<?php endwhile; ?>
</table>
<?php
endif;
endif;
if ($user['room'] == 40): ?>
if ($user->room == 40): ?>
<h4>Мастерские</h4>
<div style="background: silver; border: 1px solid dimgray;">
Здесь вы можете улучшить оборонные способности вашего замка.
@ -192,7 +204,7 @@ if ($castleOwners['id'] == $user['klan']) { ?>
</div>
</div>
<?php endif;
if ($user['room'] == 41): ?>
if ($user->room == 41): ?>
<h4>Комнаты отдыха</h4>
<div style="background: silver; border: 1px solid dimgray;">
Посиди в тишине, внутри стен. Тут нет врагов. Тут спокойно.
@ -201,6 +213,4 @@ if ($castleOwners['id'] == $user['klan']) { ?>
</td>
</tr>
</table>
<? } else $status = 'Ворота замка закрыты, привратник отказывается даже разговаривать с тобой...'; ?>
</body>
</HTML>
<? } else $status = 'Ворота замка закрыты, привратник отказывается даже разговаривать с тобой...'; ?>

View File

@ -1,271 +1,310 @@
<?php
session_start();
if(!isset($_SESSION['uid'])) { die(); }
if (empty($_SESSION['uid'])) {
exit;
}
require_once 'functions.php';
$error = '';
function login($uid) {
$user = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `align`, `level`, `klan` FROM `users` WHERE `id` = "'.mysql_real_escape_string($uid).'" LIMIT 1'));
if(isset($user['id'])) {
$align_img = '<img src="i/align_'.($user['align']?$user['align']:0).'.gif" /> ';
if($user['klan'] != '') {
$clan = mysql_fetch_array(mysql_query('SELECT `id`, `name` FROM `clans` WHERE `id` = "'.$user['klan'].'" LIMIT 1'));
$clan_img = '<img title="'.$clan['name'].'" src="i/clan/'.$clan['name'].'.gif" /> ';
} else {
$clan_img = '';
}
$r = $align_img.$clan_img.' <b>'.$user['login'].' ['.$user['level'].']</b><a href="http://capitalcity.old-dark.ru/inf.php?id='.$user['id'].'" target="_blank"><img src="http://capitalcity.old-dark.ru/i/inf.gif" /></a>';
} else {
$r = 'Место свободно';
}
return $r;
}
function form_start($uid) {
$r = ''; $go = '';
if($uid > 0) {
$user = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `align`, `level`, `klan`, `zayrist` FROM `users` WHERE `id` = "'.$uid.'" LIMIT 1'));
if(isset($user['id'])) {
if($user['zayrist']) {
$zv = mysql_fetch_array(mysql_query('SELECT `id`, `name`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `id` = "'.$user['zayrist'].'" LIMIT 1'));
if(isset($zv['id'])) {
$r .= '<form method="POST">';
if($zv['uid1'] == $user['id']) {
$go = '<input type="submit" name="startZv" value="Начать поход" /> / ';
}
for($i = 1; $i <= 3; $i++) {
$nick .= login($zv['uid'.$i]).', ';
}
$nc = rtrim($nick, ', ');
$r .= '<table style="padding-top: 25px;"><tr><td>Ваша группа («'.$zv['name'].'»): '.$nc.' '.$go.'<input type="submit" name="leaveZv" value="Покинуть заявку" /></td></tr></table>';
$r .= '</form>';
function login($uid)
{
$user = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `align`, `level`, `klan` FROM `users` WHERE `id` = "' . mysql_real_escape_string($uid) . '" LIMIT 1'));
if (isset($user['id'])) {
$align_img = '<img src="i/align_' . ($user['align'] ? $user['align'] : 0) . '.gif" /> ';
if ($user['klan'] != '') {
$clan = mysql_fetch_array(mysql_query('SELECT `id`, `name` FROM `clans` WHERE `id` = "' . $user['klan'] . '" LIMIT 1'));
$clan_img = '<img title="' . $clan['name'] . '" src="i/clan/' . $clan['name'] . '.png" /> ';
} else {
$user['zayrist'] = 0;
mysql_query('UPDATE `users` SET `zayrist` = "'.$user['zayrist'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
$clan_img = '';
}
}
$r = $align_img . $clan_img . ' <b>' . $user['login'] . ' [' . $user['level'] . ']</b><a href="/inf.php?' . $user['id'] . '" target="_blank"><img src="/i/inf.gif" /></a>';
} else {
$r = 'Место свободно';
}
}
return $r;
return $r;
}
function forms($level) {
$r = '<br /></br />';
$sp = mysql_query('SELECT `id`, `name`, `pass`, `comment`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `level` = "'.(int)$level.'" ORDER BY `id` DESC');
if(mysql_num_rows($sp) > 0) {
while($pl = mysql_fetch_array($sp)) {
$i = 1;
while($i <= 3) {
$nick .= login($pl['uid'.$i]).', ';
$i++;
}
$nc = rtrim($nick, ', ');
$r .= '<table><tr><td>Группа («'.$pl['name'].'»): '.$nc.' <input type="hidden" name="zvId" value="'.$pl['id'].'" /> <input type="submit" name="gotoZv" value="Вступить в заявку" /></td></tr></table>';
function form_start($uid)
{
$r = '';
$go = '';
if ($uid > 0) {
$user = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `align`, `level`, `klan`, `zayrist` FROM `users` WHERE `id` = "' . $uid . '" LIMIT 1'));
if (isset($user['id']) ?? $user['zayrist']) {
$zv = mysql_fetch_array(mysql_query('SELECT `id`, `name`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `id` = "' . $user['zayrist'] . '" LIMIT 1'));
if (isset($zv['id'])) {
$r .= '<form method="POST">';
if ($zv['uid1'] == $user['id']) {
$go = '<input type="submit" name="startZv" value="Начать поход" /> / ';
}
for ($i = 1; $i <= 3; $i++) {
$nick .= login($zv['uid' . $i]) . ', ';
}
$nc = rtrim($nick, ', ');
$r .= '<table style="padding-top: 25px;"><tr><td>Ваша группа («' . $zv['name'] . '»): ' . $nc . ' ' . $go . '<input type="submit" name="leaveZv" value="Покинуть заявку" /></td></tr></table>';
$r .= '</form>';
} else {
$user['zayrist'] = 0;
mysql_query('UPDATE `users` SET `zayrist` = "' . $user['zayrist'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
}
}
}
} else {
$r .= '<i>Заявок вашего уровня нет</i>';
}
unset($sp, $pl, $nick, $nc, $i);
return $r;
return $r;
}
if(isset($_POST['buyFirst'])) {
if(isset($user['id'])) {
if($user['money'] >= 5) {
$Firts = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб" AND `owner` = "'.$user['id'].'" LIMIT 1'));
if(isset($Firts['id'])) {
$error = 'У Вас уже есть Фамильный Герб';
} else {
$Second = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб (х2)" AND `owner` = "'.$user['id'].'" LIMIT 1'));
if(isset($Second['id'])) {
$error = 'У Вас уже есть Фамильный Герб';
function forms($level)
{
$r = '<br /></br />';
$sp = mysql_query('SELECT `id`, `name`, `pass`, `comment`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `level` = "' . (int)$level . '" ORDER BY `id` DESC');
if (mysql_num_rows($sp) > 0) {
while ($pl = mysql_fetch_array($sp)) {
$i = 1;
while ($i <= 3) {
$nick .= login($pl['uid' . $i]) . ', ';
$i++;
}
$nc = rtrim($nick, ', ');
$r .= '<table><tr><td>Группа («' . $pl['name'] . '»): ' . $nc . ' <input type="hidden" name="zvId" value="' . $pl['id'] . '" /> <input type="submit" name="gotoZv" value="Вступить в заявку" /></td></tr></table>';
}
} else {
$r .= '<i>Заявок вашего уровня нет</i>';
}
unset($sp, $pl, $nick, $nc, $i);
return $r;
}
if (isset($_POST['buyFirst'])) {
if (isset($user['id'])) {
if ($user['money'] >= 5) {
$Firts = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб" AND `owner` = "' . $user['id'] . '" LIMIT 1'));
if (isset($Firts['id'])) {
$error = 'У Вас уже есть Фамильный Герб';
} else {
$Second = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб (х2)" AND `owner` = "' . $user['id'] . '" LIMIT 1'));
if (isset($Second['id'])) {
$error = 'У Вас уже есть Фамильный Герб';
} else {
$user['money'] -= 5;
mysql_query('UPDATE `users` SET `money` = "' . $user['money'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
takeshopitem(1930, 'shop', '', '', 0, 0, $user['id'], 1, '', 0);
mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '{$user['id']}', '\"" . $user['login'] . "\" купил Фамильный Герб за 5кр.', '1', '" . time() . "')");
$error = 'Вы купили Фамильный Герб';
}
}
} else {
$user['money'] -= 5;
mysql_query('UPDATE `users` SET `money` = "'.$user['money'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
takeshopitem(1930, 'shop', '', '', 0, 0, $user['id'], 1, '', 0);
mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '{$user['id']}', '\"".$user['login']."\" купил Фамильный Герб за 5кр.', '1', '".time()."')");
$error = 'Вы купили Фамильный Герб';
$error = 'Недостаточно средств';
}
}
} else {
$error = 'Недостаточно средств';
$error = 'Вы не авторизированы';
}
} else {
$error = 'Вы не авторизированы';
}
}
if(isset($_POST['buySecond'])) {
if(isset($user['id'])) {
if($user['money'] >= 15) {
$Firts = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб" AND `owner` = "'.$user['id'].'" LIMIT 1'));
if(isset($Firts['id'])) {
$error = 'У Вас уже есть Фамильный Герб';
} else {
$Second = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб (х2)" AND `owner` = "'.$user['id'].'" LIMIT 1'));
if(isset($Second['id'])) {
$error = 'У Вас уже есть Фамильный Герб';
if (isset($_POST['buySecond'])) {
if (isset($user['id'])) {
if ($user['money'] >= 15) {
$Firts = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб" AND `owner` = "' . $user['id'] . '" LIMIT 1'));
if (isset($Firts['id'])) {
$error = 'У Вас уже есть Фамильный Герб';
} else {
$Second = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб (х2)" AND `owner` = "' . $user['id'] . '" LIMIT 1'));
if (isset($Second['id'])) {
$error = 'У Вас уже есть Фамильный Герб';
} else {
$user['money'] -= 15;
mysql_query('UPDATE `users` SET `money` = "' . $user['money'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
takeshopitem(1931, 'shop', '', '', 0, 0, $user['id'], 1, '', 0);
mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '{$user['id']}', '\"" . $user['login'] . "\" купил Фамильный Герб (x2) за 15кр.', '1', '" . time() . "')");
$error = 'Вы купили Фамильный Герб (x2)';
}
}
} else {
$user['money'] -= 15;
mysql_query('UPDATE `users` SET `money` = "'.$user['money'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
takeshopitem(1931, 'shop', '', '', 0, 0, $user['id'], 1, '', 0);
mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '{$user['id']}', '\"".$user['login']."\" купил Фамильный Герб (x2) за 15кр.', '1', '".time()."')");
$error = 'Вы купили Фамильный Герб (x2)';
$error = 'Недостаточно средств';
}
}
} else {
$error = 'Недостаточно средств';
$error = 'Вы не авторизированы';
}
} else {
$error = 'Вы не авторизированы';
}
}
if($_POST['addZayavka']) {
if(isset($user['id'])) {
$name = mysql_real_escape_string($_POST['nameZv']);
$pass = mysql_real_escape_string($_POST['passZv']);
$comment = mysql_real_escape_string($_POST['commentZv']);
$zv = mysql_fetch_array(mysql_query('SELECT `id` FROM `group_ristal` WHERE `id` = "'.$user['zayrist'].'" LIMIT 1'));
if($user['zayrist'] > 0 && isset($zv['id'])) {
$error = 'Вы уже состоите в заявке';
} elseif(strlen($name) > 15) {
$error = 'Название может состоять максимум из 15 символов';
} elseif(strlen($name) < 3) {
$error = 'Название может состоять минимум из 3 символов';
} elseif(strlen($pass) > 6) {
$error = 'Пароль может состоять максимум из 6 символов';
} elseif(strlen($comment) > 20) {
$error = 'Комментарий может состоять максимум из 20 символов';
if ($_POST['addZayavka']) {
if (isset($user['id'])) {
$name = mysql_real_escape_string($_POST['nameZv']);
$pass = mysql_real_escape_string($_POST['passZv']);
$comment = mysql_real_escape_string($_POST['commentZv']);
$zv = mysql_fetch_array(mysql_query('SELECT `id` FROM `group_ristal` WHERE `id` = "' . $user['zayrist'] . '" LIMIT 1'));
if ($user['zayrist'] > 0 && isset($zv['id'])) {
$error = 'Вы уже состоите в заявке';
} elseif (strlen($name) > 15) {
$error = 'Название может состоять максимум из 15 символов';
} elseif (strlen($name) < 3) {
$error = 'Название может состоять минимум из 3 символов';
} elseif (strlen($pass) > 6) {
$error = 'Пароль может состоять максимум из 6 символов';
} elseif (strlen($comment) > 20) {
$error = 'Комментарий может состоять максимум из 20 символов';
} else {
mysql_query('INSERT INTO `group_ristal` (`name`, `pass`, `comment`, `time`, `uid1`) VALUES ("' . $name . '", "' . $pass . '", "' . $comment . '", "' . time() . '", "' . $user['id'] . '")');
$user['zayrist'] = mysql_insert_id();
mysql_query('UPDATE `users` SET `zayrist` = "' . $user['zayrist'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
$error = 'Заявка создана';
}
} else {
mysql_query('INSERT INTO `group_ristal` (`name`, `pass`, `comment`, `time`, `uid1`) VALUES ("'.$name.'", "'.$pass.'", "'.$comment.'", "'.time().'", "'.$user['id'].'")');
$user['zayrist'] = mysql_insert_id();
mysql_query('UPDATE `users` SET `zayrist` = "'.$user['zayrist'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
$error = 'Заявка создана';
$error = 'Вы не авторизированы';
}
} else {
$error = 'Вы не авторизированы';
}
}
if(isset($_POST['leaveZv'])) {
if($user['zayrist'] > 0) {
$zv = mysql_fetch_array(mysql_query('SELECT `id`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `id` = "'.$user['zayrist'].'" LIMIT 1'));
if(isset($zv['id'])) {
$i = 1; $j = 3; $k = 0; $h = 0;
while($i <= 3) {
if($k == 0 && $zv['uid'.$i] != $user['id']) {
$k = $zv['uid'.$i];
$h = $i;
}
$i++;
}
$i = 1;
while($i <= 3) {
if($zv['uid'.$i] == $user['id']) {
if($i > 1) {
$zv['uid'.$i] = 0;
} else {
$zv['uid'.$i] = $k;
$zv['uid'.$h] = 0;
}
}
if($zv['uid'.$i] == 0) {
$j--;
}
$i++;
}
if($j < 1) {
mysql_query('DELETE FROM `group_ristal` WHERE `id` = "'.$zv['id'].'" LIMIT 1');
$error = 'Заявка была удалена<br />';
$user['zayrist'] = 0;
mysql_query('UPDATE `users` SET `zayrist` = "'.$user['zayrist'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
} else {
mysql_query('UPDATE `group_ristal` SET `uid1` = "'.$zv['uid1'].'", `uid2` = "'.$zv['uid2'].'", `uid3` = "'.$zv['uid3'].'" WHERE `id` = "'.$zv['id'].'" lIMIT 1');
$user['zayrist'] = 0;
mysql_query('UPDATE `users` SET `zayrist` = "'.$user['zayrist'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
$error = 'Вы покинули заявку<br />';
}
unset($zv);
if (isset($_POST['leaveZv']) ?? $user['zayrist']) {
$zv = mysql_fetch_array(mysql_query('SELECT `id`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `id` = "' . $user['zayrist'] . '" LIMIT 1'));
if (isset($zv['id'])) {
$i = 1;
$j = 3;
$k = 0;
$h = 0;
while ($i <= 3) {
if ($k == 0 && $zv['uid' . $i] != $user['id']) {
$k = $zv['uid' . $i];
$h = $i;
}
$i++;
}
$i = 1;
while ($i <= 3) {
if ($zv['uid' . $i] == $user['id']) {
if ($i > 1) {
$zv['uid' . $i] = 0;
} else {
$zv['uid' . $i] = $k;
$zv['uid' . $h] = 0;
}
}
if ($zv['uid' . $i] == 0) {
$j--;
}
$i++;
}
if ($j < 1) {
mysql_query('DELETE FROM `group_ristal` WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
$error = 'Заявка была удалена<br />';
$user['zayrist'] = 0;
mysql_query('UPDATE `users` SET `zayrist` = "' . $user['zayrist'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
} else {
mysql_query('UPDATE `group_ristal` SET `uid1` = "' . $zv['uid1'] . '", `uid2` = "' . $zv['uid2'] . '", `uid3` = "' . $zv['uid3'] . '" WHERE `id` = "' . $zv['id'] . '" lIMIT 1');
$user['zayrist'] = 0;
mysql_query('UPDATE `users` SET `zayrist` = "' . $user['zayrist'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
$error = 'Вы покинули заявку<br />';
}
unset($zv);
}
}
}
if($_GET['exit'] == 1) {
if ($_GET['exit'] == 1) {
mysql_query('UPDATE `users`,`online` SET `users`.`room` = 2702, `online`.`room` = 2702 WHERE `users`.`id` = "'.$user['id'].'" AND `online`.`id` = "'.$user['id'].'"');
mysql_query('UPDATE `users`,`online` SET `users`.`room` = 2702, `online`.`room` = 2702 WHERE `users`.`id` = "' . $user['id'] . '" AND `online`.`id` = "' . $user['id'] . '"');
header('Location: city.php');
}
}
Template::header('group_arena');
?>
<html lang="ru">
<head>
<title></title>
<meta charset="UTF-8" />
<link rel="stylesheet" href="css/main.css" />
<script>function growl(title, color, message, stycky) { if(!stycky) { stycky = false; } if(!color) { color = 'Red'; } $.jGrowl(message, { header: '<img src="/i/jgrowl_moover.png" class="jgrowl-moover" title="Передвинуть" style="cursor: pointer;" /> <font style="color: '+color+';">'+title+'</font>', sticky: stycky, glue: 'before' }); }</script>
<script>function shows() {
const clas = $("#alt").attr('class');
$("#mkgrp").toggle(); if(clas == 'show') { $("#alt").attr('class','hide'); $("#alt").text('Скрыть ...'); } else { $("#alt").attr('class','show'); $("#alt").text('Создать группу'); } }</script>
<style>body { background-image: url('i/r240_1.jpg'); background-repeat: no-repeat; background-position: top right; }</style>
</head>
<script>
function growl(title, color, message, stycky) {
if (!stycky) {
stycky = false;
}
if (!color) {
color = 'Red';
}
$.jGrowl(message, {
header: '<img src="/i/jgrowl_moover.png" class="jgrowl-moover" title="Передвинуть" style="cursor: pointer;" /> <font style="color: ' + color + ';">' + title + '</font>',
sticky: stycky,
glue: 'before'
});
}
<body >
<table class="allzeroes">
function shows() {
const clas = $("#alt").attr('class');
$("#mkgrp").toggle();
if (clas == 'show') {
$("#alt").attr('class', 'hide');
$("#alt").text('Скрыть ...');
} else {
$("#alt").attr('class', 'show');
$("#alt").text('Создать группу');
}
}</script>
<style>
body {
background-image: url('i/r240_1.jpg');
background-repeat: no-repeat;
background-position: top right;
}
</style>
<table class="allzeroes">
<tr>
<td>
<div align=center>
<h3>Турниры: Групповые сражения.</h3>
<b>Внимание! В боях этой локации разрешается использовать свитки "Восстановления энергии" номиналом не более 180НР!</b><br /><br />
<span style="color: Red;"><b>Внимание! При старте группового турнира руны автоматически будут сняты с персонажа. <br />Проверьте, что ваши вещи после снятия рун не упадут, и не забудьте надеть руны после выхода из локации!</b></span>
</div>
<? if($user['zayrist'] == 0) { ?><div align=left><h4>Принять участие в турнире:</h4></div><a onclick="shows();" href="#" class="show" id="alt">Создать группу</a><br /><? echo forms($user['level']); } else { echo form_start($user['id']); } ?>
<div id="mkgrp" style="display: none;">
<fieldset style="text-align: justify; width: 250px; max-width: 250px; height: 100px; max-height: 100px; margin-top: 15px;">
<form method="post">
Название: <input type="text" name="nameZv" size="20" /><br />
Комментарий: <input type="text" name="commentZv" size="15" /><br />
Пароль: <input type="text" name="passZv" size="10" /><br /><br />
<input type="submit" name="addZayavka" value="Создать группу" />
</form>
</fieldset>
</div>
<div align="left"><p>&nbsp;</p><h4>Победители 10-ти предыдущих турниров: <span id="levelCheck"><?=$user['level'];?></span>-е уровни </h4></div>
<div id="rate"></div>
<td>
<div align=center>
<h3>Турниры: Групповые сражения.</h3>
<b>Внимание! В боях этой локации разрешается использовать свитки "Восстановления энергии" номиналом не
более 180НР!</b><br/><br/>
<span style="color: Red;"><b>Внимание! При старте группового турнира руны автоматически будут сняты с персонажа. <br/>Проверьте, что ваши вещи после снятия рун не упадут, и не забудьте надеть руны после выхода из локации!</b></span>
</div>
<? if ($user['zayrist'] == 0) { ?>
<div align=left><h4>Принять участие в турнире:</h4></div><a onclick="shows();" href="#" class="show"
id="alt">Создать группу</a>
<br/><? echo forms($user['level']);
} else {
echo form_start($user['id']);
} ?>
<div id="mkgrp" style="display: none;">
<fieldset
style="text-align: justify; width: 250px; max-width: 250px; height: 100px; max-height: 100px; margin-top: 15px;">
<form method="post">
Название: <input type="text" name="nameZv" size="20"/><br/>
Комментарий: <input type="text" name="commentZv" size="15"/><br/>
Пароль: <input type="text" name="passZv" size="10"/><br/><br/>
<input type="submit" name="addZayavka" value="Создать группу"/>
</form>
</fieldset>
</div>
<div align="left"><p>&nbsp;</p><h4>Победители 10-ти предыдущих турниров: <span
id="levelCheck"><?= $user['level']; ?></span>-е уровни </h4></div>
<div id="rate"></div>
</td>
<td align=right><button onclick="location.href='city.php?zaliv'">Вернуться</button><br /><br />
<form method="POST">
<input type="submit" value="Купить «Фамильный Герб» 5 кр." style="background-color: #A9AFC0;" name="buyFirst" />
<input type="submit" value="Купить «Фамильный Герб (х2)» 15 кр." style="background-color: #A9AFC0;" name="buySecond" />
</form>
<td align=right>
<button onclick="location.href='city.php?zaliv'">Вернуться</button>
<br/><br/>
<form method="POST">
<input type="submit" value="Купить «Фамильный Герб» 5 кр." style="background-color: #A9AFC0;"
name="buyFirst"/>
<input type="submit" value="Купить «Фамильный Герб (х2)» 15 кр." style="background-color: #A9AFC0;"
name="buySecond"/>
</form>
</td>
</tr>
</table>
<div id="response"></div>
<script>
$(function() {
let level =;
$('#rate').load('ajax/rate_ruins.php?level='+level);
$.jGrowl.defaults.closerTemplate = '<div style="text-align: center; cursor: pointer;"><b>[ Закрыть ]</b></div>';
$.jGrowl.defaults.closeTemplate = '<img src="i/clear.gif" alt="x" title="Закрыть" />';
</table>
<div id="response"></div>
<script>
$(function () {
let level =;
$('#rate').load('ajax/rate_ruins.php?level=' + level);
$.jGrowl.defaults.closerTemplate = '<div style="text-align: center; cursor: pointer;"><b>[ Закрыть ]</b></div>';
$.jGrowl.defaults.closeTemplate = '<img src="i/clear.gif" alt="x" title="Закрыть" />';
$('body').delegate('div#jGrowl .jgrowl-moover', 'click', function () {
const j = $(this).closest('div#jGrowl');
const c = j.hasClass('top-right') ? 'top-left' : 'top-right';
j.removeClass('top-left top-right').addClass(c);
});
$("#rate").on("click", "a", function (e) {
const level = $(this).attr("id");
$('#rate').load('ajax/rate_ruins.php?level=' + level);
});
$('body').delegate('div#jGrowl .jgrowl-moover', 'click', function() {
const j = $(this).closest('div#jGrowl');
const c = j.hasClass('top-right') ? 'top-left' : 'top-right';
j.removeClass('top-left top-right').addClass(c);
});
$("#rate").on("click", "a", function(e) {
const level = $(this).attr("id");
$('#rate').load('ajax/rate_ruins.php?level='+level);
});
});
</script>
<?if($error != '') { echo "<script>growl('Внимание', 'Red', '$error');</script>"; } ?>
</body>
</html>
</script>
<? if ($error != '') {
echo "<script>growl('Внимание', 'Red', '$error');</script>";
}

View File

@ -42,34 +42,21 @@ $hr = new hellround;
$mytrip = $hr->is_in_trip($user['id']);
$tr = $hr->get_par($mytrip);
Template::header('hell');
if ($mytrip > 0) {
?>
<HTML>
<HEAD>
<link rel=stylesheet type="text/css" href="css/main.css">
<meta content="text/html; charset=utf-8" http-equiv=Content-type>
<style>
body {
background-image: url('i/hell. jpg');
background-repeat: no-repeat;
background-position: top right;
}
</style>
</HEAD>
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor=#e0e0e0>
<?
<style>
body {
background-image: url('i/hell.jpg');
background-repeat: no-repeat;
background-position: top right;
}
</style>
<?php
echo "<h3>Приближается <i>" . ($tr['volna'] + 1) . "</i> волна нашествия...</h3>";
// диалоговый бот
?>
<table width=100%>
</table>
</BODY>
</HTML>
<?
} else {
if ($_GET['start'] > 0) {
$f = mysql_fetch_array(mysql_query("SELECT `date_out` FROM `hellround_pohod` WHERE `owner`= " . $user['id'] . " ORDER by `id` DESC LIMIT 1;"));
if ((time() - strtotime($f['date_out'])) < 3600 * 24) {
@ -82,20 +69,14 @@ if ($mytrip > 0) {
}
?>
<HTML>
<HEAD>
<link rel=stylesheet type="text/css" href="css/main.css">
<meta content="text/html; charset=utf-8" http-equiv=Content-type>
<style>
<style>
body {
background-image: url('i/hell. jpg');
background-repeat: no-repeat;
background-position: top right;
}
</style>
</HEAD>
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor=#e0e0e0>
body {
background-image: url('i/hell.jpg');
background-repeat: no-repeat;
background-position: top right;
}
</style>
<TABLE border=0 width=100% cellspacing="0" cellpadding="0">
<td align=left>
<INPUT TYPE="button" onclick="location.href = 'hell.php?start=1';" value="НАЧАТЬ ПОХОД" name="strah">
@ -139,8 +120,5 @@ if ($mytrip > 0) {
</fieldset>
</center>
</FORM>
</BODY>
</HTML>
<?
}
?>
}

View File

@ -1,14 +1,18 @@
<?
<?php
session_start();
if(!isset($_SESSION['uid'])) { header('Location: index.php'); die(); }
if (empty($_SESSION['uid'])) {
header('Location: index.php');
exit;
}
include('config.php');
$user = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$_SESSION['uid'].'" LIMIT 1'));
$hostel = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `type`, `time` FROM `hostel` WHERE `uid` = "'.$user['id'].'" LIMIT 1'));
$user = new User($_SESSION['uid']);
$hostel = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `type`, `time` FROM `hostel` WHERE `uid` = "' . $user['id'] . '" LIMIT 1'));
#include('functions.php');
$error = ''; $rs = '';
$base = array(1 => array('type' => 'Сумка'), 2 => array('type' => 'Сундук'), 3 => array('type' => 'Комната'), 4 => array('type' => 'Амбар'));
$times = array(1 => 7, 2 => 14, 3 => 21, 4 => 28);
$cost = array(1 => array(8, 16, 24, 32), 2 => array(15, 30, 45, 60), 3 => array(25, 50, 75, 100), 4 => array(40, 80, 120, 160));
$error = '';
$rs = '';
$base = [1 => ['type' => 'Сумка'], 2 => ['type' => 'Сундук'], 3 => ['type' => 'Комната'], 4 => ['type' => 'Амбар']];
$times = [1 => 7, 2 => 14, 3 => 21, 4 => 28];
$cost = [1 => [8, 16, 24, 32], 2 => [15, 30, 45, 60], 3 => [25, 50, 75, 100], 4 => [40, 80, 120, 160]];
function remove_hostel_items($u)
{
@ -21,7 +25,7 @@ function remove_hostel_items($u)
function select_arenda($u, $type, $redirect = false)
{
$hostel = mysql_fetch_array(mysql_query('SELECT `id` FROM `hostel` WHERE `uid` = "' . $u['id'] . '" LIMIT 1'));
$price = array(1 => 8, 2 => 15, 3 => 25, 4 => 40);
$price = [1 => 8, 2 => 15, 3 => 25, 4 => 40];
if (!isset($u['id'])) {
$r = 'Персонаж не найден ...';
} else {
@ -42,252 +46,281 @@ function select_arenda($u, $type, $redirect = false)
$r = 'Неверный тип аренды ...';
}
}
if ($redirect == true) {
if ($redirect) {
header('Location: main.php');
}
return $r;
}
if($_GET['exit'] == 1) {
if($user['sleep'] == 0) {
mysql_query('UPDATE `users`,`online` SET `users`.`room` = 26, `online`.`room` = 26 WHERE `users`.`id` = "'.$user['id'].'" AND `online`.`id` = "'.$user['id'].'"');
header('Location: city.php');
} else {
$error = 'Вы спите ...';
}
}
if($_GET['to_room'] == 1) {
if(isset($hostel['id'])) {
if($hostel['time'] > time()) {
mysql_query('UPDATE `users`,`online` SET `users`.`room` = 661, `online`.`room` = 661 WHERE `users`.`id` = "'.$user['id'].'" AND `online`.`id` = "'.$user['id'].'"');
header('Location: hostel_room.php');
if ($_GET['exit'] == 1) {
if ($user['sleep'] == 0) {
mysql_query('UPDATE `users`,`online` SET `users`.`room` = 26, `online`.`room` = 26 WHERE `users`.`id` = "' . $user['id'] . '" AND `online`.`id` = "' . $user['id'] . '"');
header('Location: city.php');
} else {
$error = 'У Вас просрочена аренда. Оплатите что-бы продолжить пользоваться нашими услугами ...';
$error = 'Вы спите ...';
}
} else {
$error = 'У Вас, нету комнаты ...';
}
}
if($_GET['pays']) {
if((int)$_GET['pays'] >= 1 && (int)$_GET['pays'] <= 4) {
if(isset($hostel['id'])) {
if($user['money'] >= $cost[$hostel['type']][(int)$_GET['pays']]) {
$time = $hostel['time']+60*60*24*$times[(int)$_GET['pays']];
$user['money'] -= $cost[$hostel['type']][(int)$_GET['pays']];
$hostel['time'] = $time;
mysql_query('UPDATE `users` SET `money` = "'.$user['money'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
mysql_query('UPDATE `hostel` SET `time` = "'.$time.'" WHERE `uid` = "'.$user['id'].'" AND `id` = "'.$hostel['id'].'" LIMIT 1');
$error = 'Всё прошло успешно ...';
} else {
$error = 'Недостаточно денег ...';
}
if ($_GET['to_room'] == 1) {
if (isset($hostel['id'])) {
if ($hostel['time'] > time()) {
mysql_query('UPDATE `users`,`online` SET `users`.`room` = 661, `online`.`room` = 661 WHERE `users`.`id` = "' . $user['id'] . '" AND `online`.`id` = "' . $user['id'] . '"');
header('Location: hostel_room.php');
} else {
$error = 'У Вас просрочена аренда. Оплатите что-бы продолжить пользоваться нашими услугами ...';
}
} else {
$error = 'Ошибка #1';
$error = 'У Вас, нету комнаты ...';
}
}
}
if(isset($_POST['select']) && isset($_POST['tariff'])) {
if($_POST['tariff'] == 0) {
$error = 'Выберите тариф ...';
} else {
$error = select_arenda($user, (int)$_POST['tariff']);
}
if ($_GET['pays'] && (int)$_GET['pays'] >= 1 && (int)$_GET['pays'] <= 4) {
if (isset($hostel['id'])) {
if ($user['money'] >= $cost[$hostel['type']][(int)$_GET['pays']]) {
$time = $hostel['time'] + 60 * 60 * 24 * $times[(int)$_GET['pays']];
$user['money'] -= $cost[$hostel['type']][(int)$_GET['pays']];
$hostel['time'] = $time;
mysql_query('UPDATE `users` SET `money` = "' . $user['money'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
mysql_query('UPDATE `hostel` SET `time` = "' . $time . '" WHERE `uid` = "' . $user['id'] . '" AND `id` = "' . $hostel['id'] . '" LIMIT 1');
$error = 'Всё прошло успешно ...';
} else {
$error = 'Недостаточно денег ...';
}
} else {
$error = 'Ошибка #1';
}
}
if($_GET['del'] == 1) {
if(isset($hostel['id']) && $hostel['time'] > time()) {
mysql_query('DELETE FROM `hostel` WHERE `uid` = "'.$user['id'].'" AND `id` = "'.$hostel['id'].'" LIMIT 1');
remove_hostel_items($user['id']);
$error = 'Вы успешно отказались от аренды ...';
unset($hostel);
} elseif(isset($hostel['id']) && $hostel['time'] < time()) {
$error = 'Нельзя отказаться от услуг если имеется задолежнность ...';
}
if (isset($_POST['select']) && isset($_POST['tariff'])) {
if ($_POST['tariff'] == 0) {
$error = 'Выберите тариф ...';
} else {
$error = select_arenda($user, (int)$_POST['tariff']);
}
}
if(isset($_POST['deselect']) && isset($_POST['retariff'])) {
if(isset($hostel['id']) && $hostel['time'] > time()) {
mysql_query('DELETE FROM `hostel` WHERE `uid` = "'.$user['id'].'" AND `id` = "'.$hostel['id'].'" LIMIT 1');
remove_hostel_items($user['id']);
select_arenda($user, (int)$_POST['retariff'], true);
} elseif(isset($hostel['id']) && $hostel['time'] < time()) {
$error = 'Нельзя сменить услугу если имеется задолежнность ...';
}
if ($_GET['del'] == 1) {
if (isset($hostel['id']) && $hostel['time'] > time()) {
mysql_query('DELETE FROM `hostel` WHERE `uid` = "' . $user['id'] . '" AND `id` = "' . $hostel['id'] . '" LIMIT 1');
remove_hostel_items($user['id']);
$error = 'Вы успешно отказались от аренды ...';
unset($hostel);
} elseif (isset($hostel['id']) && $hostel['time'] < time()) {
$error = 'Нельзя отказаться от услуг если имеется задолежнность ...';
}
}
if($_GET['sleep'] && $user['sleep'] == 0) {
if($user['sleep_time'] <= time()) {
if($user['vip'] == 1) { $sl = 8; } elseif($user['vip'] == 2) { $sl = 12; } elseif($user['vip'] == 3) { $sl = 18; } else { $sl = 2; }
mysql_query('UPDATE `users` SET `sleep` = "'.(time()+60*60*$sl).'", `sleep_time` = "'.(time()+60*60*8).'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
mysql_query('INSERT INTO `effects` (`type`, `name`, `time`, `owner`) VALUES ("8", "Сон", "'.(time()+60*60*$sl).'", "'.$user['id'].'")');
$ef = mysql_query('SELECT `id`, `time`, `type` FROM `effects` WHERE `owner` = "'.$user['id'].'" AND `type` != 11 AND `type` != 12 AND `type` != 13 AND `type` != 14 AND `type` != 5 AND `type` != 4 AND `type` != 2 AND `type` != 3 AND `type` != 8');
while($pl = mysql_fetch_array($ef)) {
$tm = $pl['time']-time();
mysql_query('UPDATE `effects` SET `sleep` = "'.$tm.'" WHERE `id` = "'.$pl['id'].'" AND `owner` = "'.$user['id'].'"');
if (isset($_POST['deselect']) && isset($_POST['retariff'])) {
if (isset($hostel['id']) && $hostel['time'] > time()) {
mysql_query('DELETE FROM `hostel` WHERE `uid` = "' . $user['id'] . '" AND `id` = "' . $hostel['id'] . '" LIMIT 1');
remove_hostel_items($user['id']);
select_arenda($user, (int)$_POST['retariff'], true);
} elseif (isset($hostel['id']) && $hostel['time'] < time()) {
$error = 'Нельзя сменить услугу если имеется задолежнность ...';
}
}
if ($_GET['sleep'] && $user['sleep'] == 0) {
if ($user['sleep_time'] <= time()) {
if ($user['vip'] == 1) {
$sl = 8;
} elseif ($user['vip'] == 2) {
$sl = 12;
} elseif ($user['vip'] == 3) {
$sl = 18;
} else {
$sl = 2;
}
mysql_query('UPDATE `users` SET `sleep` = "' . (time() + 60 * 60 * $sl) . '", `sleep_time` = "' . (time() + 60 * 60 * 8) . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
mysql_query('INSERT INTO `effects` (`type`, `name`, `time`, `owner`) VALUES ("8", "Сон", "' . (time() + 60 * 60 * $sl) . '", "' . $user['id'] . '")');
$ef = mysql_query('SELECT `id`, `time`, `type` FROM `effects` WHERE `owner` = "' . $user['id'] . '" AND `type` != 11 AND `type` != 12 AND `type` != 13 AND `type` != 14 AND `type` != 5 AND `type` != 4 AND `type` != 2 AND `type` != 3 AND `type` != 8');
while ($pl = mysql_fetch_array($ef)) {
$tm = $pl['time'] - time();
mysql_query('UPDATE `effects` SET `sleep` = "' . $tm . '" WHERE `id` = "' . $pl['id'] . '" AND `owner` = "' . $user['id'] . '"');
}
header('Location: hostel.php');
} else {
$error = 'Нельзя спать ... Приходите через : ' . timeOut($user['sleep_time'] - time());
}
}
if ($_GET['unsleep'] && $user['sleep'] > 0) {
mysql_query('UPDATE `users` SET `sleep` = "0" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
mysql_query('DELETE FROM `effects` WHERE `owner` = "' . $user['id'] . '" AND `type` = "8" LIMIT 1');
$ef = mysql_query('SELECT `id`, `time`, `sleep` FROM `effects` WHERE `owner` = "' . $user['id'] . '" AND `sleep` != 0');
while ($pl = mysql_fetch_array($ef)) {
$tm = time() + $pl['sleep'];
mysql_query('UPDATE `effects` SET `time` = "' . $tm . '", `sleep` = "0" WHERE `id` = "' . $pl['id'] . '" AND `owner` = "' . $user['id'] . '"');
}
header('Location: hostel.php');
} else {
$error = 'Нельзя спать ... Приходите через : '.timeOut($user['sleep_time']-time());
}
}
if($_GET['unsleep'] && $user['sleep'] > 0) {
mysql_query('UPDATE `users` SET `sleep` = "0" WHERE `id` = "'.$user['id'].'" LIMIT 1');
mysql_query('DELETE FROM `effects` WHERE `owner` = "'.$user['id'].'" AND `type` = "8" LIMIT 1');
$ef = mysql_query('SELECT `id`, `time`, `sleep` FROM `effects` WHERE `owner` = "'.$user['id'].'" AND `sleep` != 0');
while($pl = mysql_fetch_array($ef)) {
$tm = time()+$pl['sleep'];
mysql_query('UPDATE `effects` SET `time` = "'.$tm.'", `sleep` = "0" WHERE `id` = "'.$pl['id'].'" AND `owner` = "'.$user['id'].'"');
}
header('Location: hostel.php');
}
Template::header('Хостел');
?>
<!doctype html>
<html>
<head>
<title>404</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="content-language" content="ru" />
<script src="js/ajaxLoad.js"></script>
<? if(isset($hostel['id'])) { ?>
<script>
$(document).ready(function() {
$("#retariff option[value='<?=$hostel['type']; ?>']").remove();
});
</script>
<? } ?>
<link rel="stylesheet" type="text/css" href="css/hostel.css" />
</head>
<body>
<script src="js/ajaxLoad.js"></script>
<? if (isset($hostel['id'])) { ?>
<script>
$(document).ready(function () {
$("#retariff option[value='<?=$hostel['type']; ?>']").remove();
});
</script>
<? } ?>
<link rel="stylesheet" href="css/hostel.css"/>
<div class="contentContainer">
<div style="text-align: center;"><span class="hs">Гостиница, Холл</span></div>
<div class="buttonContainer">
<? if($user['sleep'] == 0) { ?>
<input type="button" class="btns button-route" value="Уснуть" onclick="location.href='?sleep=1';" />
<? } else { ?>
<input type="button" class="btns button-route" value="Пробудиться" onclick="location.href='?unsleep=1';" />
<? } ?>
<input type="button" class="btns" value="Обновить" onclick="location.href='main.php';" />
<input type="button" class="btns button-route" value="На улицу" onclick="location.href='?exit=1';" />
<input type="button" class="btns button-route" value="Комната" onclick="location.href='?to_room=1';" />
</div>
<div id="hostelLeft">
<div id="hostelInteractive">
<? if(!isset($hostel['id'])) { ?>
<fieldset class="hostelClientState">
<legend>Станьте нашим клиентом</legend>
<form method="post" style="text-align: center; width: 100%;">
<input type="hidden" name="act" value="settariff" />
<p>Выберите подходящий для Вас вариант обслуживания:</p>
<div style="text-align: center; width: 100%;">
<select name="tariff" class="tariff">
<option value="0">Выбор ...</option>
<option value="1">Сумка</option>
<option value="2">Сундук</option>
<option value="3">Комната</option>
<option value="4">Амбар</option>
</select>
<input type="submit" class="button" value="Выбрал" name="select" />
<? if($error != '') { echo '<br /><b style="color: Red;">'.$error.'</b><br />'; } ?>
</div>
</form>
</fieldset>
<? } else { ?>
<fieldset class="hostelClientState">
<legend>Добро пожаловать!</legend>
<form method="post" style="text-align: center; width: 100%;">
<p>Вы выбрали вариант предоставления жилья : <b><?=$base[$hostel['type']]['type']; ?></b></p>
<p>Аренда оплачена по: <? echo date('h:i d.m.y', $hostel['time']); ?> (<small><? echo timeOut($hostel['time']-time()); ?></small>)</p>
<div style="text-align: center; width: 100%;">
Сменить вариант аренды <select name="retariff" id="retariff">
<option value="0">Выбор ...</option>
<option value="1">Сумка</option>
<option value="2">Сундук</option>
<option value="3">Комната</option>
<option value="4">Амбар</option>
</select>
<input type="submit" class="button" value="Сменить" name="deselect" />
</div>
</form>
<a href="javascript: void(0);" style="float: left; margin-left: 3px;" onclick="if(confirm('Вы уверены?')) { location.href='?del=1'; }">Расторгнуть договор</a> <a href="javascript: void(0);" onclick="ajaxLoad('/hostel_checkpoint.php', 'hostelInteractive', {act:'pay'})" style="float: right; margin-right: 3px;">Внести предоплату</a>
<? if($error != '') { echo '<br /><center><b style="color: Red;">'.$error.'</b></center><br />'; } ?>
</fieldset>
<? } ?>
<div style="text-align: center;"><span class="hs">Гостиница, Холл</span></div>
<div class="buttonContainer">
<? if ($user['sleep'] == 0) { ?>
<input type="button" class="btns button-route" value="Уснуть" onclick="location.href='?sleep=1';"/>
<? } else { ?>
<input type="button" class="btns button-route" value="Пробудиться" onclick="location.href='?unsleep=1';"/>
<? } ?>
<input type="button" class="btns" value="Обновить" onclick="location.href='main.php';"/>
<input type="button" class="btns button-route" value="На улицу" onclick="location.href='?exit=1';"/>
<input type="button" class="btns button-route" value="Комната" onclick="location.href='?to_room=1';"/>
</div>
<fieldset class="hostelRules" style="overflow: hidden;">
<legend>Правила проживания</legend>
<div style="overflow: auto; height: 168px !important; margin: 0; padding: 0;">
<div style="margin: 0; padding: 0; height: 100%;">
<h2>И что я получу за свои кровные?</h2>
У нас ты можешь:
<br/>- хранить свое барахло и прочий хлам.
<h2>Охрана у вас есть? Не воруют?</h2>
Самые любопытные могут получить в сурло прямо здесь - в холле.
<br />- Устраивать беспорядки в комнатах не позволено.
<br />- Прислуга у нас проверенная - пожитки твои не тронут.
<h2>И сколько стоит всё это удовольствие?</h2>
- Комнаты есть разные, для людей разного достатка. Смотри справа расценки.
<br />- Платить нужно каждый день. Пока не заплатишь - на лестницу не ногой.
<br />- Вместимость - это сколько твоих вещей влезет в комнату, имеется ввиду общая масса инвентаря.
<h2>Как всем этим пользоваться?</h2>
Всё просто. Плати и живи.
<br />Приходишь, платишь по долгам, проходишь в аппартаменты. В сундуке есть секции для каждого вида вещей, фильтр поможет разобраться.
<h2>Что ещё мне нужно знать?</h2>
- При смене размера комнаты, ты теряешь оставшееся оплаченное время.
<br />- При просрочке платы более 60 суток, мы оставляем за собой право сдать вещи на аукцион для погашения задолжености.
<br />- Если долг будет разумный, то подарки забирать с полки не будем.
<br />- Быстро сориентироваться с шмотом поможет фильтр предметов.
<br />- Если что потеряешь - твои проблемы.
<div id="hostelLeft">
<div id="hostelInteractive">
<? if (!isset($hostel['id'])) { ?>
<fieldset class="hostelClientState">
<legend>Станьте нашим клиентом</legend>
<form method="post" style="text-align: center; width: 100%;">
<input type="hidden" name="act" value="settariff"/>
<p>Выберите подходящий для Вас вариант обслуживания:</p>
<div style="text-align: center; width: 100%;">
<select name="tariff" class="tariff">
<option value="0">Выбор ...</option>
<option value="1">Сумка</option>
<option value="2">Сундук</option>
<option value="3">Комната</option>
<option value="4">Амбар</option>
</select>
<input type="submit" class="button" value="Выбрал" name="select"/>
<? if ($error != '') {
echo '<br /><b style="color: Red;">' . $error . '</b><br />';
} ?>
</div>
</form>
</fieldset>
<? } else { ?>
<fieldset class="hostelClientState">
<legend>Добро пожаловать!</legend>
<form method="post" style="text-align: center; width: 100%;">
<p>Вы выбрали вариант предоставления жилья : <b><?= $base[$hostel['type']]['type']; ?></b></p>
<p>Аренда оплачена по: <? echo date('h:i d.m.y', $hostel['time']); ?>
(<small><? echo timeOut($hostel['time'] - time()); ?></small>)</p>
<div style="text-align: center; width: 100%;">
Сменить вариант аренды <select name="retariff" id="retariff">
<option value="0">Выбор ...</option>
<option value="1">Сумка</option>
<option value="2">Сундук</option>
<option value="3">Комната</option>
<option value="4">Амбар</option>
</select>
<input type="submit" class="button" value="Сменить" name="deselect"/>
</div>
</form>
<a href="javascript: void(0);" style="float: left; margin-left: 3px;"
onclick="if(confirm('Вы уверены?')) { location.href='?del=1'; }">Расторгнуть договор</a> <a
href="javascript: void(0);"
onclick="ajaxLoad('/hostel_checkpoint.php', 'hostelInteractive', {act:'pay'})"
style="float: right; margin-right: 3px;">Внести предоплату</a>
<? if ($error != '') {
echo '<br /><center><b style="color: Red;">' . $error . '</b></center><br />';
} ?>
</fieldset>
<? } ?>
</div>
</div>
</fieldset>
</div>
<fieldset class="hostelRules" style="overflow: hidden;">
<legend>Правила проживания</legend>
<div style="overflow: auto; height: 168px !important; margin: 0; padding: 0;">
<div style="margin: 0; padding: 0; height: 100%;">
<h2>И что я получу за свои кровные?</h2>
У нас ты можешь:
<br/>- хранить свое барахло и прочий хлам.
<h2>Охрана у вас есть? Не воруют?</h2>
Самые любопытные могут получить в сурло прямо здесь - в холле.
<br/>- Устраивать беспорядки в комнатах не позволено.
<br/>- Прислуга у нас проверенная - пожитки твои не тронут.
<h2>И сколько стоит всё это удовольствие?</h2>
- Комнаты есть разные, для людей разного достатка. Смотри справа расценки.
<br/>- Платить нужно каждый день. Пока не заплатишь - на лестницу не ногой.
<br/>- Вместимость - это сколько твоих вещей влезет в комнату, имеется ввиду общая масса инвентаря.
<div id="hostelRight">
<fieldset>
<legend>Тарифы и услуги</legend>
<br />
<table class="tarifsList" cellpadding="0" cellspacing="0">
<caption>Сумка</caption>
<tbody>
<tr><td class="tarifListLabel">Вместимость</td><td class="tarifListValue">15 ед.</td></tr>
<tr><td class="tarifListLabel">Стоимость (7 сут.)</td><td class="tarifListValue">8.00 кр.</td></tr>
</tbody>
</table>
<br />
<table class="tarifsList" cellpadding="0" cellspacing="0">
<caption>Сундук</caption>
<tbody>
<tr><td class="tarifListLabel">Вместимость</td><td class="tarifListValue">30 ед.</td></tr>
<tr><td class="tarifListLabel">Стоимость (7 сут.)</td><td class="tarifListValue">15.00 кр.</td></tr>
</tbody>
</table>
<br />
<table class="tarifsList" cellpadding="0" cellspacing="0">
<caption>Комната</caption>
<tbody>
<tr><td class="tarifListLabel">Вместимость</td><td class="tarifListValue">50 ед.</td></tr>
<tr><td class="tarifListLabel">Стоимость (7 сут.)</td><td class="tarifListValue">25.00 кр.</td></tr>
</tbody>
</table>
<br />
<table class="tarifsList" cellpadding="0" cellspacing="0">
<caption>Амбар</caption>
<tbody>
<tr><td class="tarifListLabel">Вместимость</td><td class="tarifListValue">100 ед.</td></tr>
<tr><td class="tarifListLabel">Стоимость (7 сут.)</td><td class="tarifListValue">40.00 кр.</td></tr>
</tbody>
</table>
</fieldset>
</div>
</div>
<h2>Как всем этим пользоваться?</h2>
Всё просто. Плати и живи.
<br/>Приходишь, платишь по долгам, проходишь в аппартаменты. В сундуке есть секции для каждого вида
вещей, фильтр поможет разобраться.
<h2>Что ещё мне нужно знать?</h2>
- При смене размера комнаты, ты теряешь оставшееся оплаченное время.
<br/>- При просрочке платы более 60 суток, мы оставляем за собой право сдать вещи на аукцион для
погашения задолжености.
<br/>- Если долг будет разумный, то подарки забирать с полки не будем.
<br/>- Быстро сориентироваться с шмотом поможет фильтр предметов.
<br/>- Если что потеряешь - твои проблемы.
</div>
</div>
</fieldset>
</div>
</body>
</html>
<div id="hostelRight">
<fieldset>
<legend>Тарифы и услуги</legend>
<br/>
<table class="tarifsList" cellpadding="0" cellspacing="0">
<caption>Сумка</caption>
<tbody>
<tr>
<td class="tarifListLabel">Вместимость</td>
<td class="tarifListValue">15 ед.</td>
</tr>
<tr>
<td class="tarifListLabel">Стоимость (7 сут.)</td>
<td class="tarifListValue">8.00 кр.</td>
</tr>
</tbody>
</table>
<br/>
<table class="tarifsList" cellpadding="0" cellspacing="0">
<caption>Сундук</caption>
<tbody>
<tr>
<td class="tarifListLabel">Вместимость</td>
<td class="tarifListValue">30 ед.</td>
</tr>
<tr>
<td class="tarifListLabel">Стоимость (7 сут.)</td>
<td class="tarifListValue">15.00 кр.</td>
</tr>
</tbody>
</table>
<br/>
<table class="tarifsList" cellpadding="0" cellspacing="0">
<caption>Комната</caption>
<tbody>
<tr>
<td class="tarifListLabel">Вместимость</td>
<td class="tarifListValue">50 ед.</td>
</tr>
<tr>
<td class="tarifListLabel">Стоимость (7 сут.)</td>
<td class="tarifListValue">25.00 кр.</td>
</tr>
</tbody>
</table>
<br/>
<table class="tarifsList" cellpadding="0" cellspacing="0">
<caption>Амбар</caption>
<tbody>
<tr>
<td class="tarifListLabel">Вместимость</td>
<td class="tarifListValue">100 ед.</td>
</tr>
<tr>
<td class="tarifListLabel">Стоимость (7 сут.)</td>
<td class="tarifListValue">40.00 кр.</td>
</tr>
</tbody>
</table>
</fieldset>
</div>
</div>

View File

@ -1,24 +1,24 @@
<?
session_start();
if(!isset($_SESSION['uid'])) { header('Location: index.php'); die(); }
include('config.php');
include('functions.php');
$hostel = mysql_fetch_array(mysql_query('SELECT * FROM `hostel` WHERE `uid` = "'.$user['id'].'" LIMIT 1'));
$base = array(1 => array(8, 16, 24, 32), 2 => array(15, 30, 45, 60), 3 => array(25, 50, 75, 100), 4 => array(40, 80, 120, 160));
if (empty($_SESSION['uid'])) {
header('Location: index.php');
exit;
}
require_once "functions.php";
$hostel = mysql_fetch_array(mysql_query('SELECT * FROM `hostel` WHERE `uid` = "' . $user['id'] . '" LIMIT 1'));
$base = [1 => [8, 16, 24, 32], 2 => [15, 30, 45, 60], 3 => [25, 50, 75, 100], 4 => [40, 80, 120, 160]];
if(isset($_POST['act']) && $_POST['act'] == 'pay') {
if(isset($user['id']) && isset($hostel['id'])) {
if (isset($_POST['act']) && $_POST['act'] == 'pay' && isset($user['id']) && isset($hostel['id'])) {
echo '<fieldset class="hostelClientState">';
echo '<legend>Предварительная оплата</legend>';
echo '<div style="text-align: center;"><p class="NORMAL" style="margin: 5px 0">';
echo 'Аренда оплачена по: <b>'.date('h:i d.m.y', $hostel['time']).'</b> <small>('.timeOut($hostel['time']-time()).')</small></p></div>';
echo 'Аренда оплачена по: <b>' . date('h:i d.m.y', $hostel['time']) . '</b> <small>(' . timeOut($hostel['time'] - time()) . ')</small></p></div>';
echo '<table align="center" class="periods"><caption style="text-align: left;">Выберите срок предоплаты.</caption>
<tbody>
<tr class="caption"><th>Сутки</th><td title="7 дн.">7</td><td title="14 дн.">14</td><td title="21 дн.">21</td><td title="28 дн.">28</td></tr>
<tr class="value"><th>Сумма</th><td title="7 дн."><a href="?pays=1">'.$base[$hostel['type']][0].'</a></td><td title="14 дн."><a href="?pays=2">'.$base[$hostel['type']][1].'</a></td><td title="21 дн."><a href="?pays=3">'.$base[$hostel['type']][2].'</a></td><td title="28 дн."><a href="?pays=4">'.$base[$hostel['type']][3].'</a></td></tr>
<tr class="value"><th>Сумма</th><td title="7 дн."><a href="?pays=1">' . $base[$hostel['type']][0] . '</a></td><td title="14 дн."><a href="?pays=2">' . $base[$hostel['type']][1] . '</a></td><td title="21 дн."><a href="?pays=3">' . $base[$hostel['type']][2] . '</a></td><td title="28 дн."><a href="?pays=4">' . $base[$hostel['type']][3] . '</a></td></tr>
</tbody>
</table>
<div style="color: red; font-size: 9px; padding-top: 3px;"><b>Внимание!</b> При расторжении договора или смене тарифа, внесенная плата не возвращается</div></fieldset></div>';
}
}

View File

@ -1,23 +1,29 @@
<?php
session_start();
if(!isset($_SESSION['uid'])) { header('Location: index.php'); die(); }
include('config.php');
include('functions.php');
if (empty($_SESSION['uid'])) {
header('Location: index.php');
exit;
}
require_once "functions.php";
$d = mysql_fetch_array(mysql_query("SELECT SUM(`massa`) AS `mass` FROM `inventory` WHERE `owner` = '{$user['id']}' AND `dressed` = 0 AND `setsale` = 0"));
$in = mysql_fetch_array(mysql_query('SELECT COUNT(*) AS `cnt` FROM `inventory` WHERE `owner` = "-101'.$user['id'].'"'));
$hostel = mysql_fetch_array(mysql_query('SELECT * FROM `hostel` WHERE `uid` = "'.$user['id'].'" LIMIT 1'));
$in = mysql_fetch_array(mysql_query('SELECT COUNT(*) AS `cnt` FROM `inventory` WHERE `owner` = "-101' . $user['id'] . '"'));
$hostel = mysql_fetch_array(mysql_query('SELECT * FROM `hostel` WHERE `uid` = "' . $user['id'] . '" LIMIT 1'));
$base = array(1 => 15, 2 => 30, 3 => 50, 4 => 100);
$vips = array(1 => 0.15, 2 => 0.30, 3 => 0.45);
$base = [1 => 15, 2 => 30, 3 => 50, 4 => 100];
$vips = [1 => 0.15, 2 => 0.30, 3 => 0.45];
function show_item($row, $txt, $place)
{
if (($row['maxdur'] <= $row['duration']) || ($row['dategoden'] && $row['dategoden'] <= time())) destructitem($row['id']);
if (($row['maxdur'] <= $row['duration']) || ($row['dategoden'] && $row['dategoden'] <= time())) {
destructitem($row['id']);
}
$r = '';
$ntxt = "В инвентаре";
if ($txt == "В сундук") $ntxt = "В сундуке";
if ($txt == "В сундук") {
$ntxt = "В сундуке";
}
$magic = db::c()->query('SELECT * FROM `magic` WHERE `id` = ?i', $$row['magic'])->fetch_assoc();
$incmagic = mysql_fetch_array(mysql_query('SELECT * FROM `magic` WHERE `id` = \'' . $row['includemagic'] . '\' LIMIT 1'));
@ -29,8 +35,8 @@ function show_item($row, $txt, $place)
$magic['time'] = $incmagic['time'];
$magic['targeted'] = $incmagic['targeted'];
}
#href="?search=1&otdel='.$row['otdel'].'&place='.$place.'&itm='.$row['id'].'&set=1"
if (isset($row['id'])) {
//todo подтянуть отображение предмета из класса
$r .= '<div id="inv_' . $row['id'] . '"><table><tbody>';
$r .= '<tr valign="top" style="border: 2px groove threedface;">';
$r .= '<td class="even links original"><img src="/i/sh/' . $row['img'] . '">
@ -57,7 +63,9 @@ function show_item($row, $txt, $place)
if (!$row['needident']) {
if ($magic['chanse']) {
if ($magic['chanse'] >= 95) $magic['chanse'] = 95;
if ($magic['chanse'] >= 95) {
$magic['chanse'] = 95;
}
$r .= 'Вероятность срабатывания: ' . $magic['chanse'] . '%<br />';
}
if ($magic['time']) {
@ -68,7 +76,7 @@ function show_item($row, $txt, $place)
}
$r .= '<div class="need">';
$user = array();
$user = [];
if ($row['nsila']) {
$r .= '&bull; ';
@ -239,7 +247,7 @@ function show_item($row, $txt, $place)
$r .= '<span style="color: maroon;"><b>Свойства предмета не идентифицированы</b></span><br />';
}
$osob = array(22, 23);
$osob = [22, 23];
if (in_array($row['type'], $osob)) {
$r .= 'Особенности:<br />';
if ($row['type'] == 22) {
@ -278,164 +286,185 @@ function show_itm_hostel($uid, $otdel, $type = 1)
return $r;
}
if($user['vip'] > 0 && $user['vip_time'] > time()) {
$count = $base[$hostel['type']];
$count += floor($base[$hostel['type']]*$vips[$user['vip']]);
if ($user['vip'] > 0 && $user['vip_time'] > time()) {
$count = $base[$hostel['type']];
$count += floor($base[$hostel['type']] * $vips[$user['vip']]);
} else {
$count = $base[$hostel['type']];
$count = $base[$hostel['type']];
}
if($_GET['search']) {
$r = show_itm_hostel($user['id'], (int)$_GET['otdel'], (int)$_GET['place']);
if ($_GET['search']) {
$r = show_itm_hostel($user['id'], (int)$_GET['otdel'], (int)$_GET['place']);
} else {
$r = '<tr><td width="100%" align="center" class="even" style="text-align: center;"><b><center>Поиск ...</center></b></td></tr>';
$r = '<tr><td width="100%" align="center" class="even" style="text-align: center;"><b><center>Поиск ...</center></b></td></tr>';
}
if($_GET['set'] && $_GET['set'] == 1) {
$it = mysql_fetch_array(mysql_query('SELECT `id`, `owner` FROM `inventory` WHERE `id` = "'.(int)$_GET['itm'].'" LIMIT 1'));
if(isset($it['id'])) {
if($it['owner'] == $user['id']) {
if($in['cnt'] < $count) {
mysql_query('UPDATE `inventory` SET `owner` = "-101'.$user['id'].'" WHERE `id` = "'.$it['id'].'" LIMIT 1');
$in['cnt']++;
} else {
$error = 'Не хватает места ...';
}
} elseif($it['owner'] == '-101'.$user['id']) {
mysql_query('UPDATE `inventory` SET `owner` = "'.$user['id'].'" WHERE `id` = "'.$it['id'].'" LIMIT 1');
$in['cnt']--;
if ($_GET['set'] && $_GET['set'] == 1) {
$it = mysql_fetch_array(mysql_query('SELECT `id`, `owner` FROM `inventory` WHERE `id` = "' . (int)$_GET['itm'] . '" LIMIT 1'));
if (isset($it['id'])) {
if ($it['owner'] == $user['id']) {
if ($in['cnt'] < $count) {
mysql_query('UPDATE `inventory` SET `owner` = "-101' . $user['id'] . '" WHERE `id` = "' . $it['id'] . '" LIMIT 1');
$in['cnt']++;
} else {
$error = 'Не хватает места ...';
}
} elseif ($it['owner'] == '-101' . $user['id']) {
mysql_query('UPDATE `inventory` SET `owner` = "' . $user['id'] . '" WHERE `id` = "' . $it['id'] . '" LIMIT 1');
$in['cnt']--;
}
}
}
unset($it);
header('Location: hostel_room.php?search=1&otdel='.$_GET['otdel'].'&place='.$_GET['place']);
unset($it);
header('Location: hostel_room.php?search=1&otdel=' . $_GET['otdel'] . '&place=' . $_GET['place']);
}
if($_GET['search']) {
$r = show_itm_hostel($user['id'], (int)$_GET['otdel'], (int)$_GET['place']);
if ($_GET['search']) {
$r = show_itm_hostel($user['id'], (int)$_GET['otdel'], (int)$_GET['place']);
}
#######
$w = (270*$d['mass']/get_meshok()); $w_a = 270-$w;
$h = (270*$in['cnt']/$count); $h_a = 270-$h;
$w = (270 * $d['mass'] / get_meshok());
$w_a = 270 - $w;
$h = (270 * $in['cnt'] / $count);
$h_a = 270 - $h;
#######
if($_GET['go_back'] == 1) {
mysql_query('UPDATE `users`,`online` SET `users`.`room` = 660, `online`.`room` = 660 WHERE `users`.`id` = "'.$user['id'].'" AND `online`.`id` = "'.$user['id'].'"');
header('Location: hostel.php');
if ($_GET['go_back'] == 1) {
mysql_query('UPDATE `users`,`online` SET `users`.`room` = 660, `online`.`room` = 660 WHERE `users`.`id` = "' . $user['id'] . '" AND `online`.`id` = "' . $user['id'] . '"');
header('Location: hostel.php');
}
Template::header('hostel_room');
?>
<!doctype html>
<html>
<head>
<title>404</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="content-language" content="ru" />
<script src="js/ajaxLoad.js"></script>
<link rel="stylesheet" type="text/css" href="css/hostel.css" />
</head>
<body>
<div class="contentContainer" id="hostelContainer">
<div id="systemMsg" class="system-msg"></div><div class="buttonContainer">
<input type="button" class="btns" value="Обновить" onclick="location.href='hostel_room.php';" />
<input type="button" class="btns button-route" value="Спуститься" onclick="location.href='?go_back=1';" />
<h1>Комнатуха</h1>
</div>
<style type="text/css">
.hides {
display: none;
}
#hstInventory td.item {
width: 85%;
}
#hstInventory td.links {
text-align:center;
vertical-align:middle;
width:117px;
}
#hstInventory td.links span {
display: block;
}
#hstInventory td.original span.pk-current{
display:none;
}
#hstInventory td.moved {
font-weight: bold;
}
#hstInventory td.odd {
background-color: #c7c7c7;
}
#hstInventory td.even {
background-color: #d5d5d5;
}
<script src="js/ajaxLoad.js"></script>
<link rel="stylesheet" type="text/css" href="css/hostel.css"/>
<div class="contentContainer" id="hostelContainer">
<div id="systemMsg" class="system-msg"></div>
<div class="buttonContainer">
<input type="button" class="btns" value="Обновить" onclick="location.href='hostel_room.php';"/>
<input type="button" class="btns button-route" value="Спуститься" onclick="location.href='?go_back=1';"/>
<h1>Комнатуха</h1>
</div>
<style type="text/css">
.hides {
display: none;
}
label{
font-weight: bold;
margin-right:15px;
}
</style>
<script>
function hide_this(id) {
const node = document.getElementById(id);
if(node) {
node.style.display = 'none';
}
}
</script>
<div style="overflow: hidden;">
<fieldset id="hstInventoryA" style="width: 377px; float: left; text-align: center;">
<legend>Фильтр инвентаря</legend>
<div style="height: 53px">
<form method="GET">
<input type="radio" class="radio" id="hstF1" name="place" value="2" /><label for="hstF1">мешок</label>
<input type="radio" class="radio" id="hstF2" name="place" value="1" /><label for="hstF2">сундук</label>
#hstInventory td.item {
width: 85%;
}
<div style="height: 5px;overflow: hidden;"></div>
<select name="otdel">
<option value="-1">&nbsp;</option>
<optgroup label="Оружие">
<option value="1">кастеты,ножи</option>
<option value="11">топоры</option>
<option value="12">дубины,булавы</option>
<option value="13">мечи</option>
</optgroup>
<optgroup label="Одежда">
<option value="2">сапоги</option>
<option value="21">перчатки</option>
<option value="22">легкая броня</option>
<option value="23">тяжелая броня</option>
<option value="24">шлемы</option>
</optgroup>
<optgroup label="Щиты">
<option value="3">щиты</option>
</optgroup>
<optgroup label="Ювелирные товары">
<option value="4">серьги</option>
<option value="41">ожерелья</option>
<option value="42">кольца</option>
</optgroup>
<optgroup label="Заклинания">
<option value="5">нейтральные</option>
<option value="51">боевые и защитные</option>
</optgroup>
<optgroup label="Амуниция">
<option value="6">амуниция</option>
</optgroup>
</select>&nbsp;
<input type="submit" class="button" style="margin-right: 20px;" value="Поиск" name="search" />
</form>
</div>
</fieldset>
<fieldset id="hstInventoryB"><legend>Состояние</legend>
<div style="height: 53px">
<div class="progressBar" style='height:14px'><img title="Мешок за спиной" src="/i/bag.gif" height="14px"><img title="Мешок за спиной" src="/i/660000.gif" style="width: <?=$w;?>px; height: 14px;"><img title="Мешок за спиной" src="/i/1silver.gif" style=" width: <?=$w_a;?>px; height:14px"><tt style="font-size:13px"> <?=$d['mass'];?>/<?=get_meshok()?></tt></div><div class="progressBar" style='height:14px'><img title="Заполнение сундука" src="/i/chest.gif" height="14px"><img title="Заполнение сундука" src="/i/1blue.gif" style=" width: <?=$h;?>px; height:14px"><img title="Заполнение сундука" src="/i/1silver.gif" style=" width: <?=$h_a;?>px; height:14px"><tt style="font-size:13px"> <?=$in['cnt'];?>/<?=$count;?></tt></div></div>
</fieldset>
</div>
#hstInventory td.links {
text-align: center;
vertical-align: middle;
width: 117px;
}
<div id="hstInventory" style="width: 100%; background-color: #a5a5a5;">
<?=$r;?>
</div>
<center><? if($error != '') { echo '<br /><b style=\'color: Red;\'>'.$error.'</b>'; } ?></center>
</body>
</html>
#hstInventory td.links span {
display: block;
}
#hstInventory td.original span.pk-current {
display: none;
}
#hstInventory td.moved {
font-weight: bold;
}
#hstInventory td.odd {
background-color: #c7c7c7;
}
#hstInventory td.even {
background-color: #d5d5d5;
}
label {
font-weight: bold;
margin-right: 15px;
}
</style>
<script>
function hide_this(id) {
const node = document.getElementById(id);
if (node) {
node.style.display = 'none';
}
}
</script>
<div style="overflow: hidden;">
<fieldset id="hstInventoryA" style="width: 377px; float: left; text-align: center;">
<legend>Фильтр инвентаря</legend>
<div style="height: 53px">
<form method="GET">
<input type="radio" class="radio" id="hstF1" name="place" value="2"/><label
for="hstF1">мешок</label>
<input type="radio" class="radio" id="hstF2" name="place" value="1"/><label
for="hstF2">сундук</label>
<div style="height: 5px;overflow: hidden;"></div>
<select name="otdel">
<option value="-1">&nbsp;</option>
<optgroup label="Оружие">
<option value="1">кастеты,ножи</option>
<option value="11">топоры</option>
<option value="12">дубины,булавы</option>
<option value="13">мечи</option>
</optgroup>
<optgroup label="Одежда">
<option value="2">сапоги</option>
<option value="21">перчатки</option>
<option value="22">легкая броня</option>
<option value="23">тяжелая броня</option>
<option value="24">шлемы</option>
</optgroup>
<optgroup label="Щиты">
<option value="3">щиты</option>
</optgroup>
<optgroup label="Ювелирные товары">
<option value="4">серьги</option>
<option value="41">ожерелья</option>
<option value="42">кольца</option>
</optgroup>
<optgroup label="Заклинания">
<option value="5">нейтральные</option>
<option value="51">боевые и защитные</option>
</optgroup>
<optgroup label="Амуниция">
<option value="6">амуниция</option>
</optgroup>
</select>&nbsp;
<input type="submit" class="button" style="margin-right: 20px;" value="Поиск" name="search"/>
</form>
</div>
</fieldset>
<fieldset id="hstInventoryB">
<legend>Состояние</legend>
<div style="height: 53px">
<div class="progressBar" style='height:14px'><img title="Мешок за спиной" src="/i/bag.gif"
height="14px"><img title="Мешок за спиной"
src="/i/660000.gif"
style="width: <?= $w; ?>px; height: 14px;"><img
title="Мешок за спиной" src="/i/1silver.gif"
style=" width: <?= $w_a; ?>px; height:14px"><tt
style="font-size:13px"> <?= $d['mass']; ?>/<?= get_meshok() ?></tt></div>
<div class="progressBar" style='height:14px'><img title="Заполнение сундука" src="/i/chest.gif"
height="14px"><img title="Заполнение сундука"
src="/i/1blue.gif"
style=" width: <?= $h; ?>px; height:14px"><img
title="Заполнение сундука" src="/i/1silver.gif"
style=" width: <?= $h_a; ?>px; height:14px"><tt
style="font-size:13px"> <?= $in['cnt']; ?>/<?= $count; ?></tt></div>
</div>
</fieldset>
</div>
<div id="hstInventory" style="width: 100%; background-color: #a5a5a5;">
<?= $r; ?>
</div>
<?php
if (!empty($error)) {
echo sprintf('<div style="text-align: center; font-weight: bold; color: #f80000;">%s</div>', $error);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 839 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Some files were not shown because too many files have changed in this diff Show More