refactor
This commit is contained in:
parent
2abd435798
commit
a14232a899
@ -99,6 +99,21 @@ class Chat
|
||||
'rotate' => [0 => 'катается от смеха по полу', 1 => 'катается по полу от смеха над [*%l*]'],
|
||||
];
|
||||
|
||||
public static function getLastMessageId(): int
|
||||
{
|
||||
return (int)Db::getValue('select max(id) from chat');
|
||||
}
|
||||
|
||||
public static function setCurrentTimeById(int $messageId): void
|
||||
{
|
||||
Db::sql('update chat set time = unix_timestamp() where id = ?)', [$messageId]);
|
||||
}
|
||||
|
||||
public static function setCurrentTimeAndIdById(int $messageId, int $newMessageId): void
|
||||
{
|
||||
Db::sql('update chat set time = unix_timestamp(), id = ? where id = ?', [$newMessageId, $messageId]);
|
||||
}
|
||||
|
||||
public function expworld($txt, $vl): string
|
||||
{
|
||||
$words = explode(' ', $txt);
|
||||
@ -214,4 +229,21 @@ class Chat
|
||||
];
|
||||
Db::sql($q, $args);
|
||||
}
|
||||
|
||||
/** Какая-то заумная выборка что отображать в чат.
|
||||
* @param int $messageId
|
||||
* @param string $login
|
||||
* @return array
|
||||
*/
|
||||
public function getMessages(int $messageId, string $login): array
|
||||
{
|
||||
$query = "select * from chat
|
||||
where
|
||||
new = 1 and
|
||||
(id > ? or spam > 0 or (time < 0 and time > -unix_timestamp() and (`to` = '' or `to` = ?))) and
|
||||
(time > unix_timestamp() - 360 or time > unix_timestamp() - 120 or (time = -1 and (`to` = ? or type = 8)) or time < -1 and time > -unix_timestamp() and (`to` = ? or type = 8 or `to` = ''))
|
||||
order by id";
|
||||
|
||||
return Db::getRows($query, [$messageId, $login, $login, $login]);
|
||||
}
|
||||
}
|
||||
|
@ -10,4 +10,9 @@ class ClanInfo
|
||||
{
|
||||
return Db::getValue('select count(name) from clan where name = ? and status = 1', [$name]) > 0;
|
||||
}
|
||||
|
||||
public static function getNameById(int $id): string
|
||||
{
|
||||
Db::getValue('select name from clan where id = ?', [$id]);
|
||||
}
|
||||
}
|
||||
|
@ -633,8 +633,8 @@ class User
|
||||
);
|
||||
$this->addAction(
|
||||
time(), 'frg', '[ ' . $this->info['login'] . ' ] ' . date(
|
||||
'd.m.Y H:i:s'
|
||||
) . ' [true] , balance: ' . $sb . ' / ' . $this->info['catch'] . ' / ' . $this->info['frg'] . ' '
|
||||
'd.m.Y H:i:s'
|
||||
) . ' [true] , balance: ' . $sb . ' / ' . $this->info['catch'] . ' / ' . $this->info['frg'] . ' '
|
||||
);
|
||||
} else {
|
||||
mysql_query(
|
||||
@ -645,8 +645,8 @@ class User
|
||||
if ($sb - 10 > $this->info['catch'] - $this->info['frg']) {
|
||||
$this->addAction(
|
||||
time(), 'frgfalse', '[ ' . $this->info['login'] . ' ] ' . date(
|
||||
'd.m.Y H:i:s'
|
||||
) . ' [false] , [' . ($sb - ($this->info['catch'] - $this->info['frg'])) . '] , balance: ' . $sb . ' | ' . $this->info['catch'] . ' | ' . $this->info['frg'] . ' '
|
||||
'd.m.Y H:i:s'
|
||||
) . ' [false] , [' . ($sb - ($this->info['catch'] - $this->info['frg'])) . '] , balance: ' . $sb . ' | ' . $this->info['catch'] . ' | ' . $this->info['frg'] . ' '
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -745,8 +745,7 @@ class User
|
||||
'UPDATE `items_users` SET `use_text` = "' . $itm['use_text'] . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1'
|
||||
);
|
||||
mysql_query(
|
||||
'INSERT INTO `items_text` (`item_id`,`time`,`login`,`text`,`city`,`x`) VALUES ("' . $itm['id'] . '","' . time(
|
||||
) . '","' . $this->info['login'] . '","' . mysql_real_escape_string(
|
||||
'INSERT INTO `items_text` (`item_id`,`time`,`login`,`text`,`city`,`x`) VALUES ("' . $itm['id'] . '","' . time() . '","' . $this->info['login'] . '","' . mysql_real_escape_string(
|
||||
htmlspecialchars($txt, null)
|
||||
) . '","' . $this->info['city'] . '","' . $sx . '")'
|
||||
);
|
||||
@ -802,8 +801,7 @@ class User
|
||||
$this->error = 'Персонаж уже проводит сделку';
|
||||
} else {
|
||||
$ins = mysql_query(
|
||||
'INSERT INTO `transfers` (`uid1`,`uid2`,`city`,`room`,`time`,`text`,`start1`) VALUES ("' . $this->info['id'] . '","' . $t['id'] . '","' . $this->info['city'] . '","' . $this->info['room'] . '","' . time(
|
||||
) . '","' . mysql_real_escape_string(
|
||||
'INSERT INTO `transfers` (`uid1`,`uid2`,`city`,`room`,`time`,`text`,`start1`) VALUES ("' . $this->info['id'] . '","' . $t['id'] . '","' . $this->info['city'] . '","' . $this->info['room'] . '","' . time() . '","' . mysql_real_escape_string(
|
||||
htmlspecialchars($_POST['textarea'], null)
|
||||
) . '","' . time() . '")'
|
||||
);
|
||||
@ -1198,8 +1196,6 @@ class User
|
||||
return Db::getRow('select * from users left join stats on users.id = stats.id where users.id = ?', [$id]);
|
||||
}
|
||||
|
||||
//Удаление определенного типа предметов
|
||||
|
||||
public function testAction($filter, $tp)
|
||||
{
|
||||
if ($tp == 1) {
|
||||
@ -1212,6 +1208,8 @@ class User
|
||||
return $stmt ? mysql_fetch_array($stmt) : [];
|
||||
}
|
||||
|
||||
//Удаление определенного типа предметов
|
||||
|
||||
public function addAction($time, $vars, $vls, $uid = null): bool
|
||||
{
|
||||
$info = $this->info;
|
||||
@ -1251,11 +1249,6 @@ class User
|
||||
return $hgo ?? [];
|
||||
}
|
||||
|
||||
//Выводим вещи котоыре нужно отремонтировать
|
||||
|
||||
|
||||
//Расчет урона от оружия
|
||||
|
||||
public function wipe()
|
||||
{
|
||||
if ($this->info['wipe'] > 0 && $this->info['battle'] == 0) {
|
||||
@ -1329,7 +1322,10 @@ class User
|
||||
}
|
||||
}
|
||||
|
||||
//Расчет защиты
|
||||
//Выводим вещи котоыре нужно отремонтировать
|
||||
|
||||
|
||||
//Расчет урона от оружия
|
||||
|
||||
public function allActionsStart()
|
||||
{
|
||||
@ -1371,6 +1367,13 @@ class User
|
||||
}
|
||||
}
|
||||
|
||||
//Расчет защиты
|
||||
|
||||
public static function getLoginById(int $uid): string
|
||||
{
|
||||
return Db::getValue('select login from users where id = ?', [$uid]) ?: '';
|
||||
}
|
||||
|
||||
//Расчет защиты (магия)
|
||||
|
||||
/** Singletone.
|
||||
@ -2267,13 +2270,11 @@ class User
|
||||
$col = $this->itemsX($iid);
|
||||
if ($col > 1) {
|
||||
$UpItems = mysql_query(
|
||||
'UPDATE `items_users` SET `uid` = ' . $this->info['id'] . ', `inGroup` = `inGroup`+1000, `1price` = "' . $i1['price1'] . '", `lastUPD` = "' . time(
|
||||
) . '", `inShop` = 0 WHERE `inShop` = 30 AND `inOdet` = "0"AND `item_id`="' . $i2['item_id'] . '" AND `uid`="' . $i2['uid'] . '" AND `inGroup` = "' . $i2['inGroup'] . '" LIMIT ' . $col . ''
|
||||
'UPDATE `items_users` SET `uid` = ' . $this->info['id'] . ', `inGroup` = `inGroup`+1000, `1price` = "' . $i1['price1'] . '", `lastUPD` = "' . time() . '", `inShop` = 0 WHERE `inShop` = 30 AND `inOdet` = "0"AND `item_id`="' . $i2['item_id'] . '" AND `uid`="' . $i2['uid'] . '" AND `inGroup` = "' . $i2['inGroup'] . '" LIMIT ' . $col . ''
|
||||
);
|
||||
} else {
|
||||
$UpItems = mysql_query(
|
||||
'UPDATE `items_users` SET `uid` = ' . $this->info['id'] . ', `1price` = "' . $i1['price1'] . '", `lastUPD` = "' . time(
|
||||
) . '", `inShop` = 0 WHERE `id` = "' . $iid . '" AND `inOdet` = "0" AND `delete` = "0" AND `uid`="' . $i2['uid'] . '" LIMIT 1'
|
||||
'UPDATE `items_users` SET `uid` = ' . $this->info['id'] . ', `1price` = "' . $i1['price1'] . '", `lastUPD` = "' . time() . '", `inShop` = 0 WHERE `id` = "' . $iid . '" AND `inOdet` = "0" AND `delete` = "0" AND `uid`="' . $i2['uid'] . '" LIMIT 1'
|
||||
);
|
||||
}
|
||||
//Вставляем функцию передачи кредитов владельцу предмета
|
||||
@ -4319,8 +4320,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
if ($po['sudba'] == '0') {
|
||||
$is2 .= ' <img title="Этот предмет будет связан общей судьбой с первым, кто наденет его. Никто другой не сможет его использовать." src="' . Config::img() . '/i/destiny0.gif">';
|
||||
} elseif ($po['sudba'] == '1') {
|
||||
$is2 .= ' <img title="Этот предмет будет связан общей судьбой с первым, кто возьмет предмет. Никто другой не сможет его использовать." src="' . Config::img(
|
||||
) . '/i/destiny0.gif">';
|
||||
$is2 .= ' <img title="Этот предмет будет связан общей судьбой с первым, кто возьмет предмет. Никто другой не сможет его использовать." src="' . Config::img() . '/i/destiny0.gif">';
|
||||
} else {
|
||||
$is2 .= ' <img title="Этот предмет связан общей судьбой с ' . $po['sudba'] . '. Никто другой не сможет его использовать." src="' . Config::img() . '/i/desteny.gif">';
|
||||
}
|
||||
@ -4504,8 +4504,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
$tr .= '<br>• Броня ' . $bn[$i] . ': ' . $po['add_mib' . $i] . '-' . $po['add_mab' . $i];
|
||||
}
|
||||
if (isset($po['mf_mib']) && $po['mf_mib'] > 0) {
|
||||
$tr .= ' <a href="main.php?inv=1&otdel=' . $_GET['otdel'] . '&rstv=' . $pl['id'] . '&mf=mib' . $i . '"><img src="' . Config::img(
|
||||
) . '/i/up.gif" width="11" height="11"></a>';
|
||||
$tr .= ' <a href="main.php?inv=1&otdel=' . $_GET['otdel'] . '&rstv=' . $pl['id'] . '&mf=mib' . $i . '"><img src="' . Config::img() . '/i/up.gif" width="11" height="11"></a>';
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
@ -4649,11 +4648,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
|
||||
if (isset($po['free_stats']) && $po['free_stats'] > 0) {
|
||||
$is2 .= '<br><strong>Распределение статов:</strong>';
|
||||
$is2 .= '<div style="margin-left:20px;"><small>Сила: ' . $po['add_s1'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=1"><img src="' . Config::img(
|
||||
) . '/i/plus.gif"></a><br>Ловкость: ' . $po['add_s2'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=2"><img src="' . Config::img(
|
||||
) . '/i/plus.gif"></a><br>Интуиция: ' . $po['add_s3'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=3"><img src="' . Config::img(
|
||||
) . '/i/plus.gif"></a><br>Интеллект: ' . $po['add_s5'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=5"><img src="' . Config::img(
|
||||
) . '/i/plus.gif"></a></small></div>';
|
||||
$is2 .= '<div style="margin-left:20px;"><small>Сила: ' . $po['add_s1'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=1"><img src="' . Config::img() . '/i/plus.gif"></a><br>Ловкость: ' . $po['add_s2'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=2"><img src="' . Config::img() . '/i/plus.gif"></a><br>Интуиция: ' . $po['add_s3'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=3"><img src="' . Config::img() . '/i/plus.gif"></a><br>Интеллект: ' . $po['add_s5'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=5"><img src="' . Config::img() . '/i/plus.gif"></a></small></div>';
|
||||
$is2 .= '• Осталось распределений: ' . $po['free_stats'] . '';
|
||||
}
|
||||
|
||||
@ -4705,28 +4700,17 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
} else {
|
||||
$is2 .= '<div style="margin-left:20px;"><small>
|
||||
Мастерство владения мечами: ' . (0 + $po['add_a1']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=1"><img src="' . Config::img() . '/i/plus.gif"></a><br>
|
||||
Мастерство владения дубинами, булавами: ' . (0 + $po['add_a2']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=2"><img src="' . Config::img(
|
||||
) . '/i/plus.gif"></a><br>
|
||||
Мастерство владения ножами, кастетами: ' . (0 + $po['add_a3']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=3"><img src="' . Config::img(
|
||||
) . '/i/plus.gif"></a><br>
|
||||
Мастерство владения топорами, секирами: ' . (0 + $po['add_a4']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=4"><img src="' . Config::img(
|
||||
) . '/i/plus.gif"></a><br>
|
||||
Мастерство владения магическими посохами: ' . (0 + $po['add_a5']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=5"><img src="' . Config::img(
|
||||
) . '/i/plus.gif"></a><br>
|
||||
Мастерство владения стихией Огня: ' . (0 + $po['add_mg1']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=6"><img src="' . Config::img(
|
||||
) . '/i/plus.gif"></a><br>
|
||||
Мастерство владения стихией Воздуха: ' . (0 + $po['add_mg2']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=7"><img src="' . Config::img(
|
||||
) . '/i/plus.gif"></a><br>
|
||||
Мастерство владения стихией Воды: ' . (0 + $po['add_mg3']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=8"><img src="' . Config::img(
|
||||
) . '/i/plus.gif"></a><br>
|
||||
Мастерство владения стихией Земли: ' . (0 + $po['add_mg4']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=9"><img src="' . Config::img(
|
||||
) . '/i/plus.gif"></a><br>
|
||||
Мастерство владения магией Света: ' . (0 + $po['add_mg5']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=10"><img src="' . Config::img(
|
||||
) . '/i/plus.gif"></a><br>
|
||||
Мастерство владения магией Тьмы: ' . (0 + $po['add_mg6']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=11"><img src="' . Config::img(
|
||||
) . '/i/plus.gif"></a><br>
|
||||
Мастерство владения серой магией: ' . (0 + $po['add_mg7']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=12"><img src="' . Config::img(
|
||||
) . '/i/plus.gif"></a><br>
|
||||
Мастерство владения дубинами, булавами: ' . (0 + $po['add_a2']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=2"><img src="' . Config::img() . '/i/plus.gif"></a><br>
|
||||
Мастерство владения ножами, кастетами: ' . (0 + $po['add_a3']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=3"><img src="' . Config::img() . '/i/plus.gif"></a><br>
|
||||
Мастерство владения топорами, секирами: ' . (0 + $po['add_a4']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=4"><img src="' . Config::img() . '/i/plus.gif"></a><br>
|
||||
Мастерство владения магическими посохами: ' . (0 + $po['add_a5']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=5"><img src="' . Config::img() . '/i/plus.gif"></a><br>
|
||||
Мастерство владения стихией Огня: ' . (0 + $po['add_mg1']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=6"><img src="' . Config::img() . '/i/plus.gif"></a><br>
|
||||
Мастерство владения стихией Воздуха: ' . (0 + $po['add_mg2']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=7"><img src="' . Config::img() . '/i/plus.gif"></a><br>
|
||||
Мастерство владения стихией Воды: ' . (0 + $po['add_mg3']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=8"><img src="' . Config::img() . '/i/plus.gif"></a><br>
|
||||
Мастерство владения стихией Земли: ' . (0 + $po['add_mg4']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=9"><img src="' . Config::img() . '/i/plus.gif"></a><br>
|
||||
Мастерство владения магией Света: ' . (0 + $po['add_mg5']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=10"><img src="' . Config::img() . '/i/plus.gif"></a><br>
|
||||
Мастерство владения магией Тьмы: ' . (0 + $po['add_mg6']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=11"><img src="' . Config::img() . '/i/plus.gif"></a><br>
|
||||
Мастерство владения серой магией: ' . (0 + $po['add_mg7']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=12"><img src="' . Config::img() . '/i/plus.gif"></a><br>
|
||||
</small></div>';
|
||||
$is2 .= 'Осталось распределений: ' . $mx1;
|
||||
}
|
||||
@ -4877,16 +4861,14 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $po['toclan1'][0] . '" LIMIT 1')
|
||||
);
|
||||
if (isset($clpo['id'])) {
|
||||
$is2 .= '<div style="color:brown;">Предмет принадлежит клану <img style="vertical-align:bottom" src="' . Config::img(
|
||||
) . '/i/clan/' . $clpo['name_mini'] . '.gif" width="24" height"15"> <strong>' . $clpo['name'] . '</strong>';
|
||||
$is2 .= '<div style="color:brown;">Предмет принадлежит клану <img style="vertical-align:bottom" src="' . Config::img() . '/i/clan/' . $clpo['name_mini'] . '.gif" width="24" height"15"> <strong>' . $clpo['name'] . '</strong>';
|
||||
$plpo = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT `id`,`login`,`cityreg` FROM `users` WHERE `id` = "' . $po['toclan1'][1] . '" LIMIT 1'
|
||||
)
|
||||
);
|
||||
if (isset($plpo['id'])) {
|
||||
$is2 .= ' <font color=grey>(Дар игрока <strong>' . $plpo['login'] . '</strong><a href="info/' . $plpo['id'] . '" target="_blank"><img src="' . Config::img(
|
||||
) . '/i/inf_' . $plpo['cityreg'] . '.gif" width="9"></a>)</font>';
|
||||
$is2 .= ' <font color=grey>(Дар игрока <strong>' . $plpo['login'] . '</strong><a href="info/' . $plpo['id'] . '" target="_blank"><img src="' . Config::img() . '/i/inf_' . $plpo['cityreg'] . '.gif" width="9"></a>)</font>';
|
||||
if ($plpo['login'] == $this->info['login']) {
|
||||
if (isset($_GET['backmyitm'])) {
|
||||
$pl['inOdet'] = 0;
|
||||
@ -5032,8 +5014,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
) . '" LIMIT 1'
|
||||
)
|
||||
);
|
||||
$is1 .= '<small>Предмет у игрока<br><strong>' . $yui['login'] . '</strong><a href="info/' . $yui['id'] . '" target="_blank"><img width="10" src="' . Config::img(
|
||||
) . '/i/inf_' . $yui['cityreg'] . '.gif"></a></small>';
|
||||
$is1 .= '<small>Предмет у игрока<br><strong>' . $yui['login'] . '</strong><a href="info/' . $yui['id'] . '" target="_blank"><img width="10" src="' . Config::img() . '/i/inf_' . $yui['cityreg'] . '.gif"></a></small>';
|
||||
if ($this->info['tt'][14][0] == 1 || ($this->info['id'] == $us_1)) {
|
||||
$is1 .= '<br><small style=""><a href="?clan&deposit&ungive_itm=' . $pl['id'] . '">Изъять предмет</a></small>';
|
||||
}
|
||||
@ -5395,15 +5376,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
}
|
||||
if ($pl['magic_inc'] && $pl['type'] == 30) {
|
||||
//используем эликсир
|
||||
$pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'' . Config::img(
|
||||
) . '/i/items/' . $pl['img'] . '\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>"<strong>' . $pl['name'] . '</strong>"<br>Использовать сейчас?</td></tr></table>';
|
||||
$pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'' . Config::img() . '/i/items/' . $pl['img'] . '\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>"<strong>' . $pl['name'] . '</strong>"<br>Использовать сейчас?</td></tr></table>';
|
||||
$useUrl = 'top.useiteminv(\'' . (0 + $pl['id']) . '\',\'' . $pl['img'] . '\',\'' . $pl['img'] . '\',1,\'' . $pldate . '\',\'' . (0 + $_GET['otdel']) . '\');';
|
||||
} elseif ($pl['magic_inc'] && $pl['type'] == 29) { //используем заклятие
|
||||
if (isset($po['useOnLogin']) && !isset($po['zazuby'])) { //на персонажа
|
||||
$useUrl = 'top.useMagic(\'' . $pl['name'] . '\',' . (0 + $pl['id']) . ',\'' . $pl['img'] . '\',1,\'main.php?' . $inv1 . 'otdel=' . ((int)$_GET['otdel']) . '&use_pid=' . $pl['id'] . '&rnd=' . $code . '\');';
|
||||
} else { //просто использование (на себя, либо без указания предмета\логина)
|
||||
$pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'' . Config::img(
|
||||
) . '/i/items/' . $pl['img'] . '\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>"<strong>' . $pl['name'] . '</strong>"<br>Использовать сейчас?</td></tr></table>';
|
||||
$pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'' . Config::img() . '/i/items/' . $pl['img'] . '\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>"<strong>' . $pl['name'] . '</strong>"<br>Использовать сейчас?</td></tr></table>';
|
||||
$useUrl = 'top.useiteminv(\'' . (0 + $pl['id']) . '\',\'' . $pl['img'] . '\',\'' . $pl['img'] . '\',1,\'' . $pldate . '\',\'' . (0 + $_GET['otdel']) . '\',' . (0 + $_GET['otdel']) . ');';
|
||||
}
|
||||
//на предмет
|
||||
@ -5450,17 +5429,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
if ($pl['group'] > 0) {
|
||||
$is1 .= '<br>';
|
||||
if ($this->itemsX($pl['id']) < $pl['group_max']) {
|
||||
$is1 .= '<a href="main.php?inv=1&otdel=' . ((int)$_GET['otdel']) . '&stack=' . $pl['id'] . '&rnd=' . $code . '" title="Собрать"><img src="' . Config::img(
|
||||
) . '/i/stack.gif" /></a>';
|
||||
$is1 .= '<a href="main.php?inv=1&otdel=' . ((int)$_GET['otdel']) . '&stack=' . $pl['id'] . '&rnd=' . $code . '" title="Собрать"><img src="' . Config::img() . '/i/stack.gif" /></a>';
|
||||
}
|
||||
if ($this->itemsX($pl['id']) > 1) {
|
||||
$is1 .= ' <a
|
||||
onClick="top.unstack(' . $pl['id'] . ',\'' . $pl['img'] . '\',\'' . $pl['name'] . '\',1,\'<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td align=\\\'center\\\' rowspan=\\\'2\\\' width=\\\'70px\\\'><img src=\\\'' . Config::img(
|
||||
) . '/i/items/' . $pl['img'] . '\\\'></td><td align=\\\'left\\\'>Разделить предмет <strong>' . $pl['name'] . '</strong>?</td></tr></table>\',\'' . intval(
|
||||
onClick="top.unstack(' . $pl['id'] . ',\'' . $pl['img'] . '\',\'' . $pl['name'] . '\',1,\'<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td align=\\\'center\\\' rowspan=\\\'2\\\' width=\\\'70px\\\'><img src=\\\'' . Config::img() . '/i/items/' . $pl['img'] . '\\\'></td><td align=\\\'left\\\'>Разделить предмет <strong>' . $pl['name'] . '</strong>?</td></tr></table>\',\'' . intval(
|
||||
$_GET['otdel']
|
||||
) . '\'); return false;"
|
||||
href="main.php?inv=1&otdel=' . ((int)$_GET['otdel']) . '&unstack=' . $pl['id'] . '&rnd=' . $code . '" title="Разделить"><img src="' . Config::img(
|
||||
) . '/i/unstack.gif" /></a>' . $script;
|
||||
) . ' . ((int)$_GET['otdel']) . '&unstack=' . $pl['id'] . '&rnd=' . $code . '" title="Разделить"><img src="' . Config::img() . '/i/unstack.gif" /></a>' . $script;
|
||||
}
|
||||
}
|
||||
if (isset($po['toclan'])) {
|
||||
@ -5477,8 +5452,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
|
||||
if ($d[1] == 1) { //можно выкинуть
|
||||
if (!isset($po['nodelete'])) {
|
||||
$is1 .= ' <a onClick="top.drop(' . $pl['id'] . ',\'' . $pl['img'] . '\',\'' . $pl['name'] . '\',1,\'<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2><img src=\\\'' . Config::img(
|
||||
) . '/i/items/' . $pl['img'] . '\\\'></td><td align=\\\'left\\\'>Предмет <strong>' . $pl['name'] . '</strong> будет утерян, вы уверены ?</td></tr></table>\',\'' . intval(
|
||||
$is1 .= ' <a onClick="top.drop(' . $pl['id'] . ',\'' . $pl['img'] . '\',\'' . $pl['name'] . '\',1,\'<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2><img src=\\\'' . Config::img() . '/i/items/' . $pl['img'] . '\\\'></td><td align=\\\'left\\\'>Предмет <strong>' . $pl['name'] . '</strong> будет утерян, вы уверены ?</td></tr></table>\',\'' . intval(
|
||||
$_GET['otdel']
|
||||
) . Config::img() . ' / i / clear . gif"></a>';
|
||||
}
|
||||
@ -5790,8 +5764,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
$itm['data'] = Conversion::dataStringToArray($itm['data']);
|
||||
unset($itm['data']['frompisher']);
|
||||
$itm['data'] = Conversion::arrayToDataString($itm['data']);
|
||||
if ($pl['data'] == $itm['data'] && $pl['name'] == $itm['name'] && $itm['iznosMAX'] == $pl['iznosMAX'] && $pl['iznosNOW'] == 0 && ($pl['timeOver'] == 0 || $pl['timeOver'] > time(
|
||||
)) && $pl['gift'] == $itm['gift']) {
|
||||
if ($pl['data'] == $itm['data'] && $pl['name'] == $itm['name'] && $itm['iznosMAX'] == $pl['iznosMAX'] && $pl['iznosNOW'] == 0 && ($pl['timeOver'] == 0 || $pl['timeOver'] > time()) && $pl['gift'] == $itm['gift']) {
|
||||
$upd = mysql_query(
|
||||
'UPDATE `items_users` SET `lastUPD` = "' . time() . '", `inGroup` = "' . $itm['inGroup'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'
|
||||
);
|
||||
@ -5927,8 +5900,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
`iu`.`bexp`,
|
||||
`iu`.`so`,
|
||||
`iu`.`blvl`
|
||||
FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE (`iu`.`inOdet`!="0" OR `iu`.`data` LIKE "%srok%" OR `iu`.`data` LIKE "%vip_sale%" OR `iu`.`data` LIKE "%sudba=1%" OR ( `iu`.`data` LIKE "%zazuby=%" AND `iu`.`data` NOT LIKE "%srok=%" ) OR `iu`.`iznosNOW` > 0 OR `im`.`srok` > 0 OR (`iu`.`timeOver`<' . time(
|
||||
) . ' AND `iu`.`timeOver`!="0")) AND `iu`.`uid`="' . $u['id'] . '" AND (`iu`.`delete`="0" OR `iu`.`delete`="1000")'
|
||||
FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE (`iu`.`inOdet`!="0" OR `iu`.`data` LIKE "%srok%" OR `iu`.`data` LIKE "%vip_sale%" OR `iu`.`data` LIKE "%sudba=1%" OR ( `iu`.`data` LIKE "%zazuby=%" AND `iu`.`data` NOT LIKE "%srok=%" ) OR `iu`.`iznosNOW` > 0 OR `im`.`srok` > 0 OR (`iu`.`timeOver`<' . time() . ' AND `iu`.`timeOver`!="0")) AND `iu`.`uid`="' . $u['id'] . '" AND (`iu`.`delete`="0" OR `iu`.`delete`="1000")'
|
||||
);
|
||||
while ($itm = mysql_fetch_array($cl)) {
|
||||
$po = [];
|
||||
@ -6362,8 +6334,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
$uimg = 'i/items/' . $pl['img'] . '';
|
||||
}
|
||||
|
||||
$witm[$pl['inOdet']] = '<img style="display:block;" src="' . Config::img(
|
||||
) . '/' . $uimg . '" onMouseOver="top.hi(this,\'<center><strong>' . $pl['name'] . '</strong>' . $lvar . '</center>\',event,3,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();">';
|
||||
$witm[$pl['inOdet']] = '<img style="display:block;" src="' . Config::img() . '/' . $uimg . '" onMouseOver="top.hi(this,\'<center><strong>' . $pl['name'] . '</strong>' . $lvar . '</center>\',event,3,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();">';
|
||||
|
||||
if ($i1 == 1) {
|
||||
$witm[$pl['inOdet']] = '<a href="/item/' . $pl['item_id'] . '" target="_blank">' . $witm[$pl['inOdet']] . '</a>';
|
||||
@ -6375,8 +6346,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
}
|
||||
if ($pl['magic_inc'] && $pl['type'] == 30) {
|
||||
//используем эликсир
|
||||
$pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'' . Config::img(
|
||||
) . '/i/items/' . $pl['img'] . '\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>"<strong>' . $pl['name'] . '</strong>"<br>Использовать сейчас?</td></tr></table>';
|
||||
$pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'' . Config::img() . '/i/items/' . $pl['img'] . '\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>"<strong>' . $pl['name'] . '</strong>"<br>Использовать сейчас?</td></tr></table>';
|
||||
$useUrl = 'top.useiteminv(\'' . (0 + $pl['id']) . '\',\'' . $pl['img'] . '\',\'' . $pl['img'] . '\',1,\'' . $pldate . '\',\'' . (0 + $_GET['otdel']) . '\');';
|
||||
} elseif ($pl['magic_inc'] && $pl['type'] == 29) {
|
||||
//используем заклятие
|
||||
@ -6389,8 +6359,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
$useUrl = 'top.useMagic(\'' . $pl['name'] . '\',' . (0 + $pl['id']) . ',\'' . $pl['img'] . '\',1,\'main.php?' . $inv1 . 'use_pid=' . $pl['id'] . '&rnd=' . $code . '\');';
|
||||
} else {
|
||||
//просто использование (на селя, либо без указания предмета\логина)
|
||||
$pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'' . Config::img(
|
||||
) . '/i/items/' . $pl['img'] . '\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>"<strong>' . $pl['name'] . '</strong>"<br>Использовать сейчас?</td></tr></table>';
|
||||
$pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'' . Config::img() . '/i/items/' . $pl['img'] . '\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>"<strong>' . $pl['name'] . '</strong>"<br>Использовать сейчас?</td></tr></table>';
|
||||
$useUrl = 'top.useiteminv(\'' . (0 + $pl['id']) . '\',\'' . $pl['img'] . '\',\'' . $pl['img'] . '\',1,\'' . $pldate . '\',\'' . (0 + $_GET['otdel']) . '\');';
|
||||
}
|
||||
}
|
||||
@ -6485,8 +6454,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
} else {
|
||||
$uimg = 'i/items/' . $wj[1]['img'] . '';
|
||||
}
|
||||
$witm[1] = '<img style="display:block;" src="' . Config::img(
|
||||
) . '/' . $uimg . '" onMouseOver="top.hi(this,\'<center>' . $wj1i . '</center>\',event,3,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
|
||||
$witm[1] = '<img style="display:block;" src="' . Config::img() . '/' . $uimg . '" onMouseOver="top.hi(this,\'<center>' . $wj1i . '</center>\',event,3,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
|
||||
if ($i1 == 1) {
|
||||
$witm[1] = '<a href="/item/' . $wj[1]['item_id'] . '" target="_blank">' . $witm[1] . '</a>';
|
||||
} else {
|
||||
@ -6499,8 +6467,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
} else {
|
||||
$uimg = 'i/items/' . $wj[4]['img'] . '';
|
||||
}
|
||||
$witm[4] = '<img style="display:block;" src="' . Config::img(
|
||||
) . '/' . $uimg . '" onMouseOver="top.hi(this,\'<center>' . $wj4i . '</center>\',event,3,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
|
||||
$witm[4] = '<img style="display:block;" src="' . Config::img() . '/' . $uimg . '" onMouseOver="top.hi(this,\'<center>' . $wj4i . '</center>\',event,3,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
|
||||
if ($i1 == 1) {
|
||||
if ($wj4idd > 0 && isset($wj[4]['item_id'])) {
|
||||
$wj[4]['item_id'] = $wj4idd;
|
||||
@ -6556,11 +6523,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
)
|
||||
);
|
||||
if (isset($petimg['id'])) {
|
||||
$anml = '<img height="40" width="120" src="' . Config::img(
|
||||
) . '/pet/' . $petimg['img'] . '" onMouseOver="top.hi(this,\'<strong>' . $an['name'] . '</strong> <i>(' . $anan2[$an['type']] . ')</i><br>Уровень: ' . $an['level'] . '\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
|
||||
$anml = '<img height="40" width="120" src="' . Config::img() . '/pet/' . $petimg['img'] . '" onMouseOver="top.hi(this,\'<strong>' . $an['name'] . '</strong> <i>(' . $anan2[$an['type']] . ')</i><br>Уровень: ' . $an['level'] . '\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
|
||||
} else {
|
||||
$anml = '<img height="40" width="120" src="' . Config::img(
|
||||
) . '/pet/' . $anan[$an['type']] . '.png" onMouseOver="top.hi(this,\'<strong>' . $an['name'] . '</strong><i>(' . $anan2[$an['type']] . ')</i><br>Уровень: ' . $an['level'] . '\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
|
||||
$anml = '<img height="40" width="120" src="' . Config::img() . '/pet/' . $anan[$an['type']] . '.png" onMouseOver="top.hi(this,\'<strong>' . $an['name'] . '</strong><i>(' . $anan2[$an['type']] . ')</i><br>Уровень: ' . $an['level'] . '\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -6738,8 +6703,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
if ($e['type1'] == 18 || $e['type1'] == 19) {
|
||||
$e['img'] = $e['img2'];
|
||||
}
|
||||
$eff .= '<img width="38" height="23" style="margin:1px;display:block;float:left;" src="' . Config::img(
|
||||
) . '/i/eff/' . $e['img'] . '"onMouseOver="top.hi(this,\'' . $ei . '\',event,0,1,1,1,\'\');" onMouseOut="top.hic(event);" onMouseDown="top.hic(event);" >';
|
||||
$eff .= '<img width="38" height="23" style="margin:1px;display:block;float:left;" src="' . Config::img() . '/i/eff/' . $e['img'] . '"onMouseOver="top.hi(this,\'' . $ei . '\',event,0,1,1,1,\'\');" onMouseOut="top.hic(event);" onMouseDown="top.hic(event);" >';
|
||||
} elseif ($e['timeUse'] + $e['timeAce'] + $e['actionTime'] < time() && $e['timeUse'] != 77) {
|
||||
//удаляем эффект
|
||||
$ed = Conversion::dataStringToArray($e['data']);
|
||||
@ -6774,8 +6738,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
$sn['mpNow']
|
||||
) . '/' . (0 + $sn['mpAll']) . '</div>
|
||||
<div title="Уровень маны" class="hpborder" style="position:absolute; top:10px; width:120px; height:9px; z-index:13;"><img src="' . Config::img() . '/1x1.gif" height="9" width="1"></div>
|
||||
<div class="' . $lm[0] . ' senohp" style="height:9px; position:absolute; top:10px; width:' . $lm[1] . 'px; z-index:11;" id="lmp' . $u['id'] . '"><img src="' . Config::img(
|
||||
) . '/1x1.gif" height="9" width="1"></div>
|
||||
<div class="' . $lm[0] . ' senohp" style="height:9px; position:absolute; top:10px; width:' . $lm[1] . 'px; z-index:11;" id="lmp' . $u['id'] . '"><img src="' . Config::img() . '/1x1.gif" height="9" width="1"></div>
|
||||
<div title="Уровень маны" class="hp_none" style="position:absolute; top:10px; width:120px; height:10px; z-index:10;"></div>';
|
||||
} else {
|
||||
$hptop = 5;
|
||||
@ -6784,10 +6747,8 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
$sn['hpNow']
|
||||
) . '/' . (0 + $sn['hpAll']) . '</div>
|
||||
<div title="Уровень жизни" class="hpborder" style="position:absolute; top:' . $hptop . 'px; width:120px; height:9px; z-index:13;"><img src="' . Config::img() . '/1x1.gif" height="9" width="1"></div>
|
||||
<div class="' . $lh[0] . ' senohp" style="height:9px; width:' . $lh[1] . 'px; position:absolute; top:' . $hptop . 'px; z-index:11;" id="lhp' . $u['id'] . '"><img src="' . Config::img(
|
||||
) . '/1x1.gif" height="9" width="1"></div>
|
||||
<div title="Уровень жизни" class="hp_none" style="position:absolute; top:' . $hptop . 'px; width:120px; height:10px; z-index:10;"><img src="' . Config::img(
|
||||
) . '/1x1.gif" height="10"></div>' . $hpmp;
|
||||
<div class="' . $lh[0] . ' senohp" style="height:9px; width:' . $lh[1] . 'px; position:absolute; top:' . $hptop . 'px; z-index:11;" id="lhp' . $u['id'] . '"><img src="' . Config::img() . '/1x1.gif" height="9" width="1"></div>
|
||||
<div title="Уровень жизни" class="hp_none" style="position:absolute; top:' . $hptop . 'px; width:120px; height:10px; z-index:10;"><img src="' . Config::img() . '/1x1.gif" height="10"></div>' . $hpmp;
|
||||
//Собираем НР и МР
|
||||
$hpmp = '<div style="position:relative;">' . $hpmp . '</div>';
|
||||
|
||||
@ -6949,8 +6910,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
}
|
||||
$rt[0] .= '<div style="position:relative;height:220px;">
|
||||
<!-- образ -->
|
||||
<div style="position:absolute; width:120px; height:220px; z-index:1;"><a href="' . $invg[0] . '"><img onMouseOver="top.hi(this,\'Перейти в "<strong>' . $invg[1] . '</strong>"\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();" width="120" height="220" src="' . Config::img(
|
||||
) . '/' . $uobr . '" ' . $oi . '></a></div>
|
||||
<div style="position:absolute; width:120px; height:220px; z-index:1;"><a href="' . $invg[0] . '"><img onMouseOver="top.hi(this,\'Перейти в "<strong>' . $invg[1] . '</strong>"\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();" width="120" height="220" src="' . Config::img() . '/' . $uobr . '" ' . $oi . '></a></div>
|
||||
<div style="position:absolute; width:120px; height:auto; z-index:3;" align="left">' . $eff . '</div>' . $anml . '
|
||||
</div>';
|
||||
} else {
|
||||
@ -6965,8 +6925,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
}
|
||||
$rt[0] .= '<div class="inf2s" style="position:relative;height:220px;">
|
||||
<!-- образ -->
|
||||
<div style="position:absolute; width:120px; height:220px; z-index:1;"><a href="' . $invg[0] . '"><img onMouseOver="top.hi(this,\'Перейти в "<strong>' . $invg[1] . '</strong>"\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();" width="120" height="220" src="' . Config::img(
|
||||
) . '/1x1.gif" ' . $oi . '></a></div>
|
||||
<div style="position:absolute; width:120px; height:220px; z-index:1;"><a href="' . $invg[0] . '"><img onMouseOver="top.hi(this,\'Перейти в "<strong>' . $invg[1] . '</strong>"\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();" width="120" height="220" src="' . Config::img() . '/1x1.gif" ' . $oi . '></a></div>
|
||||
<div style="position:absolute; width:120px; height:auto; z-index:3;" align="left">' . $eff . '</div>' . $anml . '
|
||||
</div>';
|
||||
}
|
||||
@ -7016,8 +6975,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
|
||||
|
||||
if ($i1 == 0 && $u['battle'] == 0) {
|
||||
$rt[0] .= '<script>top.lafstReg[' . $u['id'] . '] = 0; top.startHpRegen("main",' . $u['id'] . ',' . (0 + $sn['hpNow']) . ',' . (0 + $sn['hpAll']) . ',' . (0 + $sn['mpNow']) . ',' . (0 + $sn['mpAll']) . ',' . (time(
|
||||
) - $u['regHP']) . ',' . (time() - $u['regMP']) . ',' . (0 + $this->rgd[0]) . ',' . (0 + $this->rgd[1]) . ',1)</script>';
|
||||
$rt[0] .= '<script>top.lafstReg[' . $u['id'] . '] = 0; top.startHpRegen("main",' . $u['id'] . ',' . (0 + $sn['hpNow']) . ',' . (0 + $sn['hpAll']) . ',' . (0 + $sn['mpNow']) . ',' . (0 + $sn['mpAll']) . ',' . (time() - $u['regHP']) . ',' . (time() - $u['regMP']) . ',' . (0 + $this->rgd[0]) . ',' . (0 + $this->rgd[1]) . ',1)</script>';
|
||||
}
|
||||
if ($ivv == 0 && $i1 == 0) {
|
||||
$rt[0] .= $this->info_remont();
|
||||
@ -7279,9 +7237,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
$id_hod++;
|
||||
}
|
||||
mysql_query(
|
||||
'INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time(
|
||||
) . '","' . $u['battle'] . '","' . ($id_hod) . '","{tm1} ' . $text . ' у персонажа {u1}.","login1=' . $u['login'] . '||t1=' . $u['team'] . '||time1=' . time(
|
||||
) . '","","","","","6")'
|
||||
'INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time() . '","' . $u['battle'] . '","' . ($id_hod) . '","{tm1} ' . $text . ' у персонажа {u1}.","login1=' . $u['login'] . '||t1=' . $u['team'] . '||time1=' . time() . '","","","","","6")'
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -7649,8 +7605,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
);
|
||||
$this->error = 'Вам нехорошо...';
|
||||
} elseif (mysql_query(
|
||||
'UPDATE `items_users` SET `uid` = "' . $this->info['id'] . '",`lastUPD` = "' . time(
|
||||
) . '",`gift` = "' . $itm['gift'] . '",`gtxt1` = "' . $itm['gtxt1'] . '",`gtxt2` = "Предмет из упаковки. Дата запаковки: ' . date(
|
||||
'UPDATE `items_users` SET `uid` = "' . $this->info['id'] . '",`lastUPD` = "' . time() . '",`gift` = "' . $itm['gift'] . '",`gtxt1` = "' . $itm['gtxt1'] . '",`gtxt2` = "Предмет из упаковки. Дата запаковки: ' . date(
|
||||
'd.m.Y H:i:s', $itmin['time_create']
|
||||
) . '" WHERE `id` = "' . $itmin['id'] . '" LIMIT 1'
|
||||
)) {
|
||||
@ -7681,8 +7636,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
|
||||
$pid = $this->addItem($s['id'], $this->info['id']);
|
||||
if ($pid > 0) {
|
||||
mysql_query(
|
||||
'UPDATE `items_users` SET `lastUPD` = "' . time(
|
||||
) . '",`gift` = "' . $itm['gift'] . '" WHERE `id` = "' . $pid . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'
|
||||
'UPDATE `items_users` SET `lastUPD` = "' . time() . '",`gift` = "' . $itm['gift'] . '" WHERE `id` = "' . $pid . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1'
|
||||
);
|
||||
}
|
||||
$j++;
|
||||
@ -8004,14 +7958,12 @@ LIMIT 1'
|
||||
);
|
||||
$col = $col[0];
|
||||
mysql_query(
|
||||
'UPDATE `items_users` SET `lastUPD`="' . time() . '",`delete`="' . time(
|
||||
) . '" WHERE `item_id`="' . $itm['item_id'] . '" AND `inOdet` = 0 AND `delete` < 100000 AND `uid` = "' . $itm['uid'] . '" AND `data` NOT LIKE "%nodelete%"' . $whr
|
||||
'UPDATE `items_users` SET `lastUPD`="' . time() . '",`delete`="' . time() . '" WHERE `item_id`="' . $itm['item_id'] . '" AND `inOdet` = 0 AND `delete` < 100000 AND `uid` = "' . $itm['uid'] . '" AND `data` NOT LIKE "%nodelete%"' . $whr
|
||||
);
|
||||
$this->error = 'Предметы "' . $itm['name'] . ' (x' . ($col + 1) . ')" выброшены';
|
||||
$this->addDelo(
|
||||
1, $uid,
|
||||
'"<font color="maroon">System.inventory</font>": Предметы "<strong>' . $itm['name'] . ' (x' . $col . ')</strong>" [itm:' . $itm['id'] . '=' . time(
|
||||
) . '] были <strong>выброшены</strong>.', time(),
|
||||
'"<font color="maroon">System.inventory</font>": Предметы "<strong>' . $itm['name'] . ' (x' . $col . ')</strong>" [itm:' . $itm['id'] . '=' . time() . '] были <strong>выброшены</strong>.', time(),
|
||||
$this->info['city'], 'System.inventory', 0, 0
|
||||
);
|
||||
} else {
|
||||
@ -8085,8 +8037,7 @@ LIMIT 1'
|
||||
mysql_query(
|
||||
'UPDATE `stats` SET `exp` = "12499" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1'
|
||||
);
|
||||
echo '<script>chat.sendMsg(["new","' . time(
|
||||
) . '","6","","' . $this->info['login'] . '","Для перехода на 6-ой уровень требуется "<strong>Кристалл Вечности [6]</strong>".","Black","1","1","0"]);</script>';
|
||||
echo '<script>chat.sendMsg(["new","' . time() . '","6","","' . $this->info['login'] . '","Для перехода на 6-ой уровень требуется "<strong>Кристалл Вечности [6]</strong>".","Black","1","1","0"]);</script>';
|
||||
} else {
|
||||
mysql_query(
|
||||
'UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1'
|
||||
@ -8531,8 +8482,7 @@ LIMIT 1'
|
||||
$r = '<font color="#FF0000"><strong>Вы успешно изъяли предмет "' . $itm_['name'] . '"</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'] . '")'
|
||||
'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'] . '")'
|
||||
);
|
||||
mysql_query(
|
||||
'UPDATE `items_users` SET `lastUPD` = "' . time() . '", `uid` = "-21' . $res['id'] . '" ' . $o . ' WHERE `id` = "' . $id . '" LIMIT 1'
|
||||
@ -8563,8 +8513,7 @@ LIMIT 1'
|
||||
if ($user['inTurnir'] == 0 && $user['inTurnirnew'] == 0) {
|
||||
$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'] . '")'
|
||||
'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'] . '")'
|
||||
);
|
||||
mysql_query(
|
||||
'UPDATE `items_users` SET `lastUPD` = "' . time() . '", `uid` = "' . $user['id'] . '" WHERE `id` = "' . $id . '" LIMIT 1'
|
||||
@ -8606,8 +8555,7 @@ LIMIT 1'
|
||||
'UPDATE `items_users` SET `lastUPD` = "' . time() . '", `uid` = "' . $user['id'] . '", `data` = "' . $pl['data'] . '" WHERE `id` = "' . $pl['id'] . '"'
|
||||
);
|
||||
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'] . '")'
|
||||
'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'] . '")'
|
||||
);
|
||||
} elseif ($pl['uid'] == $user['id']) {
|
||||
$col = $this->itemsX(((int)$pl['id']));
|
||||
@ -8618,8 +8566,7 @@ LIMIT 1'
|
||||
'UPDATE `items_users` SET `lastUPD` = "' . time() . '", `uid` = "-21' . $user['clan'] . '" WHERE `id` = "' . $pl['id'] . '"'
|
||||
);
|
||||
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'] . '")'
|
||||
'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'] . '")'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
314
online.php
314
online.php
@ -4,6 +4,7 @@ if (!defined('GAME_VERSION')) {
|
||||
require_once '_incl_data/autoload.php';
|
||||
}
|
||||
|
||||
use Clan\ClanInfo;
|
||||
use Core\Config;
|
||||
use Core\Database;
|
||||
use Core\Db;
|
||||
@ -146,33 +147,21 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
|
||||
return $newbuf;
|
||||
}
|
||||
|
||||
$strSearch = [
|
||||
['\\', '"', "'", '<', '>', ' ', '>', '<', '\r', '\b', ' ', ''],
|
||||
['::', '[s1;]', '[s2;]', '[s3;]', '[s4;]', ' ',],
|
||||
];
|
||||
$strReplace = [
|
||||
['\\\\', '[s1;]', '[s2;]', '[s3;]', '[s4;]', ' ', '[s4;]', '[s3;]'],
|
||||
['', '"', '"', '<', '>', ' ',],
|
||||
];
|
||||
|
||||
$_POST['msg'] = $chat->expworld($_POST['msg'], 120);
|
||||
$_POST['msg'] = str_replace('\\', '\\\\', $_POST['msg']);
|
||||
$_POST['msg'] = str_replace('"', '[s1;]', $_POST['msg']);
|
||||
$_POST['msg'] = str_replace("'", '[s2;]', $_POST['msg']);
|
||||
$_POST['msg'] = str_replace('<', '[s3;]', $_POST['msg']);
|
||||
$_POST['msg'] = str_replace('>', '[s4;]', $_POST['msg']);
|
||||
$_POST['msg'] = str_replace(' ', ' ', $_POST['msg']);
|
||||
$_POST['msg'] = str_replace('>', '[s4;]', $_POST['msg']);
|
||||
$_POST['msg'] = str_replace('<', '[s3;]', $_POST['msg']);
|
||||
|
||||
$_POST['msg'] = str_replace("\r", '[s3;]br[s4;]', $_POST['msg']);
|
||||
$_POST['msg'] = str_replace("\b", '[s3;]br[s4;]', $_POST['msg']);
|
||||
$_POST['msg'] = str_replace(" ", '[s3;]TAB[s4;]', $_POST['msg']);
|
||||
$_POST['msg'] = str_replace("", '[s3;]TAB[s4;]', $_POST['msg']);
|
||||
|
||||
$_POST['msg'] = str_replace($strSearch[0], $strReplace[0], $_POST['msg']);
|
||||
$_POST['msg'] = htmlspecialchars($_POST['msg']);
|
||||
$_POST['msg'] = str_replace('%usersmile%', '', $_POST['msg']);
|
||||
$_POST['msg'] = tolink($_POST['msg']);
|
||||
|
||||
$_POST['msg'] = str_replace('::', '', $_POST['msg']);
|
||||
|
||||
$_POST['msg'] = str_replace('[s1;]', '"', $_POST['msg']);
|
||||
$_POST['msg'] = str_replace("[s2;]", '"', $_POST['msg']);
|
||||
$_POST['msg'] = str_replace('[s3;]', '<', $_POST['msg']);
|
||||
$_POST['msg'] = str_replace('[s4;]', '>', $_POST['msg']);
|
||||
|
||||
$_POST['msg'] = str_replace(' ', ' ', $_POST['msg']);
|
||||
$_POST['msg'] = str_replace($strSearch[1], $strReplace[1], $_POST['msg']);
|
||||
|
||||
$smg = Db::getRow('select * from chat where login = ? and time > unix_timestamp() - 20 order by time desc limit 1', [$u->info['login']]);
|
||||
|
||||
@ -208,7 +197,6 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
|
||||
$cmsg = new ChatMessage();
|
||||
$cmsg->setInvis($u->info['invis']);
|
||||
$cmsg->setDa(1);
|
||||
$cmsg->setCity($u->info['city']);
|
||||
$cmsg->setType(6);
|
||||
$cmsg->setColor('#f00');
|
||||
$cmsg->setText("Я спамер {$u->info['login']} и меня нужно заблокировать " . Config::get('https') . '/info/' . $u->info['id']);
|
||||
@ -278,7 +266,8 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
|
||||
if ($msg['fspam'] != '0') {
|
||||
$msg['spam'] = 1;
|
||||
$msg['delete'] = 1;
|
||||
$r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>В нашем чате запрещается сообщать ссылки на атльтернативные проекты. Повторные попытки могут привести к блокировке персонажа.</small>","Black","1","1","0"]);';
|
||||
$r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>В нашем чате запрещается сообщать ссылки на атльтернативные проекты.
|
||||
Повторные попытки могут привести к блокировке персонажа.</small>","Black","1","1","0"]);';
|
||||
}
|
||||
|
||||
if ($msg['spam'] == 1 && $u->info['molch1'] < time() && $u->info['admin'] == 0) {
|
||||
@ -298,12 +287,13 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
|
||||
if ($mban['vals'] + 1 < 2) {
|
||||
$msg['fspam'] = str_replace('%', '</b>,<b>', $msg['fspam']);
|
||||
$msg['fspam'] = '<b>' . ltrim($msg['fspam'], '0</b>,<b>') . '</b>';
|
||||
$r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>В нашем чате запрещается сообщать ссылки на атльтернативные проекты. Запрещенные слова: ' . $msg['fspam'] . '. Предупреждения [' . ($mban['vals'] + 1) . '/1]</small>","Black","1","1","0"]);';
|
||||
$r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>В нашем чате запрещается сообщать ссылки на атльтернативные проекты.
|
||||
Запрещенные слова: ' . $msg['fspam'] . '. Предупреждения [' . ($mban['vals'] + 1) . '/1]</small>","Black","1","1","0"]);';
|
||||
} else {
|
||||
$r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>В нашем чате запрещается сообщать ссылки на атльтернативные проекты. Вы наказаны за нарушение правил общения.</small>","Black","1","1","0"]);';
|
||||
$r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>В нашем чате запрещается сообщать ссылки на атльтернативные проекты.
|
||||
Вы наказаны за нарушение правил общения.</small>","Black","1","1","0"]);';
|
||||
|
||||
$cmsg = new ChatMessage();
|
||||
$cmsg->setCity($u->info['city']);
|
||||
$cmsg->setLogin('Комментатор');
|
||||
$cmsg->setText("Персонаж {$u->info['login']}[{$u->info['level']}] был наказан за нарушение правил общения.");
|
||||
$cmsg->setType(6);
|
||||
@ -328,12 +318,14 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
|
||||
if (is_array($msg['to'])) {// каким хером тут массив?
|
||||
$msg['to'] = '';
|
||||
}
|
||||
$r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<b>Вас добавили в игнор</b>: Вы не можете отправлять сообщения персонажу "' . htmlspecialchars($msg['to']) . '".","Black","1","1","0"]);';
|
||||
$r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<b>Вас добавили в игнор</b>:
|
||||
Вы не можете отправлять сообщения персонажу "' . htmlspecialchars($msg['to']) . '".","Black","1","1","0"]);';
|
||||
$msg['cancel']++;
|
||||
}
|
||||
if ($msg['type'] == 3 && $msg['to'] == 'klan') {
|
||||
if ($u->info['clan'] == 0) {
|
||||
$r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>Вы не являетесь частью одного из <b>Кланов</b> и не можете общаться по этому каналу.</small>","Black","1","1","0"]);';
|
||||
$r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>Вы не являетесь частью одного из <b>Кланов</b>
|
||||
и не можете общаться по этому каналу.</small>","Black","1","1","0"]);';
|
||||
$msg['cancel']++;
|
||||
} else {
|
||||
$msg['to'] = 'k' . $u->info['clan'];
|
||||
@ -415,45 +407,31 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
|
||||
$cmsg = new ChatMessage();
|
||||
if (preg_match("/анекдот/i", mb_convert_case($_POST['msg'], MB_CASE_LOWER))) {
|
||||
$text_com = '';
|
||||
$sp_all = Db::getValue('select count(*) from a_com_act where act = ? and time > unix_timestamp() limit 5', [$com_act]);
|
||||
if ($sp_all > 0) {
|
||||
if (rand(0, 100) < 75) {
|
||||
$text_com = [
|
||||
'Отстань попрошайка! ... Ищу анекдоты, интернет не маленький!',
|
||||
'Подожди... Сейчас что-нибудь найду',
|
||||
'Почти нашел...',
|
||||
'Вот один есть, но он не интересный...',
|
||||
'А свет на центральной площади тьму "пинает"... Эх...',
|
||||
];
|
||||
$text_com = $text_com[rand(0, (count($text_com) - 1))];
|
||||
}
|
||||
$sp_all = Db::getRow('select * from a_com_anekdot order by rand() limit 1');
|
||||
if (isset($sp_all['id'])) {
|
||||
$text_com = $sp_all['text'];
|
||||
$text_com = str_replace("<br>", "<br> ", $text_com);
|
||||
$text_com = str_replace("<br />", "<br /> ", $text_com);
|
||||
$text_com = str_ireplace("\r\n", "", $text_com);
|
||||
$text_com = str_replace("", "", $text_com);
|
||||
$text_com = '<b style="color: red">Анекдот</b>:<br> ' . $text_com . '<br>';
|
||||
} else {
|
||||
$sp_all = Db::getRow('select * from a_com_anekdot order by rand() limit 1');
|
||||
if (isset($sp_all['id'])) {
|
||||
$text_com = $sp_all['text'];
|
||||
$text_com = str_replace("<br>", "<br> ", $text_com);
|
||||
$text_com = str_replace("<br />", "<br /> ", $text_com);
|
||||
$text_com = str_ireplace("\r\n", "", $text_com);
|
||||
$text_com = str_replace("", "", $text_com);
|
||||
$text_com = '<b style="color: red">Анекдот</b>:<br> ' . $text_com . '<br>';
|
||||
} else {
|
||||
$text_com = 'Анекдот из головы вылетел...';
|
||||
}
|
||||
Db::sql('insert into a_com_act (act, time, uid) values (0, unix_timestamp() + 60, ?)', [$u->info['id']]);
|
||||
$text_com = 'Анекдот из головы вылетел...';
|
||||
}
|
||||
Db::sql('insert into a_com_act (act, time, uid) values (0, unix_timestamp() + 60, ?)', [$u->info['id']]);
|
||||
|
||||
if ($text_com != '') {
|
||||
$cmsg->setText($text_com);
|
||||
}
|
||||
} else {
|
||||
include_once 'commentator.php';
|
||||
if ($comment != '') {
|
||||
if (!empty($comment)) {
|
||||
$cmsg->setText($comment);
|
||||
}
|
||||
}
|
||||
if ($cmsg->getText()) {
|
||||
$cmsg->setLogin('Комментатор');
|
||||
$cmsg->setTo($u->info['login']);
|
||||
$cmsg->setCity($u->info['city']);
|
||||
$cmsg->setRoom($u->info['room']);
|
||||
$cmsg->setType(2);
|
||||
$chat->sendMsg($cmsg);
|
||||
@ -461,7 +439,6 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
|
||||
}
|
||||
Db::sql('update users set afk = default, dnd = default, timeMain = unix_timestamp() where id = ?', [$u->info['id']]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$ar_id = 0;
|
||||
@ -554,13 +531,8 @@ where
|
||||
if ($onlineUser['clan'] > 0) {
|
||||
if ($u->info['clan'] > 0 && $onlineUser['clan'] != $u->info['clan']) {
|
||||
if (!isset($cw['war'][$onlineUser['clan']][$u->info['clan']])) {
|
||||
$onlineUser['cwar'] = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT `id`,`type` FROM `clan_wars` WHERE
|
||||
((`clan1` = "' . $onlineUser['clan'] . '" AND `clan2` = "' . $u->info['clan'] . '") OR (`clan2` = "' . $onlineUser['clan'] . '" AND `clan1` = "' . $u->info['clan'] . '")) AND
|
||||
`time_finish` > ' . time() . ' LIMIT 1'
|
||||
)
|
||||
);
|
||||
$onlineUser['cwar'] = Db::getRow('select id, type from clan_wars where clan1 in (?,?) and clan2 in (?,?) and clan1 != clan2 and time_finish > unix_timestamp()',
|
||||
[$u->info['clan'], $onlineUser['clan'], $u->info['clan'], $onlineUser['clan'],]);
|
||||
if (isset($onlineUser['cwar']['id'])) {
|
||||
$cw['war'][$onlineUser['clan']][$u->info['clan']] = $onlineUser['cwar']['type'];
|
||||
} else {
|
||||
@ -572,13 +544,10 @@ where
|
||||
}
|
||||
}
|
||||
if (!isset($cw[$onlineUser['clan']])) {
|
||||
$onlineUser['clan'] = mysql_fetch_array(
|
||||
mysql_query('SELECT `name_mini` FROM `clan` WHERE `id` = "' . $onlineUser['clan'] . '" LIMIT 1')
|
||||
);
|
||||
$onlineUser['clan'] = ClanInfo::getNameById($onlineUser['clan']);
|
||||
} else {
|
||||
$onlineUser['clan'] = $cw[$onlineUser['clan']];
|
||||
}
|
||||
$onlineUser['clan'] = $onlineUser['clan']['name_mini'];
|
||||
}
|
||||
if ($onlineUser['atack'] > time() || $onlineUser['atack'] == 1 || $onlineUser['atack'] == 2) {
|
||||
if ($onlineUser['atack'] != 2) {
|
||||
@ -607,72 +576,18 @@ where
|
||||
$r['list'] = '{' . $r['list'] . '}';
|
||||
}
|
||||
|
||||
function json_fix_cyr($json_str)
|
||||
{
|
||||
return $json_str;
|
||||
}
|
||||
|
||||
|
||||
//Получаем сообщения
|
||||
if (isset($_GET['mid']) && !isset($_POST['mid'])) {
|
||||
$_POST['mid'] = $_GET['mid'];
|
||||
}
|
||||
$i = 0;
|
||||
$l = 0;
|
||||
$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
|
||||
`time` > ' . (time() - 360) . '
|
||||
) 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` < 0 AND
|
||||
`time` > -' . time() . ' AND
|
||||
(
|
||||
`to` = "' . $u->info['login'] . '" OR
|
||||
`to` = ""
|
||||
)
|
||||
)
|
||||
)
|
||||
ORDER BY `id`'
|
||||
);
|
||||
while ($pl = mysql_fetch_array($sp)) {
|
||||
|
||||
foreach ($chat->getMessages((int)$_POST['mid'], $u->info['login']) as $pl) {
|
||||
if ($pl['delete'] > 0) {
|
||||
$r['msg'] .= ',"m' . $i . '":["' . $pl['id'] . '","","delete","","","","","","","0","0","0","1","",""]';
|
||||
}
|
||||
|
||||
if ($pl['type'] == 6 || $pl['type'] == 8) {
|
||||
$pl['city'] = $u->info['city'];
|
||||
}
|
||||
|
||||
$see = 1;
|
||||
|
||||
if ($pl['type'] == 8 && $u->isModerator()) {
|
||||
@ -681,52 +596,21 @@ while ($pl = mysql_fetch_array($sp)) {
|
||||
|
||||
if (($pl['type'] > 0 && $pl['type'] < 4) || $pl['type'] == -3) {
|
||||
$pl['room'] = $u->info['room'];
|
||||
$pl['city'] = $u->info['city'];
|
||||
}
|
||||
|
||||
//fixme $pl['global'] - глобалка по всем городам. Если нет городов, то не нужна и глобалка. Теоретически.
|
||||
|
||||
//Проверки на доступ к просмотру
|
||||
if (
|
||||
((
|
||||
(
|
||||
$pl['type'] == 3 ||
|
||||
$pl['type'] == 4
|
||||
) &&
|
||||
(
|
||||
$pl['city'] == $u->info['city'] ||
|
||||
$pl['global'] == 1
|
||||
)
|
||||
) ||
|
||||
(
|
||||
(
|
||||
$pl['type'] == 5 ||
|
||||
$pl['type'] == 6 ||
|
||||
(
|
||||
$pl['type'] == 8 && $u->isModerator()
|
||||
)
|
||||
) &&
|
||||
(
|
||||
$pl['city'] == $u->info['city'] ||
|
||||
$pl['global'] == 1
|
||||
)
|
||||
) ||
|
||||
(
|
||||
$pl['type'] == 7 &&
|
||||
$pl['city'] == $u->info['city'] &&
|
||||
$pl['room'] == $u->info['room']
|
||||
) ||
|
||||
(
|
||||
$pl['type'] == 6 &&
|
||||
(
|
||||
$pl['city'] == $u->info['city'] ||
|
||||
$pl['global'] == 1
|
||||
)
|
||||
) ||
|
||||
(
|
||||
(($pl['type'] == 3 || $pl['type'] == 4) && $pl['global'] == 1) ||
|
||||
(($pl['type'] == 5 || $pl['type'] == 6 || $pl['type'] == 8 && $u->isModerator()) && $pl['global'] == 1) ||
|
||||
($pl['type'] == 7 && $pl['room'] == $u->info['room']) ||
|
||||
($pl['type'] == 6 && $pl['global'] == 1) ||
|
||||
$pl['type'] == 9 ||
|
||||
$pl['type'] == 10
|
||||
) &&
|
||||
$pl['to'] != '' &&
|
||||
$pl['login'] != $u->info['login'] &&
|
||||
$pl['to'] != $u->info['login']
|
||||
$pl['to'] != '' && $pl['login'] != $u->info['login'] && $pl['to'] != $u->info['login']
|
||||
) {
|
||||
$n = 0;
|
||||
$ex = explode(',', $pl['to']);
|
||||
@ -743,7 +627,7 @@ while ($pl = mysql_fetch_array($sp)) {
|
||||
unset($n, $j, $ex);
|
||||
}
|
||||
//Клановое сообщение (по всем городам)
|
||||
if ($pl['type'] == -3 && ($pl['to'] == 'k' . $u->info['clan'] || $u->info['admin'] > 0)) {
|
||||
if ($pl['type'] == -3 && ($pl['to'] == 'k' . $u->info['clan'] || $u->isAdmin())) {
|
||||
$pl['type'] = 3;
|
||||
if ($pl['to'] == 'k' . $u->info['clan']) {
|
||||
$pl['to'] = 'klan';
|
||||
@ -763,11 +647,6 @@ while ($pl = mysql_fetch_array($sp)) {
|
||||
$see = 0;
|
||||
}
|
||||
|
||||
//Системное сообщение по всему городу
|
||||
if ($pl['type'] == 8 && $pl['city'] != $u->info['city'] && $pl['global'] == 0) {
|
||||
$see = 0;
|
||||
}
|
||||
|
||||
//Сообщение с молчанкой
|
||||
if ($pl['molch'] > 0) {
|
||||
$see = 0;
|
||||
@ -775,29 +654,15 @@ while ($pl = mysql_fetch_array($sp)) {
|
||||
|
||||
//Сообщение отправлено в другой комнате
|
||||
if (
|
||||
(
|
||||
$pl['type'] == 1 ||
|
||||
$pl['type'] == 2
|
||||
) &&
|
||||
(
|
||||
$pl['room'] != $u->info['room'] ||
|
||||
$pl['city'] != $u->info['city']
|
||||
) &&
|
||||
(
|
||||
$pl['global'] == 0 ||
|
||||
$_COOKIE['chatCfg11'] == 0
|
||||
)
|
||||
($pl['type'] == 1 || $pl['type'] == 2) &&
|
||||
($pl['room'] != $u->info['room']) &&
|
||||
($pl['global'] == 0 || $_COOKIE['chatCfg11'] == 0)
|
||||
) {
|
||||
$see = 0;
|
||||
}
|
||||
|
||||
//Сообщение прочее, в другом городе
|
||||
if ($pl['city'] != $u->info['city'] && $pl['global'] == 0) {
|
||||
$see = 0;
|
||||
}
|
||||
|
||||
//Глобал
|
||||
if ($pl['global'] == 1 && $pl['city'] == $u->info['city'] && $pl['type'] != -3) {
|
||||
if ($pl['global'] == 1 && $pl['type'] != -3) {
|
||||
$see = 1;
|
||||
}
|
||||
|
||||
@ -806,13 +671,7 @@ while ($pl = mysql_fetch_array($sp)) {
|
||||
$see = 0;
|
||||
}
|
||||
|
||||
$modr = 0;
|
||||
|
||||
if ($u->isModerator()) {
|
||||
$modr = 1;
|
||||
}
|
||||
|
||||
if ($pl['login'] != $u->info['login'] && $pl['nosee'] != 0 && $u->info['id'] != $pl['nosee'] && $u->info['admin'] == 0 && $modr == 0) {
|
||||
if ($pl['login'] != $u->info['login'] && $pl['nosee'] != 0 && $u->info['id'] != $pl['nosee'] && !$u->isModerator()) {
|
||||
$see = 0;
|
||||
} else {
|
||||
if ($pl['nosee'] != 0 && $pl['login'] != $u->info['login']) {
|
||||
@ -820,14 +679,14 @@ while ($pl = mysql_fetch_array($sp)) {
|
||||
if ($u->info['id'] == $pl['nosee']) {
|
||||
$noseein = 'ваш реферал';
|
||||
}
|
||||
$pl['text'] = '<span style=\"padding:0 5px 0 5px;background-color:#FFC;\"><font color=red><small>[' . $noseein . ']</small></font> ' . $pl['text'] . '</span>';
|
||||
if ($u->info['admin'] > 0 || $modr == 1) {
|
||||
$pl['text'] = '<span style="padding:0 5px 0 5px;background-color:#FFC;"><small style="color: red;">[' . $noseein . ']</small> ' . $pl['text'] . '</span>';
|
||||
if ($u->isModerator()) {
|
||||
$see = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($see == 1 && $pl['delete'] == 0 && $pl['login'] != '') {
|
||||
if ($see == 1 && $pl['login'] != '') {
|
||||
|
||||
$qix = Db::getValue('select id from friends where ignor > 0 and login_ignor = ? and (user_ignor = ? or user = ?)', [$pl['login'], $u->info['login'], $u->info['id']]);
|
||||
if (isset($qix)) {
|
||||
@ -836,21 +695,19 @@ while ($pl = mysql_fetch_array($sp)) {
|
||||
unset($qix);
|
||||
}
|
||||
|
||||
if ($see == 1 && $pl['delete'] == 0) {
|
||||
if ($see == 1) {
|
||||
if ($pl['time'] < 0) {
|
||||
if ($pl['to'] == '') {
|
||||
$lmsch = mysql_fetch_array(mysql_query('SELECT `id` FROM `chat` ORDER BY `id` DESC LIMIT 1'));
|
||||
if (isset($lmsch['id'])) {
|
||||
$lmsch['id']++;
|
||||
mysql_query(
|
||||
'UPDATE `chat` SET `id` = "' . $lmsch['id'] . '",`time` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'
|
||||
);
|
||||
$pl['id'] = $lmsch['id'];
|
||||
$lmsch = Chat::getLastMessageId();
|
||||
if ($lmsch > 0) {
|
||||
$lmsch++;
|
||||
Chat::setCurrentTimeAndIdById($pl['id'], $lmsch);
|
||||
$pl['id'] = $lmsch;
|
||||
} else {
|
||||
mysql_query('UPDATE `chat` SET `time` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
|
||||
Chat::setCurrentTimeById($pl['id']);
|
||||
}
|
||||
} else {
|
||||
mysql_query('UPDATE `chat` SET `time` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
|
||||
Chat::setCurrentTimeById($pl['id']);
|
||||
}
|
||||
$pl['time'] = time();
|
||||
}
|
||||
@ -860,12 +717,12 @@ while ($pl = mysql_fetch_array($sp)) {
|
||||
$reimg = [];
|
||||
if (preg_match_all(
|
||||
"/\[img\[(.*?)\]\]\[1\]/", $pl['text'], $reimg
|
||||
) && ($u->info['admin'] > 0 || $pl['type'] == 5 || $pl['type'] == 6 || $pl['type'] == 10 || $pl['type'] == 11)) {
|
||||
) && ($u->isAdmin() || $pl['type'] == 5 || $pl['type'] == 6 || $pl['type'] == 10 || $pl['type'] == 11)) {
|
||||
$k = 0;
|
||||
while ($k <= count($reimg[1])) {
|
||||
$pl['text'] = str_replace(
|
||||
'[img[' . $reimg[1][$k] . ']][1]',
|
||||
'<img src=//img.new-combats.tech/i/' . $reimg[1][$k] . ' height=19>', $pl['text']
|
||||
'<img src=' . Config::img() . '/i/' . $reimg[1][$k] . ' height=19>', $pl['text']
|
||||
);
|
||||
$k++;
|
||||
}
|
||||
@ -876,7 +733,7 @@ while ($pl = mysql_fetch_array($sp)) {
|
||||
$k = 0;
|
||||
while ($k <= count($reimg[1])) {
|
||||
$pl['text'] = str_replace(
|
||||
'[img[' . $reimg[1][$k] . ']]', '<img src=//img.new-combats.tech/i/' . $reimg[1][$k] . '>',
|
||||
'[img[' . $reimg[1][$k] . ']]', '<img src=' . Config::img() . '/i/' . $reimg[1][$k] . '>',
|
||||
$pl['text']
|
||||
);
|
||||
$k++;
|
||||
@ -919,21 +776,20 @@ while ($pl = mysql_fetch_array($sp)) {
|
||||
}
|
||||
|
||||
if ($pl['type'] != 3 && ($pl['invis'] == 1 || $pl['invis'] > time())) {
|
||||
if ($u->info['admin'] == 0) {
|
||||
$pl['login'] = '<b><i>Невидимка</i></b>';
|
||||
} else {
|
||||
$pl['login'] = '<b><i>Невидимка</i></b></a> <small>(' . $pl['login'] . ')</small>';
|
||||
$pl['login'] = '<b><i>Невидимка</i></b>';
|
||||
if ($u->isAdmin()) {
|
||||
$pl['login'] .= '</a> <small>(' . $pl['login'] . ')</small>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($pl['invis'] > 0 && ($pl['type'] == 1 || $pl['type'] == 2)) {
|
||||
$pl['color'] = 'Black';
|
||||
}
|
||||
|
||||
$r['msg'] .= ',"m' . $i . '":["' . $pl['id'] . '","' . $pl['time'] . '","' . $pl['type'] . '","' . $pl['login'] . '","' . $pl['to'] . '","' . $pl['text'] . '","' . $pl['color'] . '","' . $pl['toChat'] . '","' . $pl['typeTime'] . '","' . $pl['sound'] . '","' . $pl['global'] . '","' . $pl['molch'] . '","' . $pl['active'] . '","' . date(
|
||||
'H:i', $pl['time']
|
||||
) . '","' . date('d.m.Y H:i', $pl['time']) . '","' . $pl['frv'] . '","' . $pl['invis'] . '"]';
|
||||
$r['msg'] .= ',"m' . $i . '":["' . $pl['id'] . '","' . $pl['time'] . '","' . $pl['type'] . '","' . $pl['login'] . '","' .
|
||||
$pl['to'] . '","' . $pl['text'] . '","' . $pl['color'] . '","' . $pl['toChat'] . '","' . $pl['typeTime'] . '","' . $pl['sound'] .
|
||||
'","' . $pl['global'] . '","' . $pl['molch'] . '","' . $pl['active'] . '","' . date('H:i', $pl['time']) . '","' .
|
||||
date('d.m.Y H:i', $pl['time']) . '","' . $pl['frv'] . '","' . $pl['invis'] . '"]';
|
||||
}
|
||||
}
|
||||
if ($l < $pl['id']) {
|
||||
@ -957,12 +813,7 @@ if ($r['key'] == $_GET['key']) {
|
||||
$r['rn'] = $u->room['name'];
|
||||
}
|
||||
|
||||
$posts = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT COUNT(`id`) FROM `items_users` AS `iu` WHERE `iu`.`uid` = "-51' . $u->info['id'] . '" AND `iu`.`delete` = 0 AND `iu`.`inOdet` = 0 AND `iu`.`inShop` = 0 AND `iu`.`lastUPD` < ' . time() . ' LIMIT 1'
|
||||
)
|
||||
);
|
||||
$posts = $posts[0];
|
||||
$posts = Db::getValue('select count(id) from items_users where uid = ? and inOdet = 0 and inShop = 0 and lastUPD < unix_timestamp()', ['-51' . $u->info['id']]);
|
||||
|
||||
if ($posts > 0) {
|
||||
$r['js'] .= ' $("#postdiv").show();';
|
||||
@ -971,17 +822,14 @@ if ($posts > 0) {
|
||||
}
|
||||
|
||||
//Предложение на обмен
|
||||
$trf = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT * FROM `transfers` WHERE `uid2` = "' . $u->info['id'] . '" AND `start2` = 0 AND `cancel1` = 0 AND `cancel2` = 0 LIMIT 1'
|
||||
)
|
||||
);
|
||||
if (isset($trf['id'])) {
|
||||
$utf = mysql_fetch_array(mysql_query('SELECT `login` FROM `users` WHERE `id` = "' . $trf['uid1'] . '" LIMIT 1'));
|
||||
if (isset($utf['login']) && $u->info['battle'] == 0) {
|
||||
$r['js'] .= 'top.intransferNew(' . $trf['id'] . ',"' . $utf['login'] . '");';
|
||||
$transfer = Db::getRow('select id, uid1 from transfers where uid2 = ? and start2 = 0 and cancel1 = 0 and cancel2 = 0', [$u->info['id']]);
|
||||
|
||||
if (isset($transfer['id'])) {
|
||||
$utf = User::getLoginById($transfer['uid1']);
|
||||
if (!empty($utf) && $u->info['battle'] == 0) {
|
||||
$r['js'] .= 'top.intransferNew(' . $transfer['id'] . ',"' . $utf . '");';
|
||||
} else {
|
||||
mysql_query('UPDATE `transfers` SET `cancel2` = "' . time() . '" WHERE `id` = "' . $trf['id'] . '" LIMIT 1');
|
||||
Db::sql('update transfers set cancel2 = unix_timestamp() where id = ?', [$transfer['id']]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user