Регистратура объединяется со вкладкой кланы. #54. Closes #56.

This commit is contained in:
Ivor Barhansky 2023-07-19 15:36:13 +03:00
parent 1500eb9364
commit 92772463e6
22 changed files with 844 additions and 522 deletions

View File

@ -3,8 +3,8 @@
use Core\Config;
use Insallah\Tournaments\Tournament;
error_reporting(E_ALL ^ E_NOTICE);
ini_set('display_errors', 'Off');
//error_reporting(E_ALL);
date_default_timezone_set('Europe/Moscow');
header('Cache-Control: no-cache, no-store, must-revalidate');

View File

@ -1,5 +1,6 @@
<?php
//error_reporting(E_ALL);
const GAME = true; // Для совместимости с этой "защитой".
const GAME_VERSION = 'alpha-7.4';
// Новая автозагрузка.

View File

@ -0,0 +1,13 @@
<?php
namespace Clan;
use Core\Db;
class ClanInfo
{
public static function isJoinable(string $name): bool
{
return Db::getValue('select count(name) from clan where name = ? and status = 1', [$name]) > 0;
}
}

View File

@ -14,7 +14,7 @@ class ItemStorage
private function isGoodForStorage(array $item, $userClanId): bool
{
if (empty($item['inslot']) || !empty($item['gift'])) {
$this->error = 'Ïðåäìåò íå íàéäåí.';
$this->error = 'Предмет не найден.';
}
$idata = ConversionHelper::dataStringToArray($item['data']);
if (
@ -23,10 +23,10 @@ class ItemStorage
!empty($idata['icos']) ||
!empty($idata['fromlaba'])
) {
$this->error = 'Ïðåäìåò íå ïîäõîäèò.';
$this->error = 'Предмет не подходит.';
}
if (!empty($idata['toclan']) && explode('#', $idata['toclan'])[0] == $userClanId) {
$this->error = 'Ïðåäìåò óæå ïðèíàäëåæèò êëàíó.';
$this->error = 'Предмет уже принадлежит клану.';
}
return empty($this->error);
}
@ -37,7 +37,7 @@ class ItemStorage
$item = ItemsModel::getOwnedItemById($itemId, $user['id']);
$clanName = Db::getValue('select name from clan where id = ?', [$clanId]) ?? '';
if (empty($clanName)) {
return 'Êëàí íå íàéäåí.';
return 'Клан не найден.';
}
if (!$this->isGoodForStorage($item, $user['clan'])) {
return $this->error;
@ -50,7 +50,7 @@ class ItemStorage
User::start()->addDelo(
2,
$user['id'],
'&quot;System.transfer.MONEY&quot;: Ïðåäìåò &quot;' . $item['name'] . '&quot; (#id : "' . $itemId . '") (x' . $col . ') áûë ïîæåðòâîâàí êëàíó &quot;' . $clanName . '&quot; (' . $clanId . ').',
'&quot;System.transfer.MONEY&quot;: Предмет &quot;' . $item['name'] . '&quot; (#id : "' . $itemId . '") (x' . $col . ') был пожертвован клану &quot;' . $clanName . '&quot; (' . $clanId . ').',
time(),
$user['city'],
'System.transfer.clan',
@ -63,14 +63,14 @@ class ItemStorage
}
Db::sql(
'insert into clan_operations (clan, time, type, text, val, uid) values (?,unix_timestamp(),?,?,?,?)',
[$clanId, $sendType, $user['login'], $item['name'] . ("x$col Èä: [$itemId]"), $user['id']]
[$clanId, $sendType, $user['login'], $item['name'] . ("x$col Ид: [$itemId]"), $user['id']]
);
Db::sql(
'update items_users set lastUPD = unix_timestamp(), uid = ?, data = ? where id = ?',
['-21' . $user['clan'], $item['data'], $itemId]
);
return 'Âû ïåðåäàëè ïðåäìåò &quot;' . $item['name'] . '&quot; êëàíó.';
return 'Вы передали предмет &quot;' . $item['name'] . '&quot; клану.';
}
@ -86,7 +86,7 @@ class ItemStorage
mysql_query('SELECT `id`,`bot`,`clone` FROM `stats` WHERE `id` = "' . $itm_['uid'] . '" LIMIT 1')
);
if ($user_itm['bot'] > 0 || $user_itm['clone'] > 0 || !isset($user_itm['id'])) {
$r = '<font color="#FF0000"><strong>Âû íå ìîæåòå èçüÿòü äàííûé ïðåäìåò, îí íå ïðèíàäëåæèò êëàíó</strong></font><br />';
$r = '<font color="#FF0000"><strong>Вы не можете изьять данный предмет, он не принадлежит клану</strong></font><br />';
} elseif (isset($itm_['id'])) {
if ($itm_['inOdet'] != 0) {
@ -94,11 +94,11 @@ class ItemStorage
} else {
$o = '';
}
$r = '<font color="#FF0000"><strong>Âû óñïåøíî èçúÿëè ïðåäìåò &quot;' . $itm_['name'] . '&quot;</strong></font><br />';
$r = '<font color="#FF0000"><strong>Вы успешно изъяли предмет &quot;' . $itm_['name'] . '&quot;</strong></font><br />';
$col = $this->itemsX(((int)$id));
mysql_query(
'INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time(
) . '", "6", "' . $user['login'] . '", "' . $itm_['name'] . ' (x' . $col . ') Èä : [' . $id . '] | Ó ïåðñîíàæà : [' . $itm_['uid'] . ']", "' . $user['id'] . '")'
) . '", "6", "' . $user['login'] . '", "' . $itm_['name'] . ' (x' . $col . ') Ид : [' . $id . '] | У персонажа : [' . $itm_['uid'] . ']", "' . $user['id'] . '")'
);
mysql_query(
'UPDATE `items_users` SET `lastUPD` = "' . time(
@ -106,7 +106,7 @@ class ItemStorage
);
} else {
$r = '<font color="#FF0000"><strong>Ïðåäìåò íå íàéäåí.</strong></font><br />';
$r = '<font color="#FF0000"><strong>Предмет не найден.</strong></font><br />';
}
return $r;
}
@ -129,16 +129,16 @@ class ItemStorage
$col = $this->itemsX(((int)$id));
mysql_query(
'INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time(
) . '", "5", "' . $user['login'] . '", "' . $itm_['name'] . ' (x' . $col . ') Èä : [' . $id . '] Õîçÿèí : [' . $cls . ']", "' . $user['id'] . '")'
) . '", "5", "' . $user['login'] . '", "' . $itm_['name'] . ' (x' . $col . ') Ид : [' . $id . '] Хозяин : [' . $cls . ']", "' . $user['id'] . '")'
);
mysql_query(
'UPDATE `items_users` SET `lastUPD` = "' . time(
) . '", `uid` = "' . $user['id'] . '" WHERE `id` = "' . $id . '" LIMIT 1'
);
$r = '<font color="#FF0000"><strong>Âû óñïåøíî âçÿëè ïðåäìåò &quot;' . $itm_['name'] . '&quot; èç õðàíèëèùà</strong></font><br />';
$r = '<font color="#FF0000"><strong>Вы успешно взяли предмет &quot;' . $itm_['name'] . '&quot; из хранилища</strong></font><br />';
} else {
$r = '<font color="#FF0000"><strong>Ïðåäìåò íå íàéäåí.</strong></font><br />' . $id;
$r = '<font color="#FF0000"><strong>Предмет не найден.</strong></font><br />' . $id;
}
return $r;
}
@ -172,7 +172,7 @@ class ItemStorage
);
mysql_query(
'INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time(
) . '", "' . $type . '", "' . $user['login'] . '", "' . $it_n['name'] . ' (x' . $col . ') Èä : [' . $pl['id'] . ']", "' . $user['id'] . '")'
) . '", "' . $type . '", "' . $user['login'] . '", "' . $it_n['name'] . ' (x' . $col . ') Ид : [' . $pl['id'] . ']", "' . $user['id'] . '")'
);
} elseif ($pl['uid'] == $user['id']) {
$col = $this->itemsX(((int)$pl['id']));
@ -185,9 +185,9 @@ class ItemStorage
);
mysql_query(
'INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time(
) . '", "9", "' . $user['login'] . '", "' . $it_n['name'] . ' (x' . $col . ') Èä : [' . $pl['id'] . ']", "' . $user['id'] . '")'
) . '", "9", "' . $user['login'] . '", "' . $it_n['name'] . ' (x' . $col . ') Ид : [' . $pl['id'] . ']", "' . $user['id'] . '")'
);
}
}
}
}
}

View File

@ -0,0 +1,136 @@
<?php
namespace Clan;
use Core\Config;
use Core\Db;
use Uploader;
class Register
{
const REGISTER_COST_EKR = 50;
private string $name;
private int $align = 0;
private Uploader $logo;
private int $newClanId = 0;
/**
* @return int
*/
public function getNewClanId(): int
{
return $this->newClanId;
}
public function __construct()
{
if (!isset($_POST['newclanname'], $_POST['newclanalign'], $_FILES['newclanlogo'])) {
return;
}
$this->setName($_POST['newclanname']);
$this->setLogo();
$this->setAlign(intval($_POST['newclanalign']));
$this->new();
}
private function hasGoodName(): bool
{
return Db::getValue('select count(id) from clan where name = ?', [$this->name]) === 0;
}
public function new()
{
if (!$this->hasGoodName()) {
return;
}
$imageId = $this->logo->saveToDb();
if (!$imageId) {
echo $this->logo::$error;
return;
}
Db::sql('insert into clan (name, align, logo) values (?,?,?)', [$this->name, $this->align, $imageId]);
$this->newClanId = Db::lastInsertId();
}
public static function approve(int $clanId)
{
Db::sql('update clan set status = 1, time_reg = unix_timestamp() where id = ?', [$clanId]);
}
public static function reject(int $clanId)
{
Db::sql('delete from clan where id = ?', [$clanId]);
}
public static function printForm(): string
{
$img = Config::img() . '/i/align';
return <<<REGISTERFORM
<style>
div.regclangrid [type=radio] {
position: absolute;
opacity: 0;
width: 0;
height: 0;
}
/* IMAGE STYLES */
div.regclangrid [type=radio] + img {
cursor: pointer;
}
/* CHECKED STYLES */
div.regclangrid [type=radio]:checked + img {
outline: 1px solid brown;
padding: 2px;
}
div.regclangrid {
display: grid;
grid-template-columns: 100px auto;
}
</style>
<form method="POST" enctype="multipart/form-data">
<div class="regclangrid">
<div><label for="clanname">Название:</label></div>
<div><input name="newclanname" id="clanname"></div>
<div><label for="clanlogo">Логотип:</label></div>
<div><input type="file" name="newclanlogo" accept="image/*" id="newclanlogo"> размер: 24×15, формат: png или gif, до 30Кб</div>
<div>Склонность:</div>
<div>
<label><input type="radio" name="newclanalign" value="0" checked><img src="$img/align0.gif" alt="none"></label>
<label><input type="radio" name="newclanalign" value="1"><img src="$img/align1.gif" alt="light"></label>
<label><input type="radio" name="newclanalign" value="3"><img src="$img/align3.gif" alt="dark"></label>
<label><input type="radio" name="newclanalign" value="7"><img src="$img/align7.gif" alt="neutral"></label>
</div>
<div></div>
<div><button type="submit">Подать заявку</button></div>
</div>
</form>
REGISTERFORM;
}
private function setName(string $name)
{
$this->name = $name;
}
private function setAlign(int $align)
{
if (!in_array($align, [0, 1, 3, 7])) {
$align = 0;
}
$this->align = $align;
}
private function setLogo()
{
$this->logo = new Uploader('newclanlogo');
$this->logo->setMaxFileSize(.03);
$this->logo->setDimensions(24, 15);
$this->logo->setExtentions(['gif', 'png']);
}
}

View File

@ -2,7 +2,6 @@
namespace Core;
use Exception;
use PDO;
use PDOException;
use PDOStatement;
@ -15,14 +14,14 @@ class Db
/**
* DB constructor.
* @throws Exception
* @throws PDOException
*/
public function __construct()
{
try {
self::$db = Database::pdoinit();
} catch (PDOException $e) {
throw new Exception($e->getMessage());
throw new PDOException($e->getMessage());
}
}
@ -55,19 +54,20 @@ class Db
* @param string $query
* @return int
*/
static public function exec(string $query): int
public static function exec(string $query): int
{
self::init();
return self::$db->exec($query);
}
/**
* @param ?string $name [optional] Name of the sequence object from which the ID should be returned.
* @return string
*/
static public function lastInsertId(): string
public static function lastInsertId(?string $name = null): string
{
self::init();
return self::$db->lastInsertId();
return self::$db->lastInsertId($name);
}
/**

View File

@ -0,0 +1,27 @@
<?php
use Core\Db;
class Images
{
public static function getSrc(int $id): string
{
$i = Db::getRow('select mime_type, img from images where id = ?', [$id]);
return 'data:' . $i['mime_type'] . ';base64,' . base64_encode($i['img']);
}
public static function getSrcByName(string $name): string
{
$i = Db::getRow('select mime_type, img from images where id = (select logo from clan where name = ?)', [$name]);
return 'data:' . $i['mime_type'] . ';base64,' . base64_encode($i['img']);
}
public static function getJson(int $id)
{
$stmt = Db::getRow('select mime_type, img from images where id = ?', [$id]);
if (!$stmt) {
$stmt = [];
}
return json_encode($stmt);
}
}

View File

@ -1,5 +1,7 @@
<?php
use Core\Db;
/**
* Единая функция для заливки файлов на сервер.
*
@ -15,21 +17,29 @@ class Uploader
private string $savePath;
private string $extensions = 'jpg|png|jpeg|gif';
private array $extMatches = [];
private array $FILE;
private $cnm;
private array $file;
private string $customName;
public static string $error;
public function __construct($name, $cnm = null)
/**
* @param string $customName
*/
public function setCustomName(string $customName): void
{
$this->customName = $customName;
}
public function __construct($name)
{
if (!isset($_FILES[$name])) {
return;
}
$this->FILE = $_FILES[$name];
$this->cnm = $cnm;
$this->file = $_FILES[$name];
}
/**
* @param int $max
* @param int $max
* @param int|null $min
* @return void
*/
@ -40,7 +50,7 @@ class Uploader
}
/**
* @param int $max
* @param int $max
* @param int|null $min
* @return void
*/
@ -98,7 +108,7 @@ class Uploader
private function hasNormalDimensions(): bool
{
[$width, $height] = getimagesize($this->FILE['tmp_name']);
[$width, $height] = getimagesize($this->file['tmp_name']);
if (!$width || !$height) {
self::$error = 'Не подтянулись размеры файла.';
return false;
@ -123,7 +133,7 @@ class Uploader
if (!$this->maxFileSizeMb) {
$this->setMaxFileSize(2);
}
if ($this->FILE['size'] > $this->maxFileSizeMb * (1024 * 1024) || $this->FILE['size'] <= 0) {
if ($this->file['size'] > $this->maxFileSizeMb * (1024 * 1024) || $this->file['size'] <= 0) {
self::$error = 'Неверный размер файла. Максимальный размер файла ' . $this->maxFileSizeMb . ' МБ';
return false;
}
@ -133,8 +143,8 @@ class Uploader
private function hasNormalType(): bool
{
if (
!preg_match('/\.(' . $this->extensions . ')$/i', $this->FILE['name'], $this->extMatches) ||
!preg_match('/image/i', $this->FILE['type'])
!preg_match('/\.(' . $this->extensions . ')$/i', $this->file['name'], $this->extMatches) ||
!preg_match('/image/i', $this->file['type'])
) {
self::$error = 'Неверный тип файла. Допустимые типы : ' . $this->extensions;
return false;
@ -156,17 +166,25 @@ class Uploader
$this->extMatches[1] = strtolower($this->extMatches[1]);
$fn = uniqid('f_', true) . '.' . $this->extMatches[1];
$fn2 = uniqid('f_', true) . '.gif';
if ($this->cnm) {
$fn = $this->cnm;
$fn2 = $this->cnm;
if ($this->customName) {
$fn = $this->customName . '.' . pathinfo($this->file['name'], PATHINFO_EXTENSION);
$fn2 = $this->customName;
}
if (!move_uploaded_file($this->FILE['tmp_name'], $this->savePath . $fn)) {
if (!move_uploaded_file($this->file['tmp_name'], $this->savePath . $fn)) {
self::$error = 'Ошибка загрузки файла';
return false;
}
var_dump([$fn2, $fn, $this->savePath . $fn]);
return [$fn2, $fn, $this->savePath . $fn];
}
private function uploadToDatabase(): int
{
$id = time();
Db::sql('insert into images (mime_type, img, id) VALUES (?,?,?)', [$this->file['type'], file_get_contents($this->file['tmp_name']), $id]);
return $id;
}
public function saveimg()
{
return $this->hasNormalFilePath() &&
@ -174,4 +192,11 @@ class Uploader
$this->hasNormalFileSize() &&
$this->hasNormalType() ? $this->upload() : false;
}
}
public function saveToDb()
{
return $this->hasNormalDimensions() &&
$this->hasNormalFileSize() &&
$this->hasNormalType() ? $this->uploadToDatabase() : false;
}
}

View File

@ -1276,18 +1276,19 @@ class User
return $plid;
}
public function microLogin2(array $userInfo): string
private function microLogin2(array $userInfo): string
{
$result = '';
if ($userInfo['align'] > 0) {
$result .= '<img src=' . Config::img() . '/i/align/align' . $userInfo['align'] . '.gif>';
}
if ($userInfo['clan'] > 0) {
$clanName = Db::getValue('select name_mini from clan where id = ?', [$userInfo['clan']]);
$result .= '<img src=' . Config::img() . '/i/clan/' . $clanName . '.gif>';
$result .= '<img src=' . Images::getSrc($userInfo['clan']) . ' alt="'. $userInfo['clanName'] .'">';
}
$result .= '<strong>' . $userInfo['login'] . '</strong>[' . $userInfo['level'] . ']';
$result .= '<a target=_blank href=/info/' . $userInfo['id'] . ' ><img src=' . Config::img() . '/i/inf_capitalcity.gif alt=""></a>';
if ($userInfo['login'] !== '<em>невидимка</em>') {
$result .= '<a target=_blank href=/info/' . $userInfo['id'] . ' ><img src=' . Config::img() . '/i/inf_capitalcity.gif alt=""></a>';
}
return $result;
}
@ -1298,33 +1299,17 @@ class User
} else {
$inf = Db::getRow(
'select
users.id,
invis,
users.align,
align2,
clan,
cityreg,
login,
users.level,
c.name_mini
from users left join clan as c on c.id = users.clan
where users.id = ?',
[$id]
users.id,
if(invis = 1 or invis < unix_timestamp(), login, ?) as login,
if(invis = 1 or invis < unix_timestamp(), users.align, 0) as align,
if(status > 0, clan, 0) as clan,
if(invis = 1 or invis < unix_timestamp(), users.level, ?) as level,
if(status > 0, clan.name, ?) as clanName
from users left join clan on clan.id = users.clan and status > 0 where users.id = ?',
['<em>невидимка</em>', '??', '', $id]
);
}
$r = '';
if (
isset($inf['id']) &&
(
($inf['invis'] < time() && $inf['invis'] !== 1) ||
($this->info['id'] == $inf['id'] && $nnz === 1)
)
) {
$r = $this->microLogin2($inf);
} else {
$r = '<strong><i>Невидимка</i></strong> [??]';
}
return $r;
return isset($inf['id']) ? $this->microLogin2($inf) : '';
}
public function testHome(): array

View File

@ -0,0 +1,90 @@
<?php
namespace User;
use Clan\ClanInfo;
use Core\Config;
use Core\Db;
use Images;
class Clan
{
private $userid;
private int $id = 0;
private ?string $name;
private ?int $align;
private ?int $logo;
private ?int $status;
public function __construct(array $userinfo)
{
$this->userid = $userinfo['id'];
if (isset($_POST['joinclan']) && ClanInfo::isJoinable($_POST['joinclan'])) {
$this->join($_POST['joinclan']);
exit('<script>window.location.replace("/main.php?clan=1");</script>');
}
$c = Db::getRow('select * from clan where id = ?', [$userinfo['clan']]);
if (!empty($c)) {
foreach ($c as $k => $v) {
$this->$k = $v;
}
}
}
private function join(string $clanname)
{
Db::sql('update users set clan = (select id from clan where clan.name = ?) where id = ?', [$clanname, $this->userid]);
}
public function getId(): int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function getAlign(): ?int
{
return $this->align;
}
public function printLogoImage(): string
{
return '<img style="vertical-align:text-bottom;" src = "'. Images::getSrc($this->logo) . '" width = "24px" height = "15px">';
}
public function getStatus(): ?int
{
return $this->status;
}
public function printClan()
{
echo '<img style="vertical-align:text-bottom;" src="' . Config::img() . '/i/align/align' . $this->getAlign() . '.gif" alt="Склонность">' . $this->printLogoImage() . $this->getName();
}
public function getLogo(): ?int
{
return $this->logo;
}
/**
* Клан зарегистрирован и подверждён.
* @return bool
*/
public function isRegistered(): bool
{
return !empty($this->id) && $this->status !== 0;
}
/**
* Клан зарегистрирован и ожидает подтверждения.
* @return bool
*/
public function isAwaitingConfirmation(): bool
{
return !empty($this->id) && $this->status === 0;
}
}

View File

@ -91,7 +91,6 @@ function delete_user_all( $uid , $login ) {
mysql_query('DELETE FROM `obraz` WHERE `uid` = "'.$uid.'" OR `login` = "'.$login.'"');
mysql_query('DELETE FROM `online` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `pirogi` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `post` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `reimage` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `rep` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `repass` WHERE `uid` = "'.$uid.'"');

View File

@ -32,6 +32,9 @@ $u = User::start();
$filter = new Filter();
$chat = new Chat();
$userclan = new \User\Clan($u->info);
ini_set('max_execution_time', '120');
if (isset($_GET['showcode'])) {
@ -58,6 +61,15 @@ if ($u->info['online'] < time() - 60) {
$u->stats = $u->getStats($u->info['id'], 0);
if (!isset($_COOKIE['d1c'])) {
$detect = new MobileDetect;
$deviceType = $detect->isMobile() ? $detect->isTablet() ? 'tablet' : 'phone' : 'computer';
$_COOKIE['d1c'] = $deviceType;
setcookie('d1c', $deviceType, (time() + 86400));
} else {
$deviceType = $_COOKIE['d1c'];
}
?>
<!DOCTYPE html>
<html lang="ru-RU">
@ -73,6 +85,8 @@ $u->stats = $u->getStats($u->info['id'], 0);
<script>
window.des = 1;
<?= $userclan->isRegistered() ? "const clanImage = '" . Images::getSrc($userclan->getLogo()) . "';" : 'let clanImage;' ?>
const c = {
noEr: 0,
noErTmr: 0,
@ -89,7 +103,7 @@ $u->stats = $u->getStats($u->info['id'], 0);
time: <?= time() ?>,
pl: 0,
align: <?= $u->info['align'] ?>,
clan: <?= $u->info['clan'] ?>,
clan: <?= $userclan->getId() ?>,
admin: <?= $u->info['admin'] ?>,
sound: 0,
money: <?= $u->info['money'] ?>
@ -150,19 +164,7 @@ $u->stats = $u->getStats($u->info['id'], 0);
<script type="text/javascript" src="js/trainingModals/registration/index.js"></script>
<?php
if (!isset($_COOKIE['d1c'])) {
$detect = new MobileDetect;
$deviceType = $detect->isMobile() ? $detect->isTablet() ? 'tablet' : 'phone' : 'computer';
$_COOKIE['d1c'] = $deviceType;
setcookie('d1c', $deviceType, (time() + 86400));
} else {
$deviceType = $_COOKIE['d1c'];
}
if ($deviceType == 'tablet' || $deviceType == 'phone'): ?>
<?php if ($deviceType == 'tablet' || $deviceType == 'phone'): ?>
<style>
#touchmain {
padding: 0;
@ -195,6 +197,7 @@ $u->stats = $u->getStats($u->info['id'], 0);
vertical-align: bottom;
}
/* Стили с динамически-генерируемым именем для telegraf.php */
#tgf_loadingLine {
height: 18px;
width: 100%;
@ -271,6 +274,7 @@ $u->stats = $u->getStats($u->info['id'], 0);
border-radius: 4px;
}
/* Стили с динамически-генерируемым именем для logs.php, btl_bac.php, location\btl_.php */
/* цвета команд */
.CSSteam0 {
font-weight: bold;
@ -994,13 +998,12 @@ $u->stats = $u->getStats($u->info['id'], 0);
</td>
<?php
}
if ($u->info['clan'] > 0) { ?>
<td style="width: 30px">
<img onClick="top.getUrl('main','main.php?clan=1&rnd='+c.rnd);" class="db cp" title="Клан"
src="<?= Config::img() ?>/i/buttons/chatBtn14.gif" alt="Клан">
</td>
<?php
}
?>
<td style="width: 30px">
<img onClick="top.getUrl('main','main.php?clan=1&rnd='+c.rnd);" class="db cp" title="Клан"
src="<?= Config::img() ?>/i/buttons/chatBtn14.gif" alt="Клан">
</td>
<?php
if ($u->info['admin'] > 0) { ?>
<td style="width: 30px">
<img onClick="top.getUrl('main','main.php?admin=1&rnd='+c.rnd);" class="db cp"

View File

@ -88,7 +88,6 @@ function delete_user_all( $uid , $login ) {
mysql_query('DELETE FROM `obraz` WHERE `uid` = "'.$uid.'" OR `login` = "'.$login.'"');
mysql_query('DELETE FROM `online` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `pirogi` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `post` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `reimage` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `rep` WHERE `uid` = "'.$uid.'"');
mysql_query('DELETE FROM `repass` WHERE `uid` = "'.$uid.'"');

View File

@ -318,7 +318,7 @@ const chat = {
gUser: function (data, ol) {
let rt = '';
// ["27205347","Merlin","8","1.99","Radminion","capitalcity","capitalcity","349","","","0","-4","0","0","","0",""]
function data_work(count) {
data[count] = data[count].replaceAll("\\", '\\\\');
data[count] = data[count].replaceAll("[s1;]", '"');
@ -329,64 +329,66 @@ const chat = {
data[count] = data[count].replaceAll(">", '');
}
if (data[1] !== undefined) {
rt = data[1];
if (rt === 'Администратор') rt = this.efftxt('fire', rt);
if (ol === true) {
rt = `<a href="javascript:void(0)" onClick="chat.addto(\'${data[1]}\',\'to\')">${rt}</a>`;
} else rt = `<b>${rt}</b>`;
if (data[13] !== 0) rt = `<span class="uCss${data[13]}">${rt}</span>`;
if (data[1] === undefined) {
return '<i>невидимка</i>[??]'
}
rt = data[1];
if (rt === 'Администратор') rt = this.efftxt('fire', rt);
if (ol === true) {
rt = `<a href="javascript:void(0)" onClick="chat.addto(\'${data[1]}\',\'to\')">${rt}</a>`;
} else rt = `<b>${rt}</b>`;
if (parseInt(data[13]) !== 0) rt = `<span class="uCss${data[13]}">${rt}</span>`;
if (data[10] > 0) {
rt = `<s onmouseout="top.hic()" onmousedown="top.hic()" onmouseover="top.hi(this,\'Персонаж был заблокирован\',event,3,1,1,2,\'\')">${rt}</s>`;
}
if (parseInt(data[10]) > 0) {
rt = `<s onmouseout="top.hic()" onmousedown="top.hic()" onmouseover="top.hi(this,\'Персонаж был заблокирован\',event,3,1,1,2,\'\')">${rt}</s>`;
}
if (data[8] !== 0) data_work(8)
else if (data[9] !== 0) data_work(9)
if (data[8] !== undefined) data_work(8)
else if (data[9] !== undefined) data_work(9)
// тут
function rtData(count) {
return rt = `<img alt="Склонность" height="15" src="${c.img2}/i/align/align${data[count]}.gif">${rt}`;
}
// тут
function rtData(count) {
return rt = `<img alt="Склонность" height="15" src="${c.img2}/i/align/align${data[count]}.gif">${rt}`;
}
if (data[4] !== 0) {
rt = `<a href="/clan/${data[4]}" title="${data[4]}" target="_blank"><img alt="Клан" width="24" height="15" src="${c.img2}/i/clan/${data[4]}.gif"></a>${rt}`;
}
if (parseInt(data[4]) !== 0 && clanImage !== undefined) {
//data:${c.clanImage.mime_type};base64,${c.clanImage.img}
rt = `<a href="/clan/${data[4]}" title="${data[4]}" target="_blank"><img alt="Клан" width="24" height="15" src="${clanImage}"></a>${rt}`;
}
if (data[16] > 0) rtData(16)
if (parseInt(data[16]) > 0) rtData(16)
rtData(3)
rtData(3)
if (c.lvl > -1) {
if (c.city === data[6]) {
if (data[12] > 0) {
rt = `<a href="javascript:void(0)" onClick="chat.addto(\'${data[1]}\',\'private\')"><img alt="Персонаж сражается" title="Персонаж сражается" src="${c.img2}/i/lock1.gif" width="20" height="15"></a>${rt}`;
} else {
rt = `<a href="javascript:void(0)" onClick="chat.addto(\'${data[1]}\',\'private\')"><img alt="Приват" src="${c.img2}/i/lock.gif" width="20" height="15"></a>${rt}`;
}
if (c.lvl > -1) {
if (c.city === data[6]) {
if (parseInt(data[12]) > 0) {
rt = `<a href="javascript:void(0)" onClick="chat.addto(\'${data[1]}\',\'private\')"><img alt="Персонаж сражается" title="Персонаж сражается" src="${c.img2}/i/lock1.gif" width="20" height="15"></a>${rt}`;
} else {
rt = `<img alt="Город" style="padding-right:3px;" onmouseout="top.hic()" onmousedown="top.hic()" onmouseover="top.hi(this,\'Персонаж сейчас в ${data[6]}\',event,3,1,1,2,\'\')" src="${c.img2}/i/city_ico/${data[6]}.gif" width="17" height="15">${rt}`;
rt = `<a href="javascript:void(0)" onClick="chat.addto(\'${data[1]}\',\'private\')"><img alt="Приват" src="${c.img2}/i/lock.gif" width="20" height="15"></a>${rt}`;
}
} else {
rt = `<img alt="Город" style="padding-right:3px;" onmouseout="top.hic()" onmousedown="top.hic()" onmouseover="top.hi(this,\'Персонаж сейчас в ${data[6]}\',event,3,1,1,2,\'\')" src="${c.img2}/i/city_ico/${data[6]}.gif" width="17" height="15">${rt}`;
}
rt += `[${data[2]}]<a href="${c.https}/info/${data[0]}" target="_blank"><img alt="Инф. о ${data[1]}" style="vertical-align:baseline" width="12" height="11" src="${c.img2}/i/inf_${data[5]}.gif" title="Инф. о ${data[1]}" /></a>`;
}
rt += `[${data[2]}]<a href="${c.https}/info/${data[0]}" target="_blank"><img alt="Инф. о ${data[1]}" style="vertical-align:baseline" width="12" height="11" src="${c.img2}/i/inf_${data[5]}.gif" title="Инф. о ${data[1]}" /></a>`;
if (data[11] > c.time) {
rt += ` <img alt="Кляп" id="img_molch${data[1]}" width="24" height="15" style="cursor:help" src="${c.img2}/i/sleep2.gif" onmouseout="top.hic()" onmousedown="top.hic()" onmouseover="top.hi(this,\'На персонажа наложено заклятие молчания.<br>Будет молчать еще <span id=\\\'molch${data[0]}\\\'>${this.timeOut(data[11])}</span>\',event,3,1,1,2,\'\');chat.justRefMolch(${data[0]})">`;
this.addRefMolch(data[0], data[11]);
}
if (parseInt(data[11]) > c.time) {
rt += ` <img alt="Кляп" id="img_molch${data[1]}" width="24" height="15" style="cursor:help" src="${c.img2}/i/sleep2.gif" onmouseout="top.hic()" onmousedown="top.hic()" onmouseover="top.hi(this,\'На персонажа наложено заклятие молчания.<br>Будет молчать еще <span id=\\\'molch${data[0]}\\\'>${this.timeOut(data[11])}</span>\',event,3,1,1,2,\'\');chat.justRefMolch(${data[0]})">`;
this.addRefMolch(data[0], data[11]);
}
if (data[14] !== "") {
rt += ` <img alt="Травма" width="24" height="15" style="cursor:help" src="${c.img2}/i/travma2.gif" onmouseout="top.hic()" onmousedown="top.hic()" onmouseover="top.hi(this,\'У персонажа ${data[14]}\',event,3,1,1,2,\'\');">`;
if (data[14] !== "") {
rt += ` <img alt="Травма" width="24" height="15" style="cursor:help" src="${c.img2}/i/travma2.gif" onmouseout="top.hic()" onmousedown="top.hic()" onmouseover="top.hi(this,\'У персонажа ${data[14]}\',event,3,1,1,2,\'\');">`;
}
if (parseInt(data[13]) > 0) {
if (parseInt(data[13]) === 2) {
rt += ` <a target="main" href="/main.php?atak_user=${data[0]}" title="Кровавое нападение на ${data[1]}"><img alt="" width="13" height="13" src="${c.img2}/i/clear.gif"></a>`;
} else {
rt += ` <a target="main" href="/main.php?atak_user=${data[0]}" title="Напасть на ${data[1]}"><img alt="" width="13" height="13" src="${c.img2}/i/curse_attack.gif"></a>`;
}
if (data[13] > 0) {
if (data[13] === 2) {
rt += ` <a target="main" href="/main.php?atak_user=${data[0]}" title="Кровавое нападение на ${data[1]}"><img alt="" width="13" height="13" src="${c.img2}/i/clear.gif"></a>`;
} else {
rt += ` <a target="main" href="/main.php?atak_user=${data[0]}" title="Напасть на ${data[1]}"><img alt="" width="13" height="13" src="${c.img2}/i/curse_attack.gif"></a>`;
}
}
if (data[15] === 1) rt = `<span class=woman >${rt}</span>`
} else rt = '<i>невидимка</i>[??]'
}
if (parseInt(data[15]) === 1) rt = `<span class=woman >${rt}</span>`
return rt;
}, mlch: {},
@ -937,6 +939,12 @@ const chat = {
if (data.list !== undefined && data.list !== null) { //делаем список людей онлайн
let jj;
i = 0;
/*{
"0":["27318846","Дмитрий","8","50","0","capitalcity","capitalcity","9","","","0","0","0","0","","0",""],
"1":["27205347","Merlin","8","1.99","Radminion","capitalcity","capitalcity","349","","","0","-4","0","0","","0",""]
} */
let ji = JSON.parse(data.list),
onll = '',
fSort = {},

View File

@ -408,7 +408,7 @@ if (isset($_GET['security']) && !isset($u->tfer['id']) && $trololo == 1) {
require_once('modules_data/_zv.php');
} elseif (isset($_GET['alh']) && !isset($u->tfer['id'])) {
require_once('modules_data/_alh.php');
} elseif ($u->info['clan'] > 0 && isset($_GET['clan']) && !isset($u->tfer['id'])) {
} elseif (isset($_GET['clan']) && !isset($u->tfer['id'])) {
require_once('modules_data/_clan.php'); //Панель кланов
} elseif (isset($_GET['alhp']) && ($u->info['admin'] == 1 || $u->info['align'] == 50) && !isset($u->tfer['id'])) {
require_once('modules_data/_alhp.php'); //Панель алхимиков

View File

@ -1,22 +1,41 @@
<?php
/* @var User $u */
use Clan\ItemStorage;
use Clan\Register;
use Core\Config;
use Core\ConversionHelper;
use Core\Db;
use User\Clan;
if (!defined('GAME')) {
die();
}
$res = mysql_fetch_array(
mysql_query("SELECT * FROM `clan` WHERE `id` = '" . mysql_real_escape_string($u->info['clan']) . "' LIMIT 1")
);
$cpr = explode('|', $u->info['clan_prava']);
if (!isset($res['id'])) {
die('Клан был расформирован.');
$userclan = new Clan($u->info);
$newclan = new Register();
if (!empty($newclan->getNewClanId())) {
Db::sql('update users set clan = ?, clan_delay = ?, clan_prava = ?, clan_zv = 0 where id = ?',
[$newclan->getNewClanId(), strtotime("+60 day"), 'glava', $u->info['id']]);
}
if (!isset($_GET['events']) && !isset($_GET['diplom']) && !isset($_GET['control']) && !isset($_GET['deposit']) && !isset($_GET['titul']) && !isset($_GET['rules']) && !isset($_GET['info']) && !isset($_GET['members'])) {
$res = Db::getRow('select * from clan where id = ?', [$u->info['clan']]);
$cpr = explode('|', $u->info['clan_prava']);
if (
!isset($_GET['events']) &&
!isset($_GET['diplom']) &&
!isset($_GET['control']) &&
!isset($_GET['deposit']) &&
!isset($_GET['titul']) &&
!isset($_GET['rules']) &&
!isset($_GET['info']) &&
!isset($_GET['members'])
) {
$_GET['events'] = 1;
}
$storage = new \Clan\ItemStorage();
$storage = new ItemStorage();
//Возможности текущего титула
$tt = [
@ -36,7 +55,6 @@ $tt = [
13 => [0, 'Управление клановыми союзами и альянсами'],
14 => [0, 'Обьявление войны'],
15 => [0, 0],
15 => [0, 0],
16 => [0, 0],
17 => [0, 0],
18 => [0, 0],
@ -119,9 +137,8 @@ $lvl_prava = [
]
?>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="/js/jquery.js"></script>
<style>
body {
background-image: url(//img.new-combats.tech/i/clanpanel/klan_img_44.jpg);
}
@ -187,8 +204,8 @@ $lvl_prava = [
.tabs ul {
list-style: none;
float: left;
margin: 0px;
padding: 0px;
margin: 0;
padding: 0;
}
.name {
@ -292,23 +309,18 @@ $lvl_prava = [
padding-top: 25px;
}
.eventsblock {
}
.legtitle {
font-weight: bold;
padding: 0px 5px 0px 5px;
padding: 0 5px;
color: #990000;
}
.legcontent {
padding: 0px 5px 0px 5px;
padding: 0 5px;
}
.section {
width: 100%;
margin: 0 0 30px;
}
@ -316,8 +328,8 @@ $lvl_prava = [
height: 28px;
line-height: 25px;
list-style: none;
margin: 0px;
padding: 0px;
margin: 0;
padding: 0;
font-size: 10px;
color: #666;
}
@ -334,25 +346,16 @@ $lvl_prava = [
font-size: 10px;
}
.tabs li:hover,
.vertical .tabs li:hover {
}
li.current a {
color: #333333;
font-size: 10px;
}
.box {
width: 100%;
float: left;
display: none;
padding-top: 25px;
}
.box.visible {
@ -360,44 +363,39 @@ $lvl_prava = [
}
.modpow {
background-color: #ddd5bf;
}
.mt {
background-color: #b1a993;
padding-left: 10px;
padding-right: 10px;
padding-top: 5px;
padding-bottom: 5px;
padding: 5px 10px;
}
.md {
padding: 10px;
}
</style>
<script>
function openMod(title, dat) {
var d = document.getElementById('useMagic');
if (d != undefined) {
document.getElementById('modtitle').innerHTML = '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top">' + title + '</td><td width="30" valign="top"><div align="right"><a title="Закрыть" onClick="closeMod(); return false;" href="#">x</a></div></td></tr></table>';
document.getElementById('modtitle').innerHTML =
'<table width="100%" border="0" cellspacing="0" cellpadding="0">' +
'<tr>' +
'<td valign="top">' + title + '</td>' +
'<td width="30" valign="top">' +
'<div align="right">' +
'<a title="Закрыть" onClick="closeMod(); return false;" href="#">x</a>' +
'</div>' +
'</td>' +
'</tr>' +
'</table>';
document.getElementById('moddata').innerHTML = dat;
d.style.display = '';
}
}
function closeMod() {
var d = document.getElementById('useMagic');
if (d != undefined) {
@ -409,32 +407,132 @@ $lvl_prava = [
function addNewEvent() {
openMod('Добавить событие',
'<form method="post" action="main.php?clan&events&add=<?=$code?>">Заголовок: <input name="titleadd" value="" style="width:335px;" type="text"><br><textarea name="textadd" style="width:412px;" rows="5"></textarea><br><div align="right"><input type="submit" value="Добавить событие"></div></form>');
'<form method="post" action="main.php?clan&events&add=<?=$code?>">" +
"Заголовок: <input name="
titleadd
" value="
" style="
335
px;
" type="
text
"><br>" +
"<textarea name="
textadd
" style="
412
px;
" rows="
5
"></textarea><br>" +
"<div align="
right
"><input type="
submit
" value="
Добавить
событие
"></div>" +
"</form>');
}
function addNewTitul() {
openMod('Добавить титул',
'<form method="post" action="main.php?clan&titul&add=<?=$code?>">Название титула: <input name="tituladd" value="" style="width:235px;" type="text"><br><small style="float:left">(не более 30-ти символов)</small><input style="float:right" type="submit" value="Добавить титул"></div></form>');
'<form method="post" action="main.php?clan&titul&add=<?=$code?>">" +
"Название титула: <input name="
tituladd
" value="
" style="
235
px;
" type="
text
"><br>" +
"<small style="
left
">(не более 30-ти символов)</small>" +
"<input style="
right
" type="
submit
" value="
Добавить
титул
">" +
"</div>" +
"</form>');
}
// С этим мигающим кулаком надо что-то делать..
document.getElementById('se-pre-con').parentNode.removeChild(document.getElementById('se-pre-con'));
</script>
<div style="text-align: right;">
<input type="button" class="btn" value="Обновить" onclick="location='main.php?clan=1';">
<input type="button" class="btn" value="Вернуться" onclick="location='main.php';">
</div>
<div id="useMagic" style="display:none; position:absolute; border:solid 1px #776f59; left: 50px; top: 186px;"
class="modpow">
<div class="mt" id="modtitle"></div>
<div class="md" id="moddata"></div>
</div>
<input style="float:right;margin:1px" type="button" value="Вернуться" onClick="document.location='main.php'">
<input style="float:right;margin:1px" type="button" value="Обновить"
onClick="document.location='<?= $_SERVER['REQUEST_URI'] ?>'">
<?php
if ($userclan->isAwaitingConfirmation()) {
exit('<div>Заявка на регистрацию клана '. $userclan->printClan() .' в процессе рассмотрения.</div>');
}
if (!isset($res['id'])) {
$clans = Db::getRows('select name, align, level from clan where status = 1 order by align, level desc, name');
?>
<script>document.getElementById('se-pre-con').parentNode.removeChild(document.getElementById('se-pre-con'));</script>
<div style="text-align: right;">
<input type="button" class="btn" value="Обновить" onclick="location='main.php?clan=1';">
<input type="button" class="btn" value="Вернуться" onclick="location='main.php';">
</div>
<div>Вы можете вступить в один из существующих кланов, либо же создать свой.</div>
<div style="border: 1px solid seashell; margin: 10px 0; padding: 0 10px;">
<h3>Заявка на регистрацию клана</h3>
<ul style="list-style: circle">
<li>При подаче заявки с вас снимается сумма необходимая для регистрации клана.</li>
<li>В случаи отказа в регистрации клана (по любой причине), еврокредиты возвращаются персонажу.</li>
<li>Администрация вправе отказать в регистрации без объяснения причин.</li>
<li style="color: crimson;">При регистрации клана, глава клана в течении 60 дней не имеет право передавать своё главенство другому игроку.</li>
<li>Стоимость регистрации клана: <?= Register::REGISTER_COST_EKR ?> екр.</li>
</ul>
<div style="margin: 0 50px;">
<?php if (Register::REGISTER_COST_EKR > $u->info['money2']): ?>
<span style="color: red">× У вас недостаточно еврокредитов! В наличии: <?= $u->info['money2'] ?> екр.</span>
<?php else: ?>
<?= Register::printForm() ?>
<?php endif; ?>
</div>
Дописать сам факт регистрации.
</div>
<div style="border: 1px solid seashell; margin: 10px 0; padding: 0 10px;">
<h3>Заявка на вступление в клан</h3>
<form method="post">
<?php foreach ($clans as $clan): ?>
<label>
<input type="radio" name="joinclan" value="<?= $clan['name'] ?>">
<img src="<?= Config::img() ?>/i/align/align<?= $clan['align'] ?>.gif" alt="Склонность"> <?= $clan['name'] ?> [<?= $clan['level'] ?>]
</label><br>
<?php endforeach; ?>
<button type="submit">Подать заявку</button>
</form>
Дописать логотип и, собственно, вступление.
</div>
<?php
exit;
}
?>
<?php
if ($u->info['clan_prava'] != 'glava') {
if (isset($_GET['clan_exit']) && $u->newAct($_GET['sd4']) == true) {
if ($u->info['money'] >= 50) {
$txt = 'Игрок <img src="//img.new-combats.tech/i/align/align' . $u->info['align'] . '.gif" style="vertical-align:bottom"><img src="//img.new-combats.tech/i/clan/' . $res['name'] . '.gif" style="vertical-align:bottom"><a href="javascript:void(0)">' . $u->info['login'] . '</a>[' . $u->info['level'] . ']<a target="_blank" title="Инф. о ' . $u->info['login'] . '" href="info/' . $u->info['id'] . '"><img src="//img.new-combats.tech/i/inf_' . $u->info['cityreg'] . '.gif"></a> покинул клан. (50 кр.)';
mysql_query(
'INSERT INTO `clan_news` (`clan`, `time`, `ddmmyyyy`, `uid`, `ip`, `login`, `title`, `text`) VALUES ("' . $res['id'] . '", "' . time(
) . '", "' . date(
'INSERT INTO `clan_news` (`clan`, `time`, `ddmmyyyy`, `uid`, `ip`, `login`, `title`, `text`) VALUES ("' . $res['id'] . '", "' . time() . '", "' . date(
'd.m.Y'
) . '", "0", "127.0.0.1", "Администрация", "Клановое сообщение", "' . mysql_real_escape_string(
$txt
@ -446,8 +544,7 @@ if ($u->info['clan_prava'] != 'glava') {
);
} else {
mysql_query(
'UPDATE `users` SET `palpro` = 0, `clan` = 0, `clan_zv` = 0, `align` = 0, `clan_prava` = "0|0|0|0", `money` = `money` - 50 , `clan_delay` = "' . time(
) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
'UPDATE `users` SET `palpro` = 0, `clan` = 0, `clan_zv` = 0, `align` = 0, `clan_prava` = "0|0|0|0", `money` = `money` - 50 , `clan_delay` = "' . time() . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
);
}
$ar = $u->rem_itm_cl($u->info, $res['id'], 7);
@ -577,8 +674,7 @@ if ($u->info['clan_prava'] != 'glava') {
if (isset($_GET['add'], $_POST['textadd']) && $tt[2][0] == 1) {
$lmsg = mysql_fetch_array(
mysql_query(
'SELECT `id` FROM `clan_news` WHERE `uid` = "' . $u->info['id'] . '" AND `time` > ' . (time(
) - 10) . ' LIMIT 1'
'SELECT `id` FROM `clan_news` WHERE `uid` = "' . $u->info['id'] . '" AND `time` > ' . (time() - 10) . ' LIMIT 1'
)
);
if (isset($lmsg['id'])) {
@ -859,7 +955,7 @@ if ($u->info['clan_prava'] != 'glava') {
$c_pr = [
100, //принять
50, //выгнать
100 //сменить главу
100, //сменить главу
];
if (isset($_POST['svb_canals']) && $tt[11][0] == 1) {
@ -911,8 +1007,7 @@ if ($u->info['clan_prava'] != 'glava') {
) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
);
mysql_query(
'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time(
) . '","1","' . $u->info['login'] . '","' . mysql_real_escape_string(
'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time() . '","1","' . $u->info['login'] . '","' . mysql_real_escape_string(
$mn
) . '","' . $u->info['id'] . '")'
);
@ -939,8 +1034,7 @@ if ($u->info['clan_prava'] != 'glava') {
) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
);
mysql_query(
'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time(
) . '","3","' . $u->info['login'] . '","' . (mysql_real_escape_string(
'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time() . '","3","' . $u->info['login'] . '","' . (mysql_real_escape_string(
$mn
) * -1) . '","' . $u->info['id'] . '")'
);
@ -969,8 +1063,7 @@ if ($u->info['clan_prava'] != 'glava') {
) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
);
mysql_query(
'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time(
) . '","2","' . $u->info['login'] . '","' . mysql_real_escape_string(
'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time() . '","2","' . $u->info['login'] . '","' . mysql_real_escape_string(
$mn
) . '","' . $u->info['id'] . '")'
);
@ -1007,8 +1100,7 @@ if ($u->info['clan_prava'] != 'glava') {
) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
);
mysql_query(
'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time(
) . '","3","' . $u->info['login'] . '","' . mysql_real_escape_string(
'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time() . '","3","' . $u->info['login'] . '","' . mysql_real_escape_string(
$mn
) . '","' . $u->info['id'] . '")'
);
@ -1041,8 +1133,7 @@ if ($u->info['clan_prava'] != 'glava') {
);
} else {
mysql_query(
'UPDATE `users` SET `palpro` = 0, `clan_prava` = 0, `clan` = 0, `clan_zv` = 0, `mod_zvanie` = "", `align` = 0, `clan_delay` = "' . time(
) . '" WHERE `id` = "' . $usr['id'] . '" LIMIT 1'
'UPDATE `users` SET `palpro` = 0, `clan_prava` = 0, `clan` = 0, `clan_zv` = 0, `mod_zvanie` = "", `align` = 0, `clan_delay` = "' . time() . '" WHERE `id` = "' . $usr['id'] . '" LIMIT 1'
);
}
$u->info['money'] -= $c_pr[1];
@ -1589,8 +1680,7 @@ if ($u->info['clan_prava'] != 'glava') {
} else {
$lwar = mysql_fetch_array(
mysql_query(
'SELECT * FROM `clan_wars` WHERE `time_finish` > ' . time(
) . ' AND ((`clan1` = "' . $cln['id'] . '" AND `clan2` = "' . $res['id'] . '") OR (`clan2` = "' . $cln['id'] . '" AND `clan1` = "' . $res['id'] . '")) LIMIT 1 '
'SELECT * FROM `clan_wars` WHERE `time_finish` > ' . time() . ' AND ((`clan1` = "' . $cln['id'] . '" AND `clan2` = "' . $res['id'] . '") OR (`clan2` = "' . $cln['id'] . '" AND `clan1` = "' . $res['id'] . '")) LIMIT 1 '
)
);
if (!isset($lwar['id'])) {
@ -1609,12 +1699,10 @@ if ($u->info['clan_prava'] != 'glava') {
'UPDATE `clan` SET `money2` = `money2` - ' . $mkr . ' WHERE `id` = "' . $res['id'] . '" LIMIT 1'
);
mysql_query(
'INSERT INTO `clan_wars` (`clan1`,`clan2`,`time_start`,`time_finish`,`type`,`text`) VALUES ("' . $res['id'] . '","' . $cln['id'] . '","' . time(
) . '","' . (time() + 60 * 60 * 24) . '","' . $tpcw . '","Война!")'
'INSERT INTO `clan_wars` (`clan1`,`clan2`,`time_start`,`time_finish`,`type`,`text`) VALUES ("' . $res['id'] . '","' . $cln['id'] . '","' . time() . '","' . (time() + 60 * 60 * 24) . '","' . $tpcw . '","Война!")'
);
mysql_query(
'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time(
) . '","4","' . $u->info['login'] . '","clanwar_' . $mkr . '_' . $cln['id'] . '","' . $u->info['id'] . '")'
'INSERT INTO `clan_operations` (`clan`,`time`,`type`,`text`,`val`,`uid`) VALUES ("' . $res['id'] . '","' . time() . '","4","' . $u->info['login'] . '","clanwar_' . $mkr . '_' . $cln['id'] . '","' . $u->info['id'] . '")'
);
echo '<font color="#FF0000"><b>Вы успешно обьявили войну клану &quot;' . $cln['name'] . '&quot; за ' . $mkr . ' екр.</b></font><br>';
}
@ -1635,8 +1723,7 @@ if ($u->info['clan_prava'] != 'glava') {
<?php
$warc = mysql_fetch_array(
mysql_query(
'SELECT COUNT(`id`) FROM `clan_wars` WHERE (`clan1` = "' . $res['id'] . '" OR `clan2` = "' . $res['id'] . '") AND `time_finish` > "' . time(
) . '" LIMIT 1'
'SELECT COUNT(`id`) FROM `clan_wars` WHERE (`clan1` = "' . $res['id'] . '" OR `clan2` = "' . $res['id'] . '") AND `time_finish` > "' . time() . '" LIMIT 1'
)
);
$warc = $warc[0];
@ -1658,8 +1745,7 @@ if ($u->info['clan_prava'] != 'glava') {
<?php
$ms = '';
$sp = mysql_query(
'SELECT * FROM `clan_wars` WHERE (`clan1` = "' . $res['id'] . '" OR `clan2` = "' . $res['id'] . '") AND `time_finish` > "' . time(
) . '"'
'SELECT * FROM `clan_wars` WHERE (`clan1` = "' . $res['id'] . '" OR `clan2` = "' . $res['id'] . '") AND `time_finish` > "' . time() . '"'
);
while ($pl = mysql_fetch_array($sp)) {
$cln1 = mysql_fetch_array(
@ -1716,8 +1802,7 @@ if ($u->info['clan_prava'] != 'glava') {
);
echo '<font color="#FF0000"><b>Вы успешно подали заявку в союз &quot;' . $cnm['name'] . '&quot;</b></font><br>';
mysql_query(
'INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`) VALUES ("' . $res['id'] . '","' . $cnm['id'] . '","' . time(
) . '","1")'
'INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`) VALUES ("' . $res['id'] . '","' . $cnm['id'] . '","' . time() . '","1")'
);
}
} else {
@ -1751,8 +1836,7 @@ if ($u->info['clan_prava'] != 'glava') {
);
echo '<font color="#FF0000"><b>Вы успешно подали заявку в альянс &quot;' . $cnm['name'] . '&quot;</b></font><br>';
mysql_query(
'INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`) VALUES ("' . $res['id'] . '","' . $cnm['id'] . '","' . time(
) . '","2")'
'INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`) VALUES ("' . $res['id'] . '","' . $cnm['id'] . '","' . time() . '","2")'
);
}
} else {
@ -1778,16 +1862,14 @@ if ($u->info['clan_prava'] != 'glava') {
);
if (!isset($cnm['id'])) {
mysql_query(
'INSERT INTO `clan_joint` (`time_open`,`name`,`type`,`clan_open`,`clan_glava`) VALUES ("' . time(
) . '","' . mysql_real_escape_string(
'INSERT INTO `clan_joint` (`time_open`,`name`,`type`,`clan_open`,`clan_glava`) VALUES ("' . time() . '","' . mysql_real_escape_string(
$nm
) . '","1","' . $res['id'] . '","' . $res['id'] . '")'
);
$id = mysql_insert_id();
$res['join1'] = $id;
mysql_query(
'INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`,`time_start`) VALUES ("' . $res['id'] . '","' . $id . '","' . time(
) . '","1","' . time() . '")'
'INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`,`time_start`) VALUES ("' . $res['id'] . '","' . $id . '","' . time() . '","1","' . time() . '")'
);
mysql_query(
'UPDATE `clan` SET `join1` = "' . $id . '" WHERE `id` = "' . $res['id'] . '" LIMIT 1'
@ -1818,16 +1900,14 @@ if ($u->info['clan_prava'] != 'glava') {
);
if (!isset($cnm['id'])) {
mysql_query(
'INSERT INTO `clan_joint` (`time_open`,`name`,`type`,`clan_open`,`clan_glava`) VALUES ("' . time(
) . '","' . mysql_real_escape_string(
'INSERT INTO `clan_joint` (`time_open`,`name`,`type`,`clan_open`,`clan_glava`) VALUES ("' . time() . '","' . mysql_real_escape_string(
$nm
) . '","2","' . $res['id'] . '","' . $res['id'] . '")'
);
$id = mysql_insert_id();
$res['join2'] = $id;
mysql_query(
'INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`,`time_start`) VALUES ("' . $res['id'] . '","' . $id . '","' . time(
) . '","2","' . time() . '")'
'INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`,`time_start`) VALUES ("' . $res['id'] . '","' . $id . '","' . time() . '","2","' . time() . '")'
);
mysql_query(
'UPDATE `clan` SET `join2` = "' . $id . '" WHERE `id` = "' . $res['id'] . '" LIMIT 1'
@ -1909,8 +1989,7 @@ if ($u->info['clan_prava'] != 'glava') {
);
$rzv = 'Союз <b>' . $szu['name'] . '</b> принял клан <b><img style="vertical-align:bottom" src="//img.new-combats.tech/i/clan/' . $zvy['name_mini'] . '.gif">' . $zvy['name'] . '</b>.';
mysql_query(
'UPDATE `clan_join` SET `time_end` = "' . time(
) . '" WHERE `id` != "' . $zvn['id'] . '" AND `clan` = "' . $szu['clan'] . '" AND `type` = "1"'
'UPDATE `clan_join` SET `time_end` = "' . time() . '" WHERE `id` != "' . $zvn['id'] . '" AND `clan` = "' . $szu['clan'] . '" AND `type` = "1"'
);
//mysql_query('INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`) VALUES ("'.$res['id'].'","'.$szu['id'].'","'.time().'","1")');
mysql_query(
@ -1926,8 +2005,7 @@ if ($u->info['clan_prava'] != 'glava') {
);
$rzv = 'Альянс <b>' . $szu['name'] . '</b> принял клан <b><img style="vertical-align:bottom" src="//img.new-combats.tech/i/clan/' . $zvy['name_mini'] . '.gif">' . $zvy['name'] . '</b>.';
mysql_query(
'UPDATE `clan_join` SET `time_end` = "' . time(
) . '" WHERE `id` != "' . $zvn['id'] . '" AND `clan` = "' . $szu['clan'] . '" AND `type` = "2" AND `time_end` = "0"'
'UPDATE `clan_join` SET `time_end` = "' . time() . '" WHERE `id` != "' . $zvn['id'] . '" AND `clan` = "' . $szu['clan'] . '" AND `type` = "2" AND `time_end` = "0"'
);
//mysql_query('INSERT INTO `clan_join` (`clan`,`alians`,`time`,`type`) VALUES ("'.$res['id'].'","'.$szu['id'].'","'.time().'","2")');
mysql_query(
@ -1986,8 +2064,7 @@ if ($u->info['clan_prava'] != 'glava') {
'UPDATE `clan` SET `join1` = "0" WHERE `id` = "' . $res['id'] . '" LIMIT 1'
);
mysql_query(
'UPDATE `clan_join` SET `time_end` = "' . time(
) . '" WHERE `id` = "' . $dels['id'] . '" LIMIT 1'
'UPDATE `clan_join` SET `time_end` = "' . time() . '" WHERE `id` = "' . $dels['id'] . '" LIMIT 1'
);
echo '<div><b><font color=red>Вы успешно покинули союз &quot;' . $j1['name'] . '&quot;</font></b></div>';
header('location: main.php?clan&diplom');
@ -2019,8 +2096,7 @@ if ($u->info['clan_prava'] != 'glava') {
'UPDATE `clan` SET `join1` = "0" WHERE `id` = "' . $dels['id'] . '" LIMIT 1'
);
mysql_query(
'UPDATE `clan_join` SET `time_end` = "' . time(
) . '" WHERE `id` = "' . $dels['id'] . '" LIMIT 1'
'UPDATE `clan_join` SET `time_end` = "' . time() . '" WHERE `id` = "' . $dels['id'] . '" LIMIT 1'
);
echo '<div><b><font color=red>Клан &quot;' . $delc['name'] . '&quot; был исключен из данного союза</font></b></div>';
header('location: main.php?clan&diplom');
@ -2256,7 +2332,9 @@ if ($u->info['clan_prava'] != 'glava') {
AND `iu`.`id` = "' . mysql_real_escape_string($_GET['ungive_itm']) . '" LIMIT 1'
)
);
$ps = \Core\ConversionHelper::dataStringToArray($itms['data']);
if (isset($itms['data'])) {
$ps = ConversionHelper::dataStringToArray($itms['data']);
}
$ps['cl'] = explode('#', $ps['toclan']);
$use_s = $ps['cl'][1];
if (isset($_GET['ungive_itm']) && $ps['cl'][0] == $res['id'] && ($tt[14][0] == 1 || ($u->info['id'] == $use_s))) {
@ -2372,8 +2450,7 @@ if ($u->info['clan_prava'] != 'glava') {
echo '<font color="#FF0000"><b>Название титула не должно быть пустым</b></font><br>';
} else {
mysql_query(
'INSERT INTO `clan_tituls` (`clan`,`user_add`,`time_add`,`name`) VALUES ("' . $res['id'] . '","' . $u->info['id'] . '","' . time(
) . '","' . mysql_real_escape_string($nm) . '")'
'INSERT INTO `clan_tituls` (`clan`,`user_add`,`time_add`,`name`) VALUES ("' . $res['id'] . '","' . $u->info['id'] . '","' . time() . '","' . mysql_real_escape_string($nm) . '")'
);
echo '<font color="#FF0000"><b>Титул был успешно добавлен</b></font><br>';
}
@ -2457,9 +2534,7 @@ if ($u->info['clan_prava'] != 'glava') {
while ($pl = mysql_fetch_array($sp)) {
?>
<div style="border-bottom:1px solid #cac9c7;margin-bottom:5px;padding-bottom:5px;">
<b style="color:#<?= $pl['color'] ?>">*</b> &nbsp; <a style="display:inline-block;width:250px;"
onclick="editTitul(<?= $pl['id'] ?>)"
<b style="color:#<?= $pl['color'] ?>">*</b> &nbsp; <a style="display:inline-block;width:250px;" onclick="editTitul(<?= $pl['id'] ?>)"
href="javascript:void(0)"><?= $pl['name'] ?></a><font
color="#999999"><i><?= $pl['info'] ?></i></font>
<img src="//img.new-combats.tech/i/clear.gif" title="Удалить титул"
@ -2991,4 +3066,4 @@ if ($u->info['clan_prava'] != 'glava') {
<?php } ?>
</div><!-- .section -->
</div><!-- .section -->

View File

@ -8,7 +8,7 @@ if (!defined('GAME')) {
$re = '';
if (isset($u->error2)) {
$re = $u->error2;
$re = '<b style="color: red;">' . $u->error . '</b>';
}
if (isset($_GET['nightatack'])) {

View File

@ -1628,10 +1628,6 @@ if (isset($p['id']) || $u->info['align'] == 1 || $u->info['align'] == 3) {
$cl['name']
) . '" OR `name_mini` = "' . mysql_real_escape_string(
$cl['name2']
) . '" OR `name_rus` = "' . mysql_real_escape_string(
$cl['name']
) . '" OR `name_rus` = "' . mysql_real_escape_string(
$cl['name2']
) . '" LIMIT 1'
);
if (!isset($pu['id'])) {
@ -1654,9 +1650,7 @@ if (isset($p['id']) || $u->info['align'] == 1 || $u->info['align'] == 3) {
'img.new-combats.com/i/clan/' . $cl['name2'] . '.gif'
)) {
$ins = mysql_query(
'INSERT INTO `clan` (`name`,`name_rus`,`name_mini`,`site`,`align`,`time_reg`) VALUES (
"' . $cl['name2'] . '",
"' . $cl['name'] . '",
'INSERT INTO `clan` (`name`,`site`,`align`,`time_reg`) VALUES (
"' . $cl['name2'] . '",
"' . $cl['site'] . '",
"' . $cl['align'] . '",
@ -1735,9 +1729,8 @@ if (isset($p['id']) || $u->info['align'] == 1 || $u->info['align'] == 3) {
$cmsg->setText("К сожалению Вам отказано в регистрации клана &quot;{$cl['name']}&quot;. Вам зачисленно 50 екр.");
$chat->sendMsg($cmsg);
//Отправляем сумму
mysql_query(
'UPDATE `users` SET `money2` = `money2` + 50 WHERE `id` = "' . $pu['id'] . '" LIMIT 1;'
);
$u->addEkr(50, $pu['id']);
$txt = 'Возврат за регистрацию клана от Администрации: <b>50</b> екр. Зачисленны: ' . date(
'd.m.Y H:i', time()
);

View File

@ -177,31 +177,15 @@ if (isset($_POST['clan_name'])) {
</table>
<?php
if ($u->info['clan'] > 0) {
$clan = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $u->info['clan'] . '" LIMIT 1'));
?>
Вы уже состоите в клане <b><?= $clan['name'] ?></b> и не можете подать заявку на регистрацию нового клана.<br><br>
<fieldset style="line-height:1.5em;border-color:#fff;">
<legend><h3>Клановые войны</h3></legend>
<?php
if ($u->info['clan_prava'] == 'glava') {
echo 'Нет ни одной войны, но вы можете обьявить её!';
} else {
echo 'Нет ни одной войны, но ваш глава клана может обьявить её!';
}
?>
</fieldset>
Вы уже состоите в клане и не можете подать заявку на регистрацию нового клана.<br><br>
<?php } else { ?>
<table width="100%" border="0" cellspacing="0" cellpadding="10">
<tr>
<td><p>Требования к значку: размер (ШхВ в пикселях) 24х15, графический тип GIF, размер до 30кб.</p>
<td><p>Требования к значку: размер (ШхВ в пикселях) 24х15, размер до 30кб.</p>
<p>
Стоимость регистрации кланов:<br>
<img src="//img.new-combats.tech/i/align/align7.gif" width="12" height="15"> нейтральный - 50
екр.<br>
<img src="//img.new-combats.tech/i/align/align1.gif" width="12" height="15"> светлый - 50
екр.<br>
<img src="//img.new-combats.tech/i/align/align3.gif" width="12" height="15"> тёмный - 50
екр.<br>
Стоимость регистрации кланов: 50 екр.<br>
</p>
<p>
Заявка на регистрацию подает будущий глава клана, у которого должна быть при себе необходимая сумма.
@ -289,4 +273,5 @@ if ($u->info['clan'] > 0) {
<b>При регистрации клана, глава клана в течении 60 дней не имеет право передавать своё главенство другому
игроку.</b>
</p>
<?php } ?>
<?php } ?>

View File

@ -199,11 +199,6 @@ function timeOut($ttm): string
src="//img.new-combats.tech/newyear2014.png" width="60"
height="90" title="" class="aFilter"/></div>
<?php } ?>
<div
style="position:absolute; left:360px; top:142px; width:111px; height:72px; z-index:92;">
<img <?php thisInfRm('1.180.0.226'); ?>
src="//img.new-combats.tech/city/capitalcity/day/2pochta.gif"
width="111" height="72" class="aFilter"/></div>
<div
style="position:absolute; left:33px; top:180px; width:92px; height:62px; z-index:92;">
<img <?php thisInfRm('1.180.0.14'); ?>
@ -284,11 +279,6 @@ function timeOut($ttm): string
href="#" id="greyText" class="menutop"
onclick="location='main.php?loc=1.180.0.14&rnd=<?= $code; ?>';"
title="<?php thisInfRm('1.180.0.14', 1); ?>">Вокзал</a></span>
<span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px"><img
src="//img.new-combats.tech/i/move/links.gif" width="9" height="7"/>&nbsp;<a
href="#" id="greyText" class="menutop"
onclick="location='main.php?loc=1.180.0.226&rnd=<?= $code; ?>';"
title="<?php thisInfRm('1.180.0.226', 1); ?>">Почта</a></span>
</div>
<!-- -->
<div style="display:none; height:0px " id="moveto"></div>

View File

@ -1,203 +1,213 @@
<?php
if(!defined('GAME'))
{
die();
use Core\Config;
if (!defined('GAME')) {
die();
}
$tattack = '';
$re = '<b style="color: red">' . $re . '</b>';
$tattack = '<a style="color:#D8D8D8" style="cursor:pointer" onclick="top.useMagic(\'Нападение на персонажа\',\'night_atack\',\'pal_button8.gif\',1,\'main.php?nightatack=1\');">Напасть</a> &nbsp; ';
if($u->room['file']=='cp2')
{
if(date("H")>=6 && date("H")<22) {
$now = 'day';
}else{
$now = 'night';
}
if ($u->room['file'] != 'cp2') {
return;
}
if (date("H") >= 6 && date("H") < 22) {
$now = 'day';
} else {
$now = 'night';
}
?>
<script>
<?php
if(date("H")<6 || date("H")>=22)
{
?>
function AtackNoWindow()
{
var dt = document.getElementById('atackDiv');
if(dt.style.display=='none')
{
dt.style.display = '';
}else{
dt.style.display = 'none';
}
}
<?php
}
?>
var no = 20; // snow number
var speed = 15; // smaller number moves the snow faster
var sp_rel = 1.4; //speed relevation
var snowflake1 = "/i/itimeges/snow1.gif";
var snowflake2 = "/i/itimeges/snow2.gif";
var i, doc_width, doc_height;
dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();
Array.prototype.exists = function(el)
{
for(var i=0;i<this.length;i++)
if(this[i]==el)
return true;
return false;
}
var rooms = ['0','1'];
function SetVariable(c) {
dx[c] = 0; // set coordinate variables
am[c] = Math.random()*15; // set amplitude variables
xp[c] = Math.random()*(doc_width-35) + 0 + am[c]; // set position variables
yp[c] = 0;
stx[c] = 0.02 + Math.random()/10; // set step variables
sty[c] = 0.7 + Math.random(); // set step variables
}
function DrawWeather(room) {
doc_width = document.getElementById('ione').width;
doc_height = document.getElementById('ione').height;
doc_width = 500;
doc_height = 268;
var div = '';
for (i = 0; i < no; ++ i) {
SetVariable(i);
div += "<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: 30" + i +"; VISIBILITY: visible; TOP: " + 0 + "px; LEFT: " + 0 + "px;\"><img id=\"im"+ i +"\" src=\"" + (sty[i]<sp_rel ? snowflake2 : snowflake1 ) + "\" border=\"0\" alt=\"Снежинка\"></div>";
}
document.getElementById('snow').innerHTML = div;
return 1;
}
function WeatherBegin() { // IE main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
yp[i] += sty[i] < sp_rel ? sty[i]/2 : sty[i];
if (yp[i] > doc_height-40) {
SetVariable(i);
var im = document.getElementById('im'+i);
im.src = (sty[i] < sp_rel) ? snowflake2 : snowflake1;
<?php
if(date("H") < 6 || date("H") >= 22)
{
?>
function AtackNoWindow() {
var dt = document.getElementById('atackDiv');
if (dt.style.display == 'none') {
dt.style.display = '';
} else {
dt.style.display = 'none';
}
dx[i] += stx[i];
document.getElementById('dot'+i).style.top = yp[i]+'px';
document.getElementById('dot'+i).style.left = xp[i] + am[i]*Math.sin(dx[i])+'px';
}
setTimeout('WeatherBegin()', speed);
}
<?php
}
?>
var no = 20; // snow number
var speed = 15; // smaller number moves the snow faster
var sp_rel = 1.4; //speed relevation
var snowflake1 = "/i/itimeges/snow1.gif";
var snowflake2 = "/i/itimeges/snow2.gif";
var i, doc_width, doc_height;
dx = [];
xp = [];
yp = [];
am = [];
stx = [];
sty = [];
Array.prototype.exists = function (el) {
for (var i = 0; i < this.length; i++)
if (this[i] == el)
return true;
return false;
}
var rooms = ['0', '1'];
function SetVariable(c) {
dx[c] = 0; // set coordinate variables
am[c] = Math.random() * 15; // set amplitude variables
xp[c] = Math.random() * (doc_width - 35) + am[c]; // set position variables
yp[c] = 0;
stx[c] = 0.02 + Math.random() / 10; // set step variables
sty[c] = 0.7 + Math.random(); // set step variables
}
function DrawWeather(room) {
doc_width = document.getElementById('ione').width;
doc_height = document.getElementById('ione').height;
doc_width = 500;
doc_height = 268;
var div = '';
for (i = 0; i < no; ++i) {
SetVariable(i);
div += "<div id=\"dot" + i + "\" style=\"POSITION: absolute; Z-INDEX: 30" + i + "; VISIBILITY: visible; TOP: " + 0 + "px; LEFT: " + 0 + "px;\"><img id=\"im" + i + "\" src=\"" + (sty[i] < sp_rel ? snowflake2 : snowflake1) + "\" border=\"0\" alt=\"Снежинка\"></div>";
}
document.getElementById('snow').innerHTML = div;
return 1;
}
function WeatherBegin() { // IE main animation function
for (i = 0; i < no; ++i) { // iterate for every dot
yp[i] += sty[i] < sp_rel ? sty[i] / 2 : sty[i];
if (yp[i] > doc_height - 40) {
SetVariable(i);
var im = document.getElementById('im' + i);
im.src = (sty[i] < sp_rel) ? snowflake2 : snowflake1;
}
dx[i] += stx[i];
document.getElementById('dot' + i).style.top = yp[i] + 'px';
document.getElementById('dot' + i).style.left = xp[i] + am[i] * Math.sin(dx[i]) + 'px';
}
setTimeout('WeatherBegin()', speed);
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="250" valign="top">
<?php $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
</td>
<td width="230" valign="top" style="padding-top:19px;"><?php require_once('modules_data/stats_loc.php'); ?></td>
<td valign="top"><div align="right">
<td valign="top"><div align="right">
<table border="0" cellpadding="0" cellspacing="0">
<tr align="right" valign="top">
<td>
<?php if($re!=''){ echo '<font color="red"><b>'.$re.'</b></font>'; } ?>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div style="position:relative; cursor: pointer;" id="ione">
<img src="//img.new-combats.tech/city/capitalcity/<?= $now; ?>/city_capres2.jpg" alt="" name="img_ione" width="500" height="268" border="1" id="img_ione"/>
<div id="buttons_on_image" style="cursor:pointer; font-weight:bold; color:#D8D8D8; font-size:10px;">
<?= $tattack; ?>
</div>
<script language="javascript" type="text/javascript">
<!--
if(document.getElementById('ione'))
{
<tr>
<td style="vertical-align: top; width: 250px;">
<?php $usee = $u->getInfoPers($u->info['id'], 0);
if ($usee) {
echo $usee[0];
} else {
echo 'information is lost.';
} ?>
</td>
<td style="padding-top:19px; vertical-align: top;"><?php require_once('modules_data/stats_loc.php'); ?></td>
<td style="vertical-align: top; width: 500px;">
<div style="text-align: right;">
<?= $re ?>
<div style="position:relative; cursor: pointer; width: 500px;" id="ione">
<img src="<?= Config::img() ?>/city/capitalcity/<?= $now; ?>/city_capres2.jpg" alt="" name="img_ione" width="500" height="268" border="1" id="img_ione"/>
<div id="buttons_on_image" style="cursor:pointer; font-weight:bold; color:#D8D8D8; font-size:10px;">
<a style="color:#D8D8D8; cursor: pointer;" onclick="top.useMagic('Нападение на персонажа','night_atack','pal_button8.gif',1,'main.php?nightatack=1');">Напасть</a>
</div>
<script>
if (document.getElementById('ione')) {
document.getElementById('ione').appendChild(document.getElementById('buttons_on_image'));
document.getElementById('buttons_on_image').style.position = 'absolute';
document.getElementById('buttons_on_image').style.bottom = '8px';
document.getElementById('buttons_on_image').style.right = '23px';
}else{
} else {
document.getElementById('buttons_on_image').style.display = 'none';
}
-->
</script>
<div style="position: absolute; left: 372px; top: 129px; width: 73px; height: 47px; z-index: 91;"><img <?php thisInfRm('1.180.0.13'); ?> src="//img.new-combats.tech/city/capitalcity/day/euroshop.gif" width="78" height="63" class="aFilter" /></div>
<div style="position: absolute; left: 179px; top: 13px; width: 73px; height: 47px; z-index: 92;"><img <?php thisInfRm('1.180.0.263'); ?> src="//img.new-combats.tech/city/capitalcity/day/1ubkill.gif" width="116" height="186" class="aFilter" /></div>
<div style="position: absolute; left: 104px; top: 115px; width: 73px; height: 47px; z-index: 89;"><img <?php thisInfRm('1.180.0.349'); ?> src="//img.new-combats.tech/city/capitalcity/day/1ureg.gif" width="106" height="73" class="aFilter" /></div>
<div style="position: absolute; left: 28px; top: 86px; width: 73px; height: 47px; z-index: 89;"><img <?php thisInfRm('1.180.0.214'); ?> src="//img.new-combats.tech/city/capitalcity/day/cp_hostel.gif" width="86" height="90" class="aFilter" /></div>
<div style="position: absolute; left: 69px; top: 159px; width: 73px; height: 47px; z-index: 89;"><img <?php thisInfRm('1.180.0.212'); ?> src="//img.new-combats.tech/city/capitalcity/day/flower_shop.gif" width="74" height="68" class="aFilter" /></div>
<div style="position:absolute; left:446px; top:153px; width:30px; height:54px; z-index:94;"><img <?php thisInfRm('1.180.0.213'); ?> src="//img.new-combats.tech/i/images/300x225/capital/2strelka.gif" width="30" height="54" class="aFilter" /></div>
<div style="position:absolute; left:16px; top:155px; width:30px; height:54px; z-index:910;"><img <?php thisInfRm('1.180.0.9'); ?> src="//img.new-combats.tech/i/images/300x225/capital/3strelka.gif" width="30" height="53" class="aFilter" /></div>
<div id="snow"></div>
<?= $goline; ?>
</div>
</td>
</tr>
</table>
<?php
if(date("H")<6 || date("H")>=22)
{
?>
<div align="center" id="atackDiv" style="display:none;">
<form method="post" action="main.php">
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div style="width:300px; padding:3px; margin:7px; background-color:#CCCCCC; border:1px solid #575757;"> Введите логин жертвы:<br />
<input name="atack" type="text" id="atack" size="35" maxlength="30" />
<input type="submit" name="button" id="button" class="btn" value="OK" />
</div></td>
</tr>
</table>
</form>
</div>
<?php
}
?>
</script>
<div style="position: absolute; left: 372px; top: 129px; width: 73px; height: 47px; z-index: 91;">
<img <?php thisInfRm('1.180.0.13'); ?> src="<?= Config::img() ?>/city/capitalcity/day/euroshop.gif" width="78" height="63" class="aFilter" alt="">
</div>
<div style="position: absolute; left: 179px; top: 13px; width: 73px; height: 47px; z-index: 92;">
<img <?php thisInfRm('1.180.0.263'); ?> src="<?= Config::img() ?>/city/capitalcity/day/1ubkill.gif" width="116" height="186" class="aFilter" alt="">
</div>
<div style="position: absolute; left: 28px; top: 86px; width: 73px; height: 47px; z-index: 89;">
<img <?php thisInfRm('1.180.0.214'); ?> src="<?= Config::img() ?>/city/capitalcity/day/cp_hostel.gif" width="86" height="90" class="aFilter" alt="">
</div>
<div style="position: absolute; left: 69px; top: 159px; width: 73px; height: 47px; z-index: 89;">
<img <?php thisInfRm('1.180.0.212'); ?> src="<?= Config::img() ?>/city/capitalcity/day/flower_shop.gif" width="74" height="68" class="aFilter" alt="">
</div>
<div style="position:absolute; left:446px; top:153px; width:30px; height:54px; z-index:94;">
<img <?php thisInfRm('1.180.0.213'); ?> src="<?= Config::img() ?>/i/images/300x225/capital/2strelka.gif" width="30" height="54" class="aFilter" alt="">
</div>
<div style="position:absolute; left:16px; top:155px; width:30px; height:54px; z-index:910;">
<img <?php thisInfRm('1.180.0.9'); ?> src="//img.new-combats.tech/i/images/300x225/capital/3strelka.gif" width="30" height="53" class="aFilter" alt="">
</div>
<div id="snow"></div>
<?= $goline; ?>
</div>
<!-- -->
<div style="width:500px; text-align:left; background-color:#D3D3D3;">
<span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7" />&nbsp;<a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.9&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.9',1); ?>">Центральная Площадь</a></span>
<span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7" />&nbsp;<a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.214&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.214',1); ?>">Общежитие</a></span>
<span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7" />&nbsp;<a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.12&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.12',1); ?>">Банк</a></span>
<span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7" />&nbsp;<a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.212&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.212',1); ?>">Цветочный Магазин</a></span>
<span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7" />&nbsp;<a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.263&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.263',1); ?>">Башня Смерти</a></span>
<span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7" />&nbsp;<a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.349&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.349',1); ?>">Регистратура клана</a></span>
<span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7" />&nbsp;<a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.13&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.13',1); ?>">Магазин Березка</a></span>
<span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px"><img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7" />&nbsp;<a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.213&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.213',1); ?>">Большая торговая Улица</a></span>
</div>
<!-- -->
<div style="display:none; height:0px " id="moveto"></div>
</td>
<td></td>
</tr>
</table>
<small>
<HR>
<INPUT class="btn" onclick="window.open('/forum?read=909&rnd=1', 'help', 'height=500,width=1024,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes')" value="Подсказка для новичков" style="color:red;" type="button">
<br />
<strong>Внимание!Рекомендуем установить функцию второго пароля во вкладке "Безопасность", это обезопасит вашего персонажа от взлома.<BR>
<em>Администрация.</strong> </em></small> <BR>
<?= $rowonmax; ?><BR>
</div></td>
</tr>
<?php if (date("H") < 6 || date("H") >= 22): ?>
<div id="atackDiv" style="display:none; text-align: center;">
<div style="width:300px; padding:3px; margin:7px; background-color:#CCCCCC; border:1px solid #575757;"> Введите логин жертвы:<br/>
<form method="post" action="/main.php">
<input name="atack" type="text" id="atack" size="35" maxlength="30">
<input type="submit" name="button" id="button" class="btn" value="OK">
</form>
</div>
</div>
<?php endif; ?>
<div style="width:500px; text-align:left; background-color:#D3D3D3;">
<span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px">
<img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7" alt="">&nbsp;
<a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.9&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.9', 1); ?>">
Центральная Площадь
</a>
</span>
<span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px">
<img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7" alt="">&nbsp;
<a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.214&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.214', 1); ?>">
Общежитие
</a>
</span>
<span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px">
<img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7" alt="">&nbsp;
<a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.212&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.212', 1); ?>">
Цветочный Магазин
</a>
</span>
<span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px">
<img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7" alt="">&nbsp;
<a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.263&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.263', 1); ?>">
Башня Смерти
</a>
</span>
<span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px">
<img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7" alt="">&nbsp;
<a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.13&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.13', 1); ?>">
Магазин Березка
</a>
</span>
<span style="white-space:nowrap; padding-left:3px; padding-right:3px; height:10px">
<img src="//img.new-combats.tech/i/move/links.gif" width="9" height="7" alt="">&nbsp;
<a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.213&rnd=<?= $code; ?>';" title="<?php thisInfRm('1.180.0.213', 1); ?>">
Большая торговая Улица
</a>
</span>
</div>
<div style="display:none; height:0;" id="moveto"></div>
<hr>
<?= $rowonmax; ?><BR>
</div>
</td>
</tr>
</table>
<?php
}
?>

View File

@ -689,62 +689,45 @@ $sp = mysql_query(
'SELECT `nosee`,`frv`,`id`,`dn`,`active`,`invis`,`login`,`to`,`city`,`room`,`time`,`type`,`spam`,`text`,`toChat`,`color`,`typeTime`,`sound`,`global`,`delete`,`molch`,`da` FROM `chat` WHERE
(
(
`delete` > 0
AND
`delete` > 0 AND
`time` > ' . (time() - 360) . '
)
OR
) OR
(
`time` > ' . (time() - 120) . '
OR
(
`time` = -1
AND
(
`to` = "' . $u->info['login'] . '"
OR
`type` = 8
)
)
OR
(
`time` < -1
AND
`time` > -' . time() . '
AND
(
`to` = "' . $u->info['login'] . '"
OR
`type` = 8
OR
`to` = ""
)
)
)
)
AND
`new` = "1"
AND
(
`id` > ' . ((int)$_POST['mid']) . '
OR
`delete` > 0
OR
`spam` > 0
OR
`time` > ' . (time() - 120) . ' OR
(
`time` < 0
AND
`time` > -' . time() . '
AND
`time` = -1 AND
(
`to` = "' . $u->info['login'] . '"
OR
`to` = "' . $u->info['login'] . '" OR
`type` = 8
)
) OR
(
`time` < -1 AND
`time` > -' . time() . ' AND
(
`to` = "' . $u->info['login'] . '" OR
`type` = 8 OR
`to` = ""
)
)
)
ORDER BY `id` ASC'
)
AND
`new` = "1" AND
(
`id` > ' . ((int)$_POST['mid']) . ' OR
`delete` > 0 OR
`spam` > 0 OR
(
`time` < 0 AND
`time` > -' . time() . ' AND
(
`to` = "' . $u->info['login'] . '" OR
`to` = ""
)
)
)
ORDER BY `id`'
);
while ($pl = mysql_fetch_array($sp)) {